Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apache Won't Start With Valid Host Config - Please Help!!!

Status
Not open for further replies.

BattleDroid42

Programmer
May 17, 2002
100
US
Hi All,

I'm running an Intel box with Solaris 8 and Apache. I have little knowledge of UNIX web hosting and inherited the box from former coworkers. The box hosts two websites which are currently down. The power recently went out and for some reason the httpd service will no longer start as follows:


# ./S50apache start
httpd starting.
[Tue Aug 3 11:46:31 2004] [warn] NameVirtualHost telco.spc.com:80 has no
VirtualHosts
/usr/apache/bin/apachectl start: httpd could not be started

# ./apachectl start
[Tue Aug 3 11:47:37 2004] [warn] NameVirtualHost telco.spc.com:80 has no
VirtualHosts
./apachectl start: httpd could not be started

# ./apachectl configtest
[Tue Aug 3 11:42:13 2004] [warn] NameVirtualHost telco.spc.com:80 has no
VirtualHosts
Syntax OK

The virtual hosts are configured in httpd.conf as follows (the names have been changed to protect the innocent):

#
# If you want to use name-based virtual hosts you need to define at # least one IP address (and port number) for them. # NameVirtualHost mysite1.spc.com:80 NameVirtualHost telco.spc.com:80 #NameVirtualHost 12.34.56.78

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container. #

<VirtualHost mysite1.spc.com>
ServerAdmin rh9393@txmail.spc.com
DocumentRoot /var/apache/htdocs/campaignsurfer
ServerName mysite1.spc.com
ErrorLog logs/mysite1.com-error_log
CustomLog logs/mysite1.com-access_log common </VirtualHost>

<VirtualHost telco.spc.com>
ServerAdmin rh9393@txmail.spc.com
DocumentRoot /var/apache/htdocs/
ServerName telco.spc.com
ErrorLog logs/telco.com-error_log
CustomLog logs/telco.com-access_log common
</VirtualHost>

#<VirtualHost _default_:*>
#</VirtualHost>

#<IfModule mod_perl.c>
#
#<Location /perl-status>
# SetHandler perl-script
# PerlHandler Apache::Status
# order deny,allow
# deny from all
# allow from yourhost
#</Location>
#
#</IfModule>
#

# Enable java servlet support (mod_jserv) by including it's config file # (remember to check the configuration in jserv.properties also)

I can use any help I can get! Thanks!

BD42
 
Notice your NameVirtualHost directives reference the URLs, as opposed to they way they are referenced ("mysite1.spc.com:80", "telco.spc.com:80") versus how they are referenced in your VirtualHost directives ("mysite1.spc.com", "telco.spc.com"). Apache is complaining about the fact that these entries do not match.

However, this warning should not be stopping Apache from running. In your httpd.conf file, you should have a line which reads:

ErrorLog /path/to/some/errorfile.log

This directive will NOT be inside a VirtualHost tag.

Issue:

tail -f /path/to/some/errorfile.log &

(note the ampersand at the end of the command. This runs the command in the background)

then run

./apachectl start

This will allow you to see what Apache is appending to the error log as it tries to start. There is likely something else there.

(To kill that background task, issue:

fg

then hit control-c.)



Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Greetings! Thanks for your reply!

Here are the results:

# tail -f /var/apache/logs/error_log &
[Fri Jul 16 14:54:07 2004] [notice] child pid 1238 exit signal Bus Error (10)
[Fri Jul 16 16:27:27 2004] [notice] child pid 2449 exit signal Bus Error (10)
[Sat Jul 17 11:12:54 2004] [notice] child pid 20421 exit signal Bus Error (10)
[Mon Jul 19 10:20:18 2004] [notice] child pid 2706 exit signal Bus Error (10)
[Mon Jul 19 12:42:50 2004] [notice] child pid 11032 exit signal Bus Error (10)
[Mon Jul 19 14:25:49 2004] [notice] child pid 11783 exit signal Bus Error (10)
[Tue Jul 20 08:53:02 2004] [notice] child pid 14955 exit signal Bus Error (10)
[Wed Jul 21 12:15:53 2004] [notice] child pid 22592 exit signal Bus Error (10)
[Thu Jul 22 14:59:29 2004] [notice] child pid 6233 exit signal Bus Error (10)
[Sat Jul 24 17:05:33 2004] [notice] child pid 15274 exit signal Bus Error (10)
9495

The errors above displayed immediately after the tail command was issued. I then issued the start command; it doesn't appear that resulting errors were registered?


P.S. I be checking here throughout the day as I would really like to get this fixed.
 
This "</VirtualHost>" should be on a line by itself if you really wanna be cool. You have it on the same line as your logs directive in the first container. You don't need all that info when you define the vhost container. All you need is this: <VirtualHost *>. The NameVirtualHost directive also only needs a "*". If you want to bind to a particular address and/or port, use the Listen directive: "Listen 192.168.1.20:80". You also wanna make sure the "UseCanonicalName" is set to "Off". It WILL work when you do these things :).
 
While this didn't turn out to be the solution your advice still helped me locate the problem because it gave me the idea to remove or toggle the vhost information.

Basically I commented out each directive to see which one Apache would not start on. It turned out that Apache had a problem with the site's HUGE access log. So, I deleted the access log (it had stopped logging to it in May), created an empty one, did a shutdown and brought the box back to normal. The site came up without a hitch.

I did end up retaining the vhost information.

Remember, wherever you go...there you are.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top