logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Several vhosts point to only one of their index.php files
Author
prest



Joined: 09 Feb 2008
Posts: 3
Location: Santa Clara, CA

PostPosted: Sun 10 Feb '08 0:35    Post subject: Several vhosts point to only one of their index.php files Reply with quote

Problem:

When I enter http://site1.local or site2.local or site2.local I get only the index.php for site1. The error logs are empty. index.html doesn't work either.

When starting Apache 2 I get this message:

<OS 10048> Only one usage of each socket address is normally permitted. : Make_sock: could not bind to address 0.0.0.0:80

Apache 2 installed on Dell Vista computer with PHP5 and IIS uninstalled. This is my app dev computer.

Several vhosts in httpd-vhosts.conf:

NameVirtualHost 127.0.0.1 - I've tried *.80 also with no luck.

<VirtualHost 127.0.0.1>
ServerName localhost
DocumentRoot C:/apache/htdocs
CustomLog logs/localhost.access.log combined
ErrorLog logs/localhost.error.log
</VirtualHost>

<VirtualHost 127.0.0.1>
ServerName site1.local
DocumentRoot "C:/Websites/site1.local"
CustomLog logs/site1.local.access.log combined
ErrorLog logs/site1.local.error.log
ScriptAlias /cgi-bin/ "C:/Websites/site1.local/cgi-bin/"
</VirtualHost>

<VirtualHost 127.0.0.1>
ServerName site2.local
DocumentRoot "C:/Websites/site2.local"
CustomLog logs/site2.local.access.log combined
ErrorLog logs/site2.local.error.log
ScriptAlias /cgi-bin/ "C:/Websites/site2.local/cgi-bin/"
</VirtualHost>

<VirtualHost 127.0.0.1>
ServerName site3.local
DocumentRoot "C:/Websites/site3.local"
CustomLog logs/site3.local.access.log combined
ErrorLog logs/site3.local.error.log
ScriptAlias /cgi-bin/ "C:/Websites/site3.local/cgi-bin/"
</VirtualHost>

In httpd.conf I have this for each of the above sites:

</Directory>

<Directory "C:/Websites/site1.local">
AllowOverride All
Order allow,deny
Allow from all
</Directory>


I uncommented the following:

LoadModule vhost_alias_module modules/mod_vhost_alias.so
Include conf/extra/httpd-vhosts.conf


My hosts file in Windows/System32/... :
127.0.0.1 localhost
::1 localhost
127.0.0.1 site1.local
127.0.0.1 site2.local
127.0.0.1 site3.local

Of course I restart the server after each change to the conf files.

I can't think of anything else to include here. Any ideas as to what is happening?? It would be nice to get each site's home page Smile

- jim
Santa Clara, CA
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Mon 11 Feb '08 10:59    Post subject: Reply with quote

Change

NameVirtualHost *:80

and in every vhost

<VirtualHost *:80>
Back to top
prest



Joined: 09 Feb 2008
Posts: 3
Location: Santa Clara, CA

PostPosted: Mon 11 Feb '08 18:47    Post subject: Reply with quote

Thank you for your thoughts but that was my original setup. I mentioned that briefly in my post. From what I read it seems either the IP or the *.80 should work.

Maybe there is something wrong with the Windows host file. Does something have to be different there? Something is making all the domains point to site1/index.php.
Back to top
strigoi



Joined: 15 Dec 2005
Posts: 36

PostPosted: Wed 13 Feb '08 9:38    Post subject: .. Reply with quote

NameVirtualHost *

<VirtualHost *>
ServerName localhost
DocumentRoot C:/apache/htdocs
CustomLog logs/localhost.access.log combined
ErrorLog logs/localhost.error.log
</VirtualHost>

<VirtualHost *>
ServerName site1.local
DocumentRoot "C:/Websites/site1.local"
CustomLog logs/site1.local.access.log combined
ErrorLog logs/site1.local.error.log
ScriptAlias /cgi-bin/ "C:/Websites/site1.local/cgi-bin/"
</VirtualHost>

<VirtualHost *>
ServerName site2.local
DocumentRoot "C:/Websites/site2.local"
CustomLog logs/site2.local.access.log combined
ErrorLog logs/site2.local.error.log
ScriptAlias /cgi-bin/ "C:/Websites/site2.local/cgi-bin/"
</VirtualHost>

<VirtualHost *>
ServerName site3.local
DocumentRoot "C:/Websites/site3.local"
CustomLog logs/site3.local.access.log combined
ErrorLog logs/site3.local.error.log
ScriptAlias /cgi-bin/ "C:/Websites/site3.local/cgi-bin/"
</VirtualHost>

should do it for ya.
Back to top
prest



Joined: 09 Feb 2008
Posts: 3
Location: Santa Clara, CA

PostPosted: Wed 13 Feb '08 21:50    Post subject: Reply with quote

Thanks strigoi! That works.

NameVirtualHost *

<VirtualHost *>

- jim
Back to top


Reply to topic   Topic: Several vhosts point to only one of their index.php files View previous topic :: View next topic
Post new topic   Forum Index -> Apache