Only One Virtual Host Works, 2nd and/or 3rd Don't Work?
Can someone explain to me why VHostX is so fickle? I can only get one virtual host to point to the right folder. Any additional virtual hosts point to the wrong folder, none at all or I get a server can not be found. If I get one working, and I want to change the folder it points to, it never changes, or goes to server not found.
I have tried restarting MAMP (servers), restarting VirtualHostX, turning on and off the system prefs web sharing, even restarted the whole darn computer, and I get nothing. BUT, I can always get ONE virtual host to work, two or three never work (ie. point to the same folder as the first, even though I did not select that folder or folder not found or server not found). PLEASE, help me understand how all this works!! Oh, and does the order of virtual hosts in the side bar matter?
(It also seems to hate folder with stuff in them.)
OS X 10.5.5
MAMP 1.7.1
VHostX 1.1.1
Ports 80 & 3306
Justin [Cerebrl]
I have tried restarting MAMP (servers), restarting VirtualHostX, turning on and off the system prefs web sharing, even restarted the whole darn computer, and I get nothing. BUT, I can always get ONE virtual host to work, two or three never work (ie. point to the same folder as the first, even though I did not select that folder or folder not found or server not found). PLEASE, help me understand how all this works!! Oh, and does the order of virtual hosts in the side bar matter?
(It also seems to hate folder with stuff in them.)
OS X 10.5.5
MAMP 1.7.1
VHostX 1.1.1
Ports 80 & 3306
Justin [Cerebrl]
2
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?It sounds like the MAMP httpd.conf file wasn't setup to connect to VirtualHostX. Double-check that the file /Applications/MAMP/conf/apache/httpd.conf ends with the following line:
Include /private/etc/apache2/extra/httpd-vhosts.conf -
I looked at the above mentioned file (/Applications/MAMP/conf/apache/httpd.conf) and here is the last line:
Include /private/etc/apache2/extra/httpd-vhosts.conf
I have been able to get it to work in the past, but for some reason this time around (maybe the upgrade to 10.5.5 is causing it) I can't seem to get it to work. Like I said, I can get one virtual host to work, the first one. Unfortunately, the second or third just won't work right. And when I get one to work, the other then screws up, so I am just really confused.
Thanks for the speedy reply and the assistance. Hope to hear from you soon. -
After playing around with it a little bit, I noticed something really interesting. I use ports 80 & 3306 in MAMP, and when I turn on "Web Sharing" in System Prefs, the two virtual hosts point to the correct folders (although the PHP never gets translated and I get a directory instead of the index page). When I turn the "Web Sharing" off, I refresh both virtual hosts. Upon refresh, the first "correct" virtual host points to the right folder, but the second one redirects to the first one. I type in old-ci.site, and it then redirects to joomla-ci.site. Turn on "Web Sharing" goes back to pointing to the right folder, turn it off, I get redirecting. This is freaking weird! -
Okay, I have got to say that I don't think VirtualHostX is the culprit. It has got to be my OS or MAMP. Even when I remove all virtual hosts and refresh everything, the first virtual host remains to work (even though I deleted it). I then quit VHostX and try using just localhost:80 and it points to the wrong folder. So, I will have to apologize for blaming your app for the problems, when it was MAMP or my OS that caused it. Thanks for trying to help. Man, this whole PHP, MySQL Mac OSX is a mess. OR, do you think it could be Joomla that is messing it all up? It did start when I added a virtual host that contained Joomla. I will do some testing and get back with you. -
Inappropriate?Here's what's happening with some of what you described...
When you turn on OS X's built-in web sharing, the pre-installed Apache takes over port 80 from MAMP. The PHP isn't executing because you need to enable PHP in Leopard. (Here are instructions for doing that: http://clickontyler.com/blog/2007/10/...)
When built-in web sharing is turned off, MAMP is the only thing running. For some reason, MAMP isn't recognizing the virtual hosts setup with VirtualHostX. So, when you try to go to one of them, it sends you to the first vhost each time instead.
Myself, I don't mess with MAMP. I just turn on Leopard's web sharing and enable PHP. Works great.
1 person says
this answers the question
-
Makes sense. I think it's definitely MAMP screwing this all up. For me to get it to work, I have to go into MAMP's preferences and reselect the root folder. Somehow, the root folder gets mucked up during the application of virtual hosts. I strongly believe it (MAMP) selects the first virtual host as the root folder, therefor redirecting the browser to that folder. Every time I change something, I have to reselect the root folder in MAMP and restart the servers. I am not totally positive on this, but that is how I have worked it out in my head.
As far as using Leopard's PHP, won't I still need MAMP for the MySQL as to work on Joomla and Wordpress? In other words, does Leopard have built in MySQL?
UPDATE: That is exactly what it is. For anyone out there with the same problem as me, try this: Anytime you update the virtual hosts in VirtualHostX, you need to reselect the document root folder under the Apache tab in MAMP's preferences. Once it restarts it should get you straightened out. Good luck, and thank you to Tyler for being such a great sport. VHostX is a solid app with a solid developer. Thank you.
Justin -
Inappropriate?Just wanted to change my "mood" because the problem as been solved.
I’m confident and happy
-
Inappropriate?OS X doesn't come with MySQL pre-installed. Luckily, though, it's just a download and double-click away. Here's a link to the latest download:
http://is.gd/4BMD
Loading Profile...



EMPLOYEE