Wamp Virtual Host Set Up - wamp

sorry for having a similar question to what has been posted all ready but the others aren't helping me.
I'm trying to set up a virtual host on my windows 8 computer but I can't seem to get it to work no matter what tutorial or help section i follow, this is my setup so far.
httpd-vhosts.conf
# Virtual Hosts
#
# Required modules: mod_log_config
Listen 80
<VirtualHost *:80>
ServerAdmin admin#localhost.com
DocumentRoot "C:\Program Files (x86)\2. Apps\Wamp\www"
ServerName localhost
<Directory "C:/wamp/www">
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin admin#localhost.com
DocumentRoot "C:\Users\Chris\Documents\Projects\testsite\Site"
ServerName testingsite
ServerAlias testingsite
<directory "C:\Users\Chris\Documents\Projects\testsite\Site">
Options Indexes FollowSymLinks
Order Allow,Deny
Allow from all
</directory>
</VirtualHost>
hosts
# Wamp Server Settings
127.0.0.1 localhost
127.0.0.1 testingsite
httpd.conf
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
If i try to start wamp the icon goes orange.
If i run httpd.exe from command prompt i get the following error:
C:\Program Files (x86)\2. Apps\Wamp\bin\apache\apache2.4.2\bin>httpd.exe
(OS 10048)Only one usage of each socket address (protocol/network address/port)
is normally permitted. : AH00072: make_sock: could not bind to address [::]:80
(OS 10048)Only one usage of each socket address (protocol/network address/port)
is normally permitted. : AH00072: make_sock: could not bind to address 0.0.0.0:
80
AH00451: no listening sockets available, shutting down
AH00015: Unable to open logs
I read that another program might be blocking it or my firewall but i don't know how to fix it, any ideas?
Thanks

Thanks for everyone's input, there were two main problems
I installed wamp into a folder which was nested in a folder who's name had a space in so c:/folder/folder with a space/wamp/ which i have since been told is bad practice, if anyone knows why please tell.
The were issues with the internet protocol, namely ipv6, so solve this you need to ensure wamp only uses ipv4, inside httpd.conf find Listen 80 and change to Listen 0.0.0.0:80. Again i'm not sure what this does so if anyone knows please post below.
I hope this helps anyone else stuck.

Related

WAMP Virtual Host Allow External Device

I am trying to use Ionic’s Devapp to test some functionality on my phone. I think that WAMP is not allowing the requests to make it through my virtual server. I am using WAMP 3.1.3 with Apache 2.4 and I think I have it configured correctly, but requests are still not being received. I am using windows 10 and have tried to take down my firewall and allow access through my firewall, but I still have not achieved the results and looking for I was wondering if anyone had any suggestions for me to listen to the specific port provided by the ionic server and that’s used by Devapp with wamp. Does it make a difference that it's a phone? Thanks for your help.
hostd.conf
Listen 0.0.0.0:80
Listen [::0]:80
Listen 0.0.0.0:8001
Listen [::0]:8001
Httpd-vhosts.conf
<VirtualHost 127.1.2.3:80>
ServerName sam
DocumentRoot "c:/wamp64/www/x/public "
<Directory "c:/wamp64/www/x/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost *:8001>
ServerName example.dev
DocumentRoot "c:/wamp64/www/x/public"
<Directory "c:/wamp64/www/x/public">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
Require ip 192.168
</Directory>
</VirtualHost>
The format of a Require ip does not use the x, x.y part
Just use
Require ip 192.168
and that means any ip starting with 192.168
So if your router is using 192.168.1.* then use
Require ip 192.168.1
to mean any ip on that subnet from 192.168.1.1 to 192.168.1.255
This answer may also help with connecting from your phone

Aid in setting up a Virtual Host with Wamp in Windows Vista

I need some help in setting up this thing.
I followed a tutorial about setting up a virtual host in WAMP which included the following steps:
Opened file httpd.conf in folder C:\wamp\bin\apache\apache2.2.6\conf and uncommented the last # of the following statement:
# Virtual hosts
#Include conf/extra/httpd-vhosts.conf"
to look like this:
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
Opened the file httpd-vhosts.conf in folder C:\wamp\bin\apache\apache2.2.6\conf\extra, deleted everything in there and replaced with these codes below:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName www.jagerseow.servegame.com (WHICH IS A DOMAIN A REGISTERED IN NO-IP)
ServerAlias jagerseow.servegame.com domain
DocumentRoot C:/wamp/www/MP4Public
ErrorLog "C:/wamp/www/MP4Public/logs/error.log"
CustomLog "C:/wamp/www/MP4Public/logs/access.log" common
</VirtualHost>"
<VirtualHost *:80>
ServerName localhost
DocumentRoot C:/wamp/www
ErrorLog "C:/wamp/www/logs/error.log"
CustomLog "C:/wamp/www/logs/access.log" common
</VirtualHost>
Used Notepad to open file hosts in folder C:/Windows/System32/drivers/etc on server computer; then, deleted and replaced the default codes with these codes:
127.0.0.1 localhost
127.0.0.1 domain
Restarted WAMP and waited until it turned green, which it did ...
Try to connect to my server page by typing domain in the browser and my web page showed up normally. However when anyone, including myself, tries to open it by typing the address (http://www.jagerseow.servegame.com), no page is loaded.
I'm running Windows Vista 32-bit. Anyone can tell me what I'm doing wrong?
Change your Virtual Hosts definition to this:-
NameVirtualHost *:80
## must be first so the the wamp menu page loads
## and stray hacks get sent here and ignored because access
## is only allowed from local ips (127.0.0.1 localhost ::1 )
<VirtualHost *:80>
DocumentRoot "C:/wamp/www"
ServerName localhost
ServerAlias localhost
<Directory "C:/wamp/www">
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 localhost ::1
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName www.jagerseow.servegame.com
ServerAlias jagerseow.servegame.com
DocumentRoot "C:/wamp/www/MP4Public"
# changed, dont want your logs available under your docroot directory (security)
ErrorLog "C:/wamp/www/logs/MP4Public_error.log"
CustomLog "C:/wamp/www/logs/MP4Public_access.log" common
<Directory "D:/wamp/www/MP4Public">
Order Allow,Deny
Allow from all
</Directory>
</VirtualHost>"
Now you need to change your hosts file to :-
127.0.0.1 localhost
127.0.0.1 jagerseow.servegame.com
After changing this do the following, or reboot.
Run a command window Run as Administrator and do
net stop "DNS Client"
net start "DNS Client"
This will force a refresh of the DNS Cache and make the new domain name available on your PC.
The hosts file is loaded by windows into its DNS cache. It pre-loads urls and is a bit like a very low function DNS. So this tell the dns cache and therefore your browser etc that jagerseow.servegame.com is found on ip address 127.0.0.1 which is this PC
If you actually did want the universe to be able to see this site, I assume you do as you used Allow from all, you will then have to port forward port 80 on your router to the ip address of the PC running wamp. Also that PC will need a STATIC ip address so it does not change when you reboot. Help for that can be found here PortForward.com

Wamp Permissions windows 8 [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Question
I have tried and read all sort of questions on this topic but can't get this to work. I am trying to use a virtual host to access a different folder than the default /www that wamp uses. But i keep getting an error;
Forbidden
You don't have permission to access / on this server.
I can access local host and phpmyadmin perfectly but not any virtual hosts that i create.
httpd-vhosts.conf
# Virtual Hosts
#
# Required modules: mod_log_config
Listen 80
<VirtualHost *:80>
ServerAdmin admin#localhost.com
DocumentRoot "C:\Program Files (x86)\2. Apps\Wamp\www"
ServerName localhost
<Directory "C:/wamp/www">
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin admin#localhost.com
DocumentRoot "C:\Users\Chris\Documents\CBull Files\Projects\Tests"
ServerName test.lo
ServerAlias test.lo
<directory "C:\Users\Chris\Documents\CBull Files\Projects\Tests">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</directory>
hosts
# Wamp Server Settings
127.0.0.1 localhost
127.0.0.1 test.lo
httpd.conf
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
Thanks
Thanks for everyone's input, there were two main problems
I installed wamp into a folder which was nested in a folder who's name had a space in so c:/folder/folder with a space/wamp/ which i have since been told is bad practice, if anyone knows why please tell.
The were issues with the internet protocol, namely ipv6, so solve this you need to ensure wamp only uses ipv4, inside httpd.conf find Listen 80 and change to Listen 0.0.0.0:80. Again i'm not sure what this does so if anyone knows please post below.
I hope this helps anyone else stuck.
Try replacing the following block with:
<VirtualHost test.lo:80>
ServerAdmin admin#localhost.com
DocumentRoot "C:\Users\Chris\Documents\CBull Files\Projects\Tests"
ServerName test.lo
ServerAlias test.lo
<directory "C:\Users\Chris\Documents\CBull Files\Projects\Tests">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</directory>
</VirtualHost>
I have made just one change: <VirtualHost *:80> replaced with <VirtualHost test.lo:80>.
Note: You had </VirtualHost> missing in the end.

Trying to set up custom url (mysite.dev) using WAMP

Evening everyone,
Firstly, I apologize if this is the best location to ask this question so feel free to redirect me or this post :)
I have WAMP installed on C: but any projects will exist on a separate drive. I can create an alias to point to the correct directory just fine - no problem there. The problem lies in the fact that I want/need to have a custom URL assigned to each project (so instead of localhost/mysite it would be something similar to mysite.dev).
I found this article, but it's a bit old so I'm not sure if the information is still accurate. Here's what I have so far:
Edited hosts file to add domain - 127.0.0.1 mysite.dev
Edited WAMP's httpd.conf file to uncomment - Include conf/extra/httpd-vhosts.conf
Edited WAMP's httpd-vhost.conf file to add virtual host:
<VirtualHost 127.0.0.1>
DocumentRoot "d:/projects/mysite/"
ServerName mysite.dev
ServerAlias mysite.dev
<VirtualHost>
In the end this produces no errors, just a big fat 403 Forbidden Access "You don't have permission to access / on this server."
No idea where to go from here, this isn't exactly my area of expertise :P any and all help/tips are greatly appreciated! Thanks!
Try setting a port to listen for
<VirtualHost *:80>
DocumentRoot d:/projects/mysite/
ServerName mysite.dev
</VirtualHost>
After another hour or two I can actually answer my own question.
Someone on another forum mentioned that you need to keep a mention of plain ol' localhost in the httpd-vhost.conf file, so here's what I ended up with in there:
<VirtualHost *:80>
ServerName localhost
DocumentRoot "c:/wamp/www/"
</VirtualHost>
<VirtualHost *:80>
ServerName platypus.dev
DocumentRoot "d:/projects/test/"
<Directory "d:/projects/test/">
Options Indexes FollowSymLinks Includes
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Exit WAMP, restart - good to go. Hope this helps someone else :)
Depending on which WAMP stack you're using, different, but very silimar configs in every stack. WAMP = (apache, mysql, php FOR Windows ... Win Ap My Php). There are different WAMP stacks, AMPPS, XAMPP, Bitnami.. You probably meaned WAMPserver (most people call it simply WAMP, but can mean also others, which has slightly different configs..)
If you're using WAMPserver, I think it's the easiest to config a "custom URL", that means virtual host. You just need to uncomment the vhosts config file in httpd.conf in apache's folder, and you already have a template of how to set virtual host in this file, there are 2 dummy hosts as examples. But, don't forget the Windows' "hosts" file, you need to set 127.0.0.1 [url_you_want] in your hosts file, and that [url_you_want] is the same in your apache vhosts config file as "ServerName"...

Virtual Host with WAMP

I'm using Wamp 2.2, edited conf/extra/httpd-vhosts.conf edited this file to add VirtualHosts , but when I un-commented line in httpd.conf to include httpd-vhosts.conf file, after restarting Wamp doesn't starts. If I revert changes is works fine.
Any ideas why is this happening?
This is code I'm using in httpd-vhost.conf:
<VirtualHost *>
ServerAdmin admin#localhost.com
DocumentRoot "C:/wamp/www" # change this line with your htdocs folder
ServerName localhost
ServerAlias localhost
<Directory "C:/wamp/www">
Options Indexes FollowSymLinks Includes ExecCGI
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
# WooCommerce Multisite
<VirtualHost dev.lo>
ServerAdmin admin#localhost.com
DocumentRoot "C:/wamp/www/dev"
ServerName dev.lo
ServerAlias dev.lo
<Directory "C:/wamp/www/dev">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Thanks
George
Edit
As Andreas Hagen suggested, I run Apache via httpd.exe.
First error was wrong parameter for DocumentRoot, as appears comment like was taken as second parameter, when DocumentRoot accepts only one.
Then I got warning: [warn] NameVirtualHost *:80 has no VirtualHosts. Did a quick search and found very helpful question - https://serverfault.com/questions/1405/apache-2-startup-warning-namevirtualhost-80-has-no-virtualhosts
Probably some bad config in vhosts file. Try to start apache from commandline so you get the error output. That will help you identify your problem.
Open your hosts file (\WINDOWS\system32\drivers\etc\hosts).
Add this line to the bottom:
127.0.0.1 test
This will tell your computer that any url that contains test will be routed to 127.0.0.1 (localhost).
Now open httpd.conf and add this to the very bottom of the file:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "c:/wamp/www/myfirstsite/"
ServerName testsite
</VirtualHost>
Now restart apache and navigate to: http://test/ (you may have to restart your browser for the changes to take effect.)
Hope this works.
Go to C:/drive and choose wamp folder
and go to C:\wamp\bin\apache\Apache2.4.4\conf and choose httpd.conf file.
Edit with notepad and go to 58 line number
change Listen 80 and replace Listen 8181 Save file and restart your Apache server
Now check url such like this localhost:8181
I have used this hop you will be success.