Mac OS X Lion Apache Server not Found





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







3















After upgrading to Lion 10.7.2 today, Apache virtual hosts are not working anymore. When I go to http://XYZ.localhost, it say "server not found".



I am using Apache on my Mac OS X Lion and until today, it was working fine. I can access http://localhost but I can't access http://XYZ.localhost



My /etc/hosts file is like below;



127.0.0.1   XYZ.localhost


My /etc/apache2/extra/httpd-vhosts.conf file is like below;



<VirtualHost *:80>
ServerName XYZ.localhost
DocumentRoot /Library/WebServer/Documents/XYZ
<Directory /Library/WebServer/Documents/XYZ>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>


I think I once had this problem too, after another OS X update, but I can't remember how I solved it.



Is it a user permission issue? Or is there something wrong with Apache or any other setting?



EDIT: It seems like my /etc/hosts file is not working correctly. Even if I add something like 127.0.0.1 apple.com it still goes to the real apple.com. Maybe this might help to solve the problem.










share|improve this question















migrated from serverfault.com Oct 13 '11 at 8:10


This question came from our site for system and network administrators.



















  • Just a quick suggestion, try putting in Options FollowSymLinks within the <Directory> section.

    – l'L'l
    Oct 13 '11 at 1:44











  • Thanks ioi, I added Options FollowSymLinks but still no change. It was working before the Lion 10.7.2 update. There might be something wrong with permissions or hosts or something. This is so nonsense.

    – Burak Erdem
    Oct 13 '11 at 1:52











  • justincarmony.com/blog/2011/07/27/…

    – quanta
    Oct 13 '11 at 2:12











  • No problem. I've put an answer that might help, although as you've said your /etc/hosts is not working -- so maybe that's it.

    – l'L'l
    Oct 13 '11 at 2:12











  • @quanta You are great, thank you so much. That solved my problem. Apple did change something with DNS and broke everything. If you answer my question, I would love to accept that as the correct answer. Thanks.

    – Burak Erdem
    Oct 13 '11 at 2:24


















3















After upgrading to Lion 10.7.2 today, Apache virtual hosts are not working anymore. When I go to http://XYZ.localhost, it say "server not found".



I am using Apache on my Mac OS X Lion and until today, it was working fine. I can access http://localhost but I can't access http://XYZ.localhost



My /etc/hosts file is like below;



127.0.0.1   XYZ.localhost


My /etc/apache2/extra/httpd-vhosts.conf file is like below;



<VirtualHost *:80>
ServerName XYZ.localhost
DocumentRoot /Library/WebServer/Documents/XYZ
<Directory /Library/WebServer/Documents/XYZ>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>


I think I once had this problem too, after another OS X update, but I can't remember how I solved it.



Is it a user permission issue? Or is there something wrong with Apache or any other setting?



EDIT: It seems like my /etc/hosts file is not working correctly. Even if I add something like 127.0.0.1 apple.com it still goes to the real apple.com. Maybe this might help to solve the problem.










share|improve this question















migrated from serverfault.com Oct 13 '11 at 8:10


This question came from our site for system and network administrators.



















  • Just a quick suggestion, try putting in Options FollowSymLinks within the <Directory> section.

    – l'L'l
    Oct 13 '11 at 1:44











  • Thanks ioi, I added Options FollowSymLinks but still no change. It was working before the Lion 10.7.2 update. There might be something wrong with permissions or hosts or something. This is so nonsense.

    – Burak Erdem
    Oct 13 '11 at 1:52











  • justincarmony.com/blog/2011/07/27/…

    – quanta
    Oct 13 '11 at 2:12











  • No problem. I've put an answer that might help, although as you've said your /etc/hosts is not working -- so maybe that's it.

    – l'L'l
    Oct 13 '11 at 2:12











  • @quanta You are great, thank you so much. That solved my problem. Apple did change something with DNS and broke everything. If you answer my question, I would love to accept that as the correct answer. Thanks.

    – Burak Erdem
    Oct 13 '11 at 2:24














3












3








3


1






After upgrading to Lion 10.7.2 today, Apache virtual hosts are not working anymore. When I go to http://XYZ.localhost, it say "server not found".



I am using Apache on my Mac OS X Lion and until today, it was working fine. I can access http://localhost but I can't access http://XYZ.localhost



My /etc/hosts file is like below;



127.0.0.1   XYZ.localhost


My /etc/apache2/extra/httpd-vhosts.conf file is like below;



<VirtualHost *:80>
ServerName XYZ.localhost
DocumentRoot /Library/WebServer/Documents/XYZ
<Directory /Library/WebServer/Documents/XYZ>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>


I think I once had this problem too, after another OS X update, but I can't remember how I solved it.



Is it a user permission issue? Or is there something wrong with Apache or any other setting?



EDIT: It seems like my /etc/hosts file is not working correctly. Even if I add something like 127.0.0.1 apple.com it still goes to the real apple.com. Maybe this might help to solve the problem.










share|improve this question
















After upgrading to Lion 10.7.2 today, Apache virtual hosts are not working anymore. When I go to http://XYZ.localhost, it say "server not found".



I am using Apache on my Mac OS X Lion and until today, it was working fine. I can access http://localhost but I can't access http://XYZ.localhost



My /etc/hosts file is like below;



127.0.0.1   XYZ.localhost


My /etc/apache2/extra/httpd-vhosts.conf file is like below;



<VirtualHost *:80>
ServerName XYZ.localhost
DocumentRoot /Library/WebServer/Documents/XYZ
<Directory /Library/WebServer/Documents/XYZ>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>


I think I once had this problem too, after another OS X update, but I can't remember how I solved it.



Is it a user permission issue? Or is there something wrong with Apache or any other setting?



EDIT: It seems like my /etc/hosts file is not working correctly. Even if I add something like 127.0.0.1 apple.com it still goes to the real apple.com. Maybe this might help to solve the problem.







apache-http-server macos






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Oct 16 '11 at 1:32









studiohack

11.3k1880114




11.3k1880114










asked Oct 13 '11 at 1:12









Burak ErdemBurak Erdem

12016




12016




migrated from serverfault.com Oct 13 '11 at 8:10


This question came from our site for system and network administrators.









migrated from serverfault.com Oct 13 '11 at 8:10


This question came from our site for system and network administrators.















  • Just a quick suggestion, try putting in Options FollowSymLinks within the <Directory> section.

    – l'L'l
    Oct 13 '11 at 1:44











  • Thanks ioi, I added Options FollowSymLinks but still no change. It was working before the Lion 10.7.2 update. There might be something wrong with permissions or hosts or something. This is so nonsense.

    – Burak Erdem
    Oct 13 '11 at 1:52











  • justincarmony.com/blog/2011/07/27/…

    – quanta
    Oct 13 '11 at 2:12











  • No problem. I've put an answer that might help, although as you've said your /etc/hosts is not working -- so maybe that's it.

    – l'L'l
    Oct 13 '11 at 2:12











  • @quanta You are great, thank you so much. That solved my problem. Apple did change something with DNS and broke everything. If you answer my question, I would love to accept that as the correct answer. Thanks.

    – Burak Erdem
    Oct 13 '11 at 2:24



















  • Just a quick suggestion, try putting in Options FollowSymLinks within the <Directory> section.

    – l'L'l
    Oct 13 '11 at 1:44











  • Thanks ioi, I added Options FollowSymLinks but still no change. It was working before the Lion 10.7.2 update. There might be something wrong with permissions or hosts or something. This is so nonsense.

    – Burak Erdem
    Oct 13 '11 at 1:52











  • justincarmony.com/blog/2011/07/27/…

    – quanta
    Oct 13 '11 at 2:12











  • No problem. I've put an answer that might help, although as you've said your /etc/hosts is not working -- so maybe that's it.

    – l'L'l
    Oct 13 '11 at 2:12











  • @quanta You are great, thank you so much. That solved my problem. Apple did change something with DNS and broke everything. If you answer my question, I would love to accept that as the correct answer. Thanks.

    – Burak Erdem
    Oct 13 '11 at 2:24

















Just a quick suggestion, try putting in Options FollowSymLinks within the <Directory> section.

– l'L'l
Oct 13 '11 at 1:44





Just a quick suggestion, try putting in Options FollowSymLinks within the <Directory> section.

– l'L'l
Oct 13 '11 at 1:44













Thanks ioi, I added Options FollowSymLinks but still no change. It was working before the Lion 10.7.2 update. There might be something wrong with permissions or hosts or something. This is so nonsense.

– Burak Erdem
Oct 13 '11 at 1:52





Thanks ioi, I added Options FollowSymLinks but still no change. It was working before the Lion 10.7.2 update. There might be something wrong with permissions or hosts or something. This is so nonsense.

– Burak Erdem
Oct 13 '11 at 1:52













justincarmony.com/blog/2011/07/27/…

– quanta
Oct 13 '11 at 2:12





justincarmony.com/blog/2011/07/27/…

– quanta
Oct 13 '11 at 2:12













No problem. I've put an answer that might help, although as you've said your /etc/hosts is not working -- so maybe that's it.

– l'L'l
Oct 13 '11 at 2:12





No problem. I've put an answer that might help, although as you've said your /etc/hosts is not working -- so maybe that's it.

– l'L'l
Oct 13 '11 at 2:12













@quanta You are great, thank you so much. That solved my problem. Apple did change something with DNS and broke everything. If you answer my question, I would love to accept that as the correct answer. Thanks.

– Burak Erdem
Oct 13 '11 at 2:24





@quanta You are great, thank you so much. That solved my problem. Apple did change something with DNS and broke everything. If you answer my question, I would love to accept that as the correct answer. Thanks.

– Burak Erdem
Oct 13 '11 at 2:24










1 Answer
1






active

oldest

votes


















0














You need this in your conf:



NameVirtualHost *:80


So it should look like:



NameVirtualHost *:80

<VirtualHost *:80>
ServerName XYZ.local
DocumentRoot /Library/WebServer/Documents/XYZ
<Directory /Library/WebServer/Documents/XYZ>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>


You may also need to edit your main httpd.conf to include the httpd-vhosts.conf






share|improve this answer
























  • I have it in /etc/apache2/extra/httpd-vhosts.conf already. I just updated the question about hosts file. Maybe that might help.

    – Burak Erdem
    Oct 13 '11 at 2:08











  • The hosts file seems like the culprit.

    – l'L'l
    Oct 13 '11 at 2:15


















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














You need this in your conf:



NameVirtualHost *:80


So it should look like:



NameVirtualHost *:80

<VirtualHost *:80>
ServerName XYZ.local
DocumentRoot /Library/WebServer/Documents/XYZ
<Directory /Library/WebServer/Documents/XYZ>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>


You may also need to edit your main httpd.conf to include the httpd-vhosts.conf






share|improve this answer
























  • I have it in /etc/apache2/extra/httpd-vhosts.conf already. I just updated the question about hosts file. Maybe that might help.

    – Burak Erdem
    Oct 13 '11 at 2:08











  • The hosts file seems like the culprit.

    – l'L'l
    Oct 13 '11 at 2:15
















0














You need this in your conf:



NameVirtualHost *:80


So it should look like:



NameVirtualHost *:80

<VirtualHost *:80>
ServerName XYZ.local
DocumentRoot /Library/WebServer/Documents/XYZ
<Directory /Library/WebServer/Documents/XYZ>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>


You may also need to edit your main httpd.conf to include the httpd-vhosts.conf






share|improve this answer
























  • I have it in /etc/apache2/extra/httpd-vhosts.conf already. I just updated the question about hosts file. Maybe that might help.

    – Burak Erdem
    Oct 13 '11 at 2:08











  • The hosts file seems like the culprit.

    – l'L'l
    Oct 13 '11 at 2:15














0












0








0







You need this in your conf:



NameVirtualHost *:80


So it should look like:



NameVirtualHost *:80

<VirtualHost *:80>
ServerName XYZ.local
DocumentRoot /Library/WebServer/Documents/XYZ
<Directory /Library/WebServer/Documents/XYZ>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>


You may also need to edit your main httpd.conf to include the httpd-vhosts.conf






share|improve this answer













You need this in your conf:



NameVirtualHost *:80


So it should look like:



NameVirtualHost *:80

<VirtualHost *:80>
ServerName XYZ.local
DocumentRoot /Library/WebServer/Documents/XYZ
<Directory /Library/WebServer/Documents/XYZ>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>


You may also need to edit your main httpd.conf to include the httpd-vhosts.conf







share|improve this answer












share|improve this answer



share|improve this answer










answered Oct 13 '11 at 2:04









l'L'll'L'l

1,5461107




1,5461107













  • I have it in /etc/apache2/extra/httpd-vhosts.conf already. I just updated the question about hosts file. Maybe that might help.

    – Burak Erdem
    Oct 13 '11 at 2:08











  • The hosts file seems like the culprit.

    – l'L'l
    Oct 13 '11 at 2:15



















  • I have it in /etc/apache2/extra/httpd-vhosts.conf already. I just updated the question about hosts file. Maybe that might help.

    – Burak Erdem
    Oct 13 '11 at 2:08











  • The hosts file seems like the culprit.

    – l'L'l
    Oct 13 '11 at 2:15

















I have it in /etc/apache2/extra/httpd-vhosts.conf already. I just updated the question about hosts file. Maybe that might help.

– Burak Erdem
Oct 13 '11 at 2:08





I have it in /etc/apache2/extra/httpd-vhosts.conf already. I just updated the question about hosts file. Maybe that might help.

– Burak Erdem
Oct 13 '11 at 2:08













The hosts file seems like the culprit.

– l'L'l
Oct 13 '11 at 2:15





The hosts file seems like the culprit.

– l'L'l
Oct 13 '11 at 2:15



Popular posts from this blog

Plaza Victoria

Puebla de Zaragoza

Musa