I am trying to install magento on a virtual host in my system running with XAMPP
I have done following till now :
Added lines in the hosts file under windows/system32/driver/host
192.168.1.69 magento2.hue
192.168.1.69 www.magento2.hue
Then added code in httpd-vhosts.conf in XAMPP folder
NameVirtualHost 192.168.1.69:80
<VirtualHost magento2.hue>
ServerAdmin magento2.hue
DocumentRoot "C:/www/mag_domain2/httpdocs/"
ServerName magento2.hue
ServerAlias www.magento2.hue
ErrorLog "C:/www/mag_domain2/httpdocs/error.log"
CustomLog "C:/www/mag_domain2/httpdocs/access.log" combined
<Directory "C:/www/mag_domain2/httpdocs">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Restarted Apache and Mysql, but the site i.e magento2.hue is not loading.
Can you please figure out if i am doing something wrong here ?
try with below httpd.conf setting it working at my end
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "D:/xampp/htdocs/yourmagentosetup"
ServerName magento2.hue
</VirtualHost>
hope this will sure work for you.
Oh my,
I just figure it out.. i have previously added another vhost which points to 192.168.1.59 and is working fine
I just needed to point new one to the same IP and change the ServerName to magento2.hue instead of magento.hue as was of previous one.
it works now.
Thanks liyakat and Arjun for viewing this question.
Related
Im on windows 10, trying to customize an url to use Laravel. I dont want to acess the url using public folder on it. Im using wamp and apache is running on port 8080. So I edit the file wamp\bin\apache\apache2.4.23\conf\extra\httpd-vhosts.conf like this:
<VirtualHost *:80>
DocumentRoot c:/wamp/www/
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot c:/wamp/www/laravel_test/blog/public
ServerName laravel_test.dev
</VirtualHost>
After that, I edit the file system32/drivers/etc/hosts with:
127.0.0.1 localhost
127.0.0.1 laravel_test.dev
And when I access the url laravel_test.dev it doesnt work. I tried to use this too on httpd-vhosts.conf:
<VirtualHost *:8080>
And it doesnt work either. I always restart the service on wamp, and nothing changes.
I couldnt install and configure the homestead properly, so im trying to use wamp now. Can somebody help me?
In your httpd.conf file you need to uncomment the virtual Hosts section
Then,
Your vhost needs to listen on port 8080
<VirtualHost *:8080>
ServerName laraveltest.dev
ServerAlias www.laraveltest.dev
DocumentRoot c:/wamp/www/laravel_test/blog/public
<Directory "c:/wamp/www/laravel_test/blog/public">
AllowOverride All
Options Indexes MultiViews FollowSymLinks
Require all granted
</Directory>
</VirtualHost>
For your hosts file
127.0.0.1 laraveltest.dev www.laraveltest.dev
I just started learning php and I am trying to host locally my own php website by using XAMPP.
I wanted to create virtual host with:
URL: myphpwebsite.local
Port: 8088
But when I attempted to access this website through the browser I got a:
Not Found
HTTP Error 404. The requested resource is not found.
Does anyone know what the problem is?
My httpd-vhosts.conf
NameVirtualHost 127.0.0.1:8088
<VirtualHost 127.0.0.1:8088>
DocumentRoot "C:/xampp/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost myphpwebsite.local>
DocumentRoot "C:/Microsoft/Workspace/myphpwebsite"
ServerName myphpwebsite.local
ErrorLog "C:/Microsoft/Workspace/myphpwebsite/logs/myphpwebsite.local.error.log"
CustomLog "C:/Microsoft/Workspace/myphpwebsite/logs/myphpwebsite.local.custom.log" combined
<Directory "C:/Microsoft/Workspace/myphpwebsite">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
And my C:\Windows\System32\drivers\etc\hosts file:
127.0.0.1 localhost
127.0.0.1 myphpwebsite.local
Any help would be appreciated!
make sure there's file/htaccess/index or whatever in directory you want to open, 404 may comes from that ;)
try using one below, eventually replace your port:
<VirtualHost *:80>
DocumentRoot "C:/Microsoft/Workspace/myphpwebsite"
ServerName myphpwebsite.local
</VirtualHost>
the question is your Apache running/serving on port 8088?
For example my xamp is running on 80 and 443...
xamp control panel is very handy, it has nice logs button that will open your log files to show you php and apache errors etc. check it out.
Try going with default port, if it works it means that you need to play with ports if you really want to.
just a quick tip, .com is shorter than .local and if you're using chrome and it works like mine then most of the time something.local will redirect you to google search (and I like my search there, you can switch it off ;))
I don't know if I am much help, but using WAMP, here are my settings. I am listening on port 80, I use 8080 for my tomcat server.
hosts file
127.0.0.1 local.mysite.com
httpd-vhosts.conf
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
....
<Directory "c:/wamp/www">
Options Indexes MultiViews FollowSymLinks
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>
<VirtualHost *:80>
ServerName localhost
DocumentRoot "c:/wamp/www"
</VirtualHost>
<Directory "c:/wamp/www/path/to/site/root">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<VirtualHost *:80>
ServerName local.mysite.com
DocumentRoot "c:/wamp/www/path/to/site/root"
ServerAdmin me#email.com
ProxyPreserveHost Off
RewriteEngine On
AllowEncodedSlashes NoDecode
#AllowEncodedSlashes On
ErrorLog "c:/wamp/www/path/to/logs/error.log"
CustomLog "c:/wamp/www/path/to/logs/access.log" common
</VirtualHost>
....
Then I can access my local site like this: http://local.mysite.com
Hope this helps...
The NameVirtualHost directive needs to match the value of VirtualHost exactly, and you need to specify the port in each instance. If you want to use port 8088 for myphpwebsite.local, you'd need to do:
NameVirtualHost 127.0.0.1:8088
<VirtualHost 127.0.0.1:8088>
DocumentRoot "C:/xampp/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost 127.0.0.1:8088>
DocumentRoot "C:/Microsoft/Workspace/myphpwebsite"
ServerName myphpwebsite.local
ErrorLog "C:/Microsoft/Workspace/myphpwebsite/logs/myphpwebsite.local.error.log"
CustomLog "C:/Microsoft/Workspace/myphpwebsite/logs/myphpwebsite.local.custom.log" combined
<Directory "C:/Microsoft/Workspace/myphpwebsite">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Notice the VirtualHost opening tags are identical; it's the ServerName value that actually tells Apache which domain this particular directive applies to. Restart your server after making the changes. Check out this page for more information: http://httpd.apache.org/docs/2.2/vhosts/name-based.html
Hope this helps!
Make sure that the port you are using is not being used by another service.
I tried a lot to run directly through zend.localhost and and got frustrated
I am using xammp in kali linux
but it shows as in pic
I had added this in my httpd-vhost.conf
<VirtualHost *:80>
ServerName zend.localhost
DocumentRoot /opt/lampp/htdocs/zend/public
<Directory /opt/lampp/htdocs/zend/public>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
We will need a little more explanation on your error to help you ...
Did you mapped zend.localhost to 127.0.0.1 (or your ip address) in your /etc/hosts ?
I have installed wamp a handful of times, and have it working on my local environment. Currently I am attempting to resolve an issue on a server of mine which is running wamp. I uninstalled a working copy, and now when I attempted to reinstall I have been unsuccessful. I have changed the port to be 8080 and have configured the httpf.config to do so.
ServerName 50.56.176.95:8080
ServerRoot "C:/wamp/bin/apache/apache2.4.9"
Listen 50.56.176.95:8080
<virtualHost *:8080>
DocumentRoot "c:/wamp/www/Hi"
ServerName 50.56.176.95
</virtualHost>
<virtualHost *:8080>
DocumentRoot "c:/wamp/www/Hi"
ServerName 50.56.176.95
<directory "c:/wamp/www/Hi">
Order allow,deny
Allow from all
Require all granted
</directory>
</virtualHost>
Wamp turns on and apache and php start up, however if I attempt o access 50.56.176.96:8080 I will get a 404 error.
Something to note is that everything is commented out in the htacces file in the www directory.
Should the ServerName not actually be a name and not an ip address?
Also you are using Apache 2.2 and Apache 2.4 access control syntax in the same VH def? As you are using Apache 2.4 it may be best to stick to 2.4 syntax.
So maybe this will work :-
<VirtualHost *:8080>
DocumentRoot "c:/wamp/www/Hi"
ServerName hi.com
ServerAlias www.hi.com
<Directory "c:/wamp/www/Hi">
Require all granted
</Directory>
</VirtualHost>
I am trying to install PHP-Laravel in Windows 8 and I am using Xamp server(localhost). I am following Installing Laravel guide.
According to this guide I am making virtual host using following code :
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/TssApp/public"
ServerName TssApp
<Directory "C:/xampp/htdocs/TssApp/public">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
</Directory>
</VirtualHost>
//Where "C:/xampp/htdocs/TssApp/public" is path of Laravel public folder
and I have also added following line in in etc/hosts
127.0.0.2 TssApp
After doing necessary steps mentioned in this tutorial when I type "http://TssApp" , it always redirect to "http://tssapp/xampp/" instead of Laravel Home page. I don't know if I am missing any thing.
Note: I can access laravel home page at "http://localhost/tssapp/public/" but want
to use "http://TssApp" link to access my application.
Please help me regarding this issue.
Thanks .
Do you have NameVirtualHost * in your virtual-hosts configuration?
You'll need to restart Apache after any changes to either /etc/hosts or your virtual-hosts configuration files
Try adding the code to C:\xampp\apache\conf\extra\httpd-vhosts.conf instead of adding it to your own conf file. As far as I know xampp will ignore it unless its in the vhosts file.
You could try this.
<VirtualHost *>
DocumentRoot "C:\xampp\htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *>
DocumentRoot "C:\xampp\htdocs\TssApp\public"
ServerName tssapp
<Directory "C:\xampp\htdocs\TssApp\public">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Although you should put your files in the xampp directory and not the htdocs directory, so your files should be C:\xampp\TssApp\public, This would stop people from visiting htdocs which is a public folder and getting access to your application.
According to the documentation (that you point to), you should write
<VirtualHost 127.0.0.2>
and not
<VirtualHost *:80>
Could you try that and restart your computer/server?
Add in:
Allow from all
after
AllowOverride all
The end result should be:
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/TssApp/public"
ServerName TssApp
<Directory "C:/xampp/htdocs/TssApp/public">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Allow from all
</Directory>
</VirtualHost>
Also make sure you are editing the file "httpd-vhosts.conf" found in:
C:\xampp\apache\conf\extra