Click to See Complete Forum and Search --> : Apache Config Problems


NUtack97
09-20-2004, 10:33 PM
Hi Guys,

I tried to setup some virtual hosts, but after not being able to get it working, I decided to change things back to what they were before. Apparently, now it gives me the following error when I try to start up apache:


Starting httpd2: [Mon Sep 20 21:44:31 2004] [warn] NameVirtualHost xxx.xxx.xxx.xxx:0 has no VirtualHosts
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs

where xxx.xxx.xxx.xxx is the current IP of my server. I may have made some (what I thought to be) minor tweaks in the config files, but I can't remember exactly what I changed to put it back to what it was before. I'm running on a dynamic dns connection, if that helps. Any ideas, guys??

sholeh_setyawan
09-21-2004, 02:21 AM
You might forget to disable NameVirtualHost line, when tried to change things back to the original settings.

Usually the virtual host settings is like :

NameVirtualHost 111.222.33.44

<VirtualHost 111.222.33.44>
ServerName www.domain.tld
ServerPath /domain
DocumentRoot /web/domain
</VirtualHost>

I thought you have disabled the things between <Virtualhost ..> and </Virtualhost> but forget to disable the NameVirtualHost line.

j79zlr
09-21-2004, 02:46 AM
With multiple addresses on the same IP make sure your VH Section is setup like

NameVirtualHost *:80

<VirtualHost *:80>
ServerAdmin admin@website1.com
ServerName www.website1.com
ServerAlias website1.com
DocumentRoot /usr/local/www/website1.com
ErrorLog /var/log/website1.com-error_log
CustomLog /var/log/website1.com-access_log combined
<Directory "/usr/local/www/website1.com">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin admin@website2.com
ServerName www.website2.com
ServerAlias website2.com
DocumentRoot /usr/local/www/website2.com
ErrorLog /var/log/website2.com-error_log
CustomLog /var/log/website2.com-access_log combined
<Directory "/usr/local/www/website2.com">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>


That is just an example of how mine are setup, you may not need al of those options, but you get the idea.