All virtual hosts point to the root of the webserver
I just reinstalled leopard and set virtualhostx back up but now all virtual hosts point to the root. I am using the built in web server provided by apple. Am I missing something? The first time I set it up it seemed quite easy.
6
people have this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
The company marked this question as answered.
-
Inappropriate?I too was getting the root folder no matter what, so I found an older MAMP Version 1.7.1 and installed over the newest one Version 1.7.2. Once I did that I reworked all the installations and no more root folder business. There must be something with Version 1.7.2 update that conflicts with VirtualHostX. Good luck!
[Cerebrl]
I’m excited
-
Inappropriate?Since you're getting the default host (and not an error saying "server not found") it sounds like your /etc/hosts file is setup correctly, but Apache doesn't know about the new virtual hosts you created. Try restarting the web server in System Preferences --> Sharing --> and then checking/unchecking the "Web Sharing" option. That should force Apache to reload your new settings.
VirtualHostX should automatically do this for you when you save your changes, but I've had reports where it's unable to restart the web server. I'm still looking into what causes this. -
Inappropriate?That did not seem to work for me.
-
Inappropriate?I ran into this issue as well. If you open up httpd.conf and go to this line (460) and uncomment it so it looks like below, make the change and restart apache. (can use terminal with : sudo apachectl restart)
# Virtual hosts
Include /private/etc/apache2/extra/httpd-vhosts.conf
This will tell apache to run that file and include it so that the vhosts can be found.
2 people say
this answers the question
-
Inappropriate?I tried the solution posted by jamwerx and I'm getting a Page Not Found error.
Tyler, I also tried rebooting without uncommenting that line and I still get the default Apache page. Thoughts? -
Inappropriate?If you like, email me directly and we can take a closer look at what's going on and then report back here once we find out the problem.
-
Inappropriate?hey tyler, did you ever solve this issue for msteinruck?
-
Inappropriate?I looked through my email records and, yes, Mark's (msteinruck's) problem was solved. I believe the issue was because his system was an upgraded Leopard installation rather than a clean install.
What problems are you running into? Reply here or feel free to email me at support@clickontyler.com. -
Inappropriate?How do you get Parallels to see the virtual hosts-- I remember reading something about installing Bonjour for Windows and getting it to work.
Thoughts? Ideas (without having to manually add hosts in Windows)?
-
Inappropriate?I don't believe Bonjour will help with virtual hosts. I always have to edit the file manually.
1) Inside Windows, use a text editor to open c:\Windows\System32\drivers\etc\hosts
2) For each site, add a line to the file that has your Mac's IP address and the host name of the site. For example
192.0.0.2 mywebsite.dev
192.0.0.2 client.site
Each line has the IP then a tab then the host name
3) Save the file. -
Inappropriate?Hmm.
I swear I had this working before (type in subdomain in Parallels/IE and the same behavior on the Mac side). Without messing with hosts. I swear!
I'll figure it out again, and try to remember to repost.
Darn.
-
Inappropriate?I would suggest checking your /etc/apache2/extra/httpd-vhosts.conf file and make sure it starts with:
NameVirtualHost *:80
That fixed the problem for me.
I’m trying to be helpful
-
Inappropriate?Daryl, fixed what problem?
-
Inappropriate?I was having the same issue with all hosts pointing to the root of the first listed virtual host.
Apparently, I misread the problem the original poster submitted.
I’m feeling kinda stupid
-
Inappropriate?No, you didn't misread; I just went off-topic, and there was a solution already posted.
-
Inappropriate?Yes.. as Daryl mentioned httpd-vhosts.conf has to start with #
NameVirtualHost *:80
or you will have issues with apache reporting overlapping vhosts.
Tyler, the problem I see is that it appears that virualhostx wipes out the httpd-vhosts file everytime it updates eliminiating the NameVirtualHost *:80 declaration.
I may see if I can add it in httpd.conf for now, but it would be cool if virtualhostx would leave that in there. Kind of how it handles the hosts file by leaving what is there and creating a section for virtualhostx..
Thanks!
Shrop
-
Inappropriate?The best solution I've found is to move the NameVirtualHost *:80 statement to the bottom the the httpd.conf file so that as you add new virtual hosts the statement doesn't get removed. If you leave NameVirtualHost statement in the httpd-vhosts.conf file and add a new vhost, the entire file is rewritten and the statement is removed.
I’m confident
-
Inappropriate?I just purchased and installed VHX and I was having the same problem. I found the issue with "http-vhosts.conf" file having the initial "NameVirtualHost *:80" declaration removed when re-writing the file with new virtual hosting references (wish I had looked here first).
Anyway, I purchased this product to avoid manually editing these files - any idea as to when we can expect a fix for this issue. I agree with Shrop's suggestion of creating a #VHX Start and Stop section just like in the hosts file (if that's possible - I'm not sure know how php parses that file).
Take Care. -
Inappropriate?I'm having the same problem like others: all virtual host goes to the root of the web server (built-in Apache).
If I uncomment line #465 in httpd.config:
Include /private/etc/apache2/extra/httpd-vhosts.conf
all virtual host goes to the first one set up in VirtualHost X.
If I also add "NameVirtualHost *:80" at the bottom of httpd-vhost.conf it is working.
But as soon as I add another one the problem is back. Is there a way to solve this?
Regards, Magnus
I’m concerned
-
Inappropriate?I had the same problem with only the first entry loading what i did is edit the httpd.conf instead of the vhosts file to add the namevirtualhosts line. which would look like this:
# Virtual hosts
NameVirtualHost *:80
Include /private/etc/apache2/extra/httpd-vhosts.conf
that works like a charm for me...
I’m confident
Loading Profile...




EMPLOYEE



