vhost issues and a few other questions for newbie
Posted by: mihomes (---.dsl.bumttx.sbcglobal.net)
Date: June 30, 2013 03:17AM

I am a previous xampp user and using mamp for the first time. I ONLY want localhost access at all times with the installation with no possibility of outside access. From what I have read as long as I don't put wamp online I am good to go. With that said, I am having trouble with apache starting when using virtual hosts. Here is what I have done :

httpd.conf changes :

#Listen 12.34.56.78:80
#Listen 80
Listen 127.0.0.1:80

# onlineoffline tag - don't remove
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
Allow from localhost
</Directory>

#secures my websites folder
<Directory "C:/Users/Support/Documents/My Web Sites">
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>

# Virtual hosts allow access
Include conf/extra/httpd-vhosts.conf


my httpd-vhosts :

NameVirtualHost *:80

## must be first so the the wamp menu page loads when you use just localhost as the domain name
<VirtualHost *:80>
DocumentRoot "C:/wamp/www"
SererName localhost
ServerAlias localhost
<Directory "C:/wamp/www">
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
# You would never want a remote user to see this wamp config page.
</Directory>
</VirtualHost>


<VirtualHost *:80>
DocumentRoot "C:/Users/Support/Documents/My Web Sites/HTML5/test.com"
ServerName test.dev
ServerAlias www.test.dev
Options Indexes FollowSymLinks
<Directory "C:/Users/Support/Documents/My Web Sites/HTML5/test.com">
AllowOverride All
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
#If you want to allow access from your internal network
# For specific ip addresses add one line per ip address
#Allow from 192.168.0.100
# For every ip in the subnet, just use the first 3 numbers of the subnet
#Allow from 192.168.0
# If you want to allow access to everyone
#Allow from all
</Directory>
</VirtualHost>


Of course I also changed my Windows hosts file :

127.0.0.1 localhost
127.0.0.1 test.dev


With this configuration I always get a yellow icon when restarting services and nothing works. If I remove the virtual hosts include from the httpd.conf then I can access the localhost as normal. What am I doing wrong here?

Other questions :

What is the phpmyadmin user/pass? I read to leave it blank and just hit okay, but that does nothing and just reloads the page. What is it?

As I mentioned, I ONLY want access to this through my own computer (one of the reason I am leaving xampp because this seems a little more secure in different ways. Other than the above is there anything else I need to do to secure this installation?

I have already searched the forums and my above configuration comes from a guide on here so please do not point me to that as I have followed it.

Thanks... really appreciate any help and need to get this working!

Options: ReplyQuote
Re: vhost issues and a few other questions for newbie
Posted by: stevenmartin99 (Moderator)
Date: June 30, 2013 09:15AM

ive only woken up so im probably not seeing it, but the file looks ok


anyway to test it. you can use httpd.exe to check for errors


In cmd navigate to C:\wamp\bin\apache\apache2.X.X
and 1 of these will get you sorted

httpd.exe -S
httpd.exe -t
httpd.exe -T




the username is "root" and the password is not set.

if port 80 is open in your router and wamp is running people will get a FORBIDDEN 403 PAGE when they try. if you want no connection, block port 80 in router. and of course make sure 3306 is not open also.

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]



Edited 1 time(s). Last edit at 06/30/2013 09:16AM by stevenmartin99.

Options: ReplyQuote
Re: vhost issues and a few other questions for newbie
Posted by: mihomes (---.lightspeed.dblnoh.sbcglobal.net)
Date: June 30, 2013 09:55AM

Haha... I has 'server' spelled wrong and didn't even notice it... forgot the 'v'... working fine now.

As far as the ports go... what you are saying is even though I am not 'online' they can still connect just will receive an error page?

I would have no problem blocking the ports, but isn't port 80 the default port used for http?

Anyways, thanks for the top with the httpd and helping me figure that out. I doubt I would have even noticed the problem.

Options: ReplyQuote
Re: vhost issues and a few other questions for newbie
Posted by: mihomes (---.lightspeed.dblnoh.sbcglobal.net)
Date: June 30, 2013 10:36AM

I take that back... it is not working right. I disabled the two incoming firewall rules in Windows 7 (both were for httpd from wamp... udp and tcp).

I can access my test.dev site fine, however, I cannot access localhost or phpadmin through the tray icon. I just get a 'waiting for' and it never connects.

Not sure whats going on, but it was working and now it isn't. So far the entire program seems unstable as sometimes it works and others it never loads. Any ideas?

As for port 3306 I never had to create a firewall rule for this when I installed. What exactly is this port used for in wamp and is it necessary to add a block rule?

Options: ReplyQuote
Re: vhost issues and a few other questions for newbie
Posted by: mihomes (---.dsl.bumttx.sbcglobal.net)
Date: June 30, 2013 12:20PM

Well, it appears that the port 80 firewall rules need to be allowed in Windows 7. Also, it appears that I can only have one browser session open at a time for it to work. If I am at test.dev then I cannot go to localhost or phpmyadmin while it is open. Only one instance open at a time.

Is this a setting or just the way it is? Don't understand why there are soo many problems with this when I only want to use it locally on one specific pc for security reasons.

Options: ReplyQuote
Re: vhost issues and a few other questions for newbie
Posted by: stevenmartin99 (Moderator)
Date: June 30, 2013 01:40PM

i never mentioned the firewall..

i said in the router...


in windows firewall you will need it open for sure - privately is enough for local use , public if you want it across your local network.

but yes as long as wamp is offline apache will forbid access to pages on localhost ( it will allow access to badly setup vhosts but yours are set up ok)


3306 is used for mysql.


routers can handle web traffic with port 80 blocked for application use so you dont need to worry about http not working

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: vhost issues and a few other questions for newbie
Posted by: mihomes (---.dsl.bumttx.sbcglobal.net)
Date: July 01, 2013 12:00AM

Thanks Steve... that makes complete sense... I've been kind of a zombie lately with restoring this laptop.

Any idea about the connection problems I am having? Why can I only have one instance or tab open at one time?

Options: ReplyQuote
Re: vhost issues and a few other questions for newbie
Posted by: stevenmartin99 (Moderator)
Date: July 01, 2013 12:17AM

Are u using ie? It has a limit if 2 concurrent URL connections

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: vhost issues and a few other questions for newbie
Posted by: mihomes (---.dsl.bumttx.sbcglobal.net)
Date: July 01, 2013 10:13AM

This was happening for all browsers - even then if two is the limit for ie I should still be able to have one tab with test.dev and another with localhost or phpmyadmin which I can't. Never had this issue with xampp so I'm leaning towards another reason.

Options: ReplyQuote
Re: vhost issues and a few other questions for newbie
Posted by: mihomes (---.dsl.bumttx.sbcglobal.net)
Date: July 08, 2013 05:08AM

I just wanted to update this thread with the solution. Just add these lines anywhere in your httpd.conf and it will fix all issues with IE (and other browsers when IE is opened) :

# Fix IE crashing Apache
AcceptFilter http none
AcceptFilter https none

Options: ReplyQuote


Sorry, only registered users may post in this forum.