My WAMP 3 vhost (vhost was setup with WAMP tool) stopped working, here are my particulars:
hosts file
127.0.0.1 localhost
::1 localhost
127.0.0.1 projectx
::1 projectx
http.conf
...
Listen 127.0.0.1:80
Listen [::1]:80
...
LoadModule vhost_alias_module modules/mod_vhost_alias.so
...
httpd-vhosts.conf
<VirtualHost *:80>
ServerName localhost
DocumentRoot C:/company/profordable/server/local/wamp/server/wamp64/www
<Directory "C:/company/profordable/server/local/wamp/server/wamp64/www/">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName projectx
DocumentRoot c:/company/profordable/projects/projectx/www
<Directory "c:/company/profordable/projects/projectx/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
Here is the apache access log:
::1 - - [17/Aug/2016:17:53:34 -0400] "GET / HTTP/1.1" 302 3054
which I think means there is a redirect going on, because when I click the link to go to http://projectx/ it rests on the localhost main page.
Any help would be greatly appreciated. Nate
Related
I have xampp with apache 2.4 on windows 10.
i have this configuration in my C:\xampp\apache\conf\extra\httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs"
ServerName localhost
ServerAlias www.localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/site3/web"
ServerName site3.localhost
ServerAlias www.site3.localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/site2/web"
ServerName site2.localhost
ServerAlias www.site2.localhost
</VirtualHost>
I added in my hosts file:
127.0.0.1 site2.localhost
127.0.0.1 site3.localhost
127.0.0.1 www.site2.localhost
127.0.0.1 www.site3.localhost
When i browse http://site2.localhost i see xampp root index.
When i browse http://site3.localhost i see again xampp root index.Same with www.site2.localhost...
What am I doing wrong?
A quick bit of info on Virtual Hosts. If you set one up and when you try and use it it sends you to the first Virtual Host, normally localhost it means there is something wrong with the Virtual Host definition or the HOSTS file, or you have entered the url incorrectly.
Apache will use the first VH defined in the file as the default site.
First remove these 2 lines from the HOSTS file
127.0.0.1 www.site2.localhost
127.0.0.1 www.site3.localhost
The HOSTS file should look like this
127.0.0.1 localhost
127.0.0.1 site2.localhost
127.0.0.1 site3.localhost
::1 localhost
::1 site2.localhost
::1 site3.localhost
Now each Virtual Host definition should also include some access rights like this
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/site3/web"
ServerName site3.localhost
ServerAlias www.site3.localhost
<Directory "C:/xampp/htdocs/site3/web/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/site2/web"
ServerName site2.localhost
ServerAlias www.site2.localhost
<Directory "C:/xampp/htdocs/site2/web/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
Hi ive been attempting to set up a wamp server so people can access it for testing
everything works correctly on my pc and i believe i have everything set up correctly but noone can connect to the site as it cant be reached
i have opened port 80 on my router and my firewall
my hosts file is as follows
127.0.0.1 localhost
::1 localhost
127.0.0.1 bandicam.com
127.0.0.1 ssl.bandisoft.com
127.0.0.1 btcGame.local
::1 btcGame.local
my httpd-vhosts.conf is as follows
#
# Virtual Hosts
#
<VirtualHost *:80>
DocumentRoot "g:/wamp/www"
ServerName localhost
ServerAlias localhost
ErrorLog "logs/localhost-error.log"
CustomLog "logs/localhost-access.log" common
<Directory "G:/wamp/www">
AllowOverride All
Options Indexes FollowSymLinks
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName btcGame.local
ServerAlias www.btcGame.local
DocumentRoot "c:/wamp64/www/btcgame"
ErrorLog "logs/btcGame-error.log"
CustomLog "logs/btcGame-access.log" common
<Directory "/">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
is there any other things i need to change in order to get my website online?
Other people trying to access your computer should know where to look.
Your server should then be referenced in the hosts file of their machine, except that IP should be resolvable such as
your.local.ip btcGame.local
I want to change the adress of my website from http://localhost/tests/home.html
to www.mywebsite.com.
I edited the following files as explained :
C:\wamp\bin\apache\Apache2.2.17\conf\httpd.conf
C:\wamp\bin\apache\Apache2.2.17\conf\extra\httpd-vhosts.conf
C:\Windows\System32\drivers\etc\hosts
However, i'm not redirected to home.html but to the Wamp Server Homepage.
Any idea on how to solve this ? For info, here's my httpd-vhosts.conf and hosts file.
<VirtualHost *:80>
ServerName www.mywebsite.com
DocumentRoot c:/wamp64/www/tests
<Directory "c:/wamp64/www/tests/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
127.0.0.1 localhost
127.0.0.1 tests
127.0.0.1 www.mywebsite.com
::1 localhost
::1 tests
::1 www.mywebsite.com
Also, note that there are more than one files in my www/tests folder, but i want to access to home.html specifically.
You also need a VH definition fot localhost when you create virtual hosts
<VirtualHost *:80>
ServerName localhost
DocumentRoot c:/wamp64/www
<Directory "c:/wamp64/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
And the Server name should be mywebsite.com with a ServerAlias if you want to use the www.www.mywebsite.com
<VirtualHost *:80>
ServerName mywebsite.com
ServerAlias www.mywebsite.com
DocumentRoot c:/wamp64/www/tests
<Directory "c:/wamp64/www/tests/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
Hosts file changes
127.0.0.1 localhost
127.0.0.1 tests
127.0.0.1 mywebsite.com
::1 localhost
::1 tests
::1 mywebsite.com
Once these are chnaged, remember to reset the dnscache
net stop dnscache
net start dnscache
And the restart Apache to pick up these chnages
wampmanager -> Apache -> Restart Service
I keep getting a 503 error when I try to set up a virtual host. I can set up an aliased folder just fine, but no luck on the virtual host setup.
My hosts file looks like this:
127.0.0.1 localhost
::1 localhost
127.0.0.1 appmarket.local
::1 appmarket.local
My vs-hosts file looks like this:
<VirtualHost *:100>
DocumentRoot "C:/nanomarketvhost/local"
ServerName appmarket.local
ServerAlias appmarket.local
ErrorLog "logs/appmarket-error.log"
CustomLog "logs/appmarket-access.log" common
<Directory "C:/nanomarketvhost/local">
AllowOverride All
Options Indexes FollowSymLinks
Require local
</Directory>
</VirtualHost>
<VirtualHost *:100>
DocumentRoot "c:/wamp/www"
ServerName localhost
ServerAlias localhost
ErrorLog "logs/localhost-error.log"
CustomLog "logs/localhost-access.log" common
<Directory "C:/wamp/www">
AllowOverride All
Options Indexes FollowSymLinks
Require local
</Directory>
</VirtualHost>
I have commented out the lines in the httpd.conf to load virtual hosts.
I am following RiggsFolly answer, on this question and these examples and so far everything went well, but when I click on the vhost FF says that it can't find the server. How can this fixed?
I am using Wampserver 2.5.
I get this in the adress bar : http://www.cakeprebuild.com/
httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot "c:/wamp/www"
ServerName localhost
ServerAlias localhost
<Directory "c:/wamp/www">
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /wamp/www/CakePreBuild
ServerName www.CakePreBuild.com
<Directory "c:/wamp/www/CakePreBuild">
AllowOverride All
Require local
</Directory>
</VirtualHost>
hosts
127.0.0.1 localhost
127.0.0.1 localhost
127.0.0.1 localhost
127.0.0.1 localhost
127.0.0.1 localhost
127.0.0.1 localhost
127.0.0.1 localhost
127.0.0.1 CakePreBuild
::1 localhost
::1 CakePreBuild
Try these changes
Your VHOSTS Definition
<VirtualHost *:80>
DocumentRoot "c:/wamp/www"
ServerName localhost
ServerAlias localhost
<Directory "c:/wamp/www">
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "c:/wamp/www/CakePreBuild"
ServerName cakeprebuild.com
ServerAlias www.cakeprebuild.com
<Directory "c:/wamp/www/CakePreBuild">
AllowOverride All
Require local
</Directory>
</VirtualHost>
Your HOSTS file
127.0.0.1 localhost
127.0.0.1 cakeprebuild.com
::1 localhost
::1 cakeprebuild.com
Personally I would avoid using the .com tld for sites your are developing and use something like .dev.
If a site actually existed called cakeprebuild.com having added that name to the HOSTS file would mean you would never be able to access the actual live site from this PC as you have redirected it to this PC.
I'm guessing wamp is not configured correctly for your vhost. FF (and chrome to a lesser degree) will try and help you out add the
'http://www.' and '.com'
around what you entered, if what you entered didn't return a result. Turn off wamp and type in 'localhost', you'll be redirected to
http://www.localhost.com