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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Starting apache 2.2.8 server = no errors but does nothing

Status
Not open for further replies.

clemcrock

Programmer
Dec 17, 2006
63
US
Hello,
I've installed apache 2.2.8 on Ubuntu and I have gotten as far as setting httpd.conf up as far as it won't throw any errors when I do a sudo httpd -k start.

The only thing, is that when I run sudo httpd -k start, nothing happens.

Where is the first place one would look to diagnose this?

Thanks,
Clem C
 
ok - now starting to get somewhere:

in logs/error_log:


[Mon Feb 11 06:16:12 2008] [warn] pid file /var/run/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Mon Feb 11 06:16:12 2008] [alert] getpwuid: couldn't determine user name from uid 4294967295, you probably need to modify the User directive
[Mon Feb 11 06:16:12 2008] [alert] getpwuid: couldn't determine user name from uid 4294967295, you probably need to modify the User directive
[Mon Feb 11 06:16:12 2008] [alert] getpwuid: couldn't determine user name from uid 4294967295, you probably need to modify the User directive
[Mon Feb 11 06:16:12 2008] [alert] getpwuid: couldn't determine user name from uid 4294967295, you probably need to modify the User directive
[Mon Feb 11 06:16:12 2008] [notice] Apache/2.2.4 (Unix) configured -- resuming normal operations
[Mon Feb 11 06:16:12 2008] [alert] Child 21773 returned a Fatal error... Apache is exiting!
[Mon Feb 11 06:16:12 2008] [alert] getpwuid: couldn't determine user name from uid 4294967295, you probably need to modify the User directive
 
Default value for User is -1, which is this number (2 raised power 32 - 1). You don't have this user defined, usually nobody.

eugene

 
The two directives that need to be set here are User and Group. These are usually set to either apache or nobody. Almost everything runs as a user on linux. Check to see if either of these are valid users on your system.

 
Good news - The server actually starts w/ no problem.


Bad new is that I've configure my paths wrong so when I go to my ip: 208.78.101.123 I get this:

The requested URL / was not found on this server.

In the httpd.conf, my ServerRoot is set to this:

ServerRoot "/etc/httpd-2.2.8/"

and my virtualhost looks like this:

<VirtualHost *>
DocumentRoot "/ ServerName " ServerAlias " ErrorLog logs/error_log
</VirtualHost>

The directory / does exist and I have a simple index.html file in there.
 
Look for this directive:

NameVirtualHost *:80

Uncomment it by removing the '#' in front of it. You might also want to change <VirtualHost> to <VirtualHost *:80>. I doubt this is your problem but I want to make sure the vhost is being seen. If you do not have a directory container for you DocumentRoot, you may want to do so. Here is an example of what it would look like:

Code:
 <VirtualHost *>
   DocumentRoot "/[URL unfurl="true"]www/vhosts/ehermann"[/URL]
   ServerName "[URL unfurl="true"]www.ehermann.com"[/URL]
   ServerAlias "[URL unfurl="true"]www.e-hermann.com"[/URL]
   ErrorLog logs/error_log

      <Directory "/[URL unfurl="true"]www/vhosts/ehermann">[/URL]
        Options Indexes FollowSymLinks
        AllowOverride None
        Order allow, deny
        Allow from all
      </Directory>

</VirtualHost>
 
I set mine up like this and get the same results:

Code:
NameVirtualHost *:80

<VirtualHost *:80>
   DocumentRoot "/[URL unfurl="true"]www/vhosts/ehermann"[/URL]
   ServerName "[URL unfurl="true"]www.ehermann.com"[/URL]
   ServerAlias "[URL unfurl="true"]www.e-hermann.com"[/URL]
   ErrorLog logs/error_log
      <Directory "/[URL unfurl="true"]www/vhosts/ehermann">[/URL]
        Options Indexes FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all
      </Directory>
</VirtualHost>
 
Try removing the quotes around ServerName and ServerAlias.
 
getting closer - now the server starts but now I get a 404 when I visit the IP

Here's my setup so far:

Code:
ServerName [URL unfurl="true"]www.ehermann.com[/URL]

NameVirtualHost *:80

<VirtualHost *:80>
   DocumentRoot "/[URL unfurl="true"]www/vhosts/ehermann"[/URL]
   ServerName [URL unfurl="true"]www.ehermann.com[/URL]
   ServerAlias [URL unfurl="true"]www.e-hermann.com[/URL]
   ErrorLog logs/error_log
      <Directory "/[URL unfurl="true"]www/vhosts/ehermann">[/URL]
        Options Indexes FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all
      </Directory>
</VirtualHost>

<IfModule mod_dir.c>
    DirectoryIndex index.html index.htm
</IfModule>
 
It appears that the logs have stopped being written to about 3 days ago for some reason.

Here's the last entry:

[Tue Jan 15 05:34:01 2008] [error] [client 213.203.223.118] File does not exist: /usr/share/apache2/default-site/htdocs/stats
[Fri Jan 18 00:35:54 2008] [notice] SIGHUP received. Attempting to restart
Syntax error on line 15 of /etc/apache2/extra/httpd-autoindex.conf:
Invalid command 'IndexOptions', perhaps misspelled or defined by a module not included in the server configuration
 
Check that the right httpd is running and the right httpd.conf is referenced. Make sure that the port is bound to 80 when you think it should.

It really seems you might have a config problem, if access/error is not being updated then something in the config is wrong. Apache will stop cold if it isn't logging correctly.
eugene
 
How do I check to see right httpd is running and the right httpd.conf is referenced?
 
ps -ef | grep httpd

For instance, it returns /usr/sbin/httpd

Then issue /usr/sbin/httpd -V to see the default
HTTP_ROOT and SERVER_CONFIG_FILE

Also, "locate apachectl" this is how to control your apache server. (the default might be in /usr/sbin)

If you do a "apachectl stop" and httpd is still running, you have the wrong apachectl.

The simple way I test the httpd.conf is put an obvious syntax error in it.
If "apachectl configtest" barfs, then I know I have the right httpd.conf. If when issuing "apachectl restart" and
httpd is still running with the syntax error, I'd be looking around to see if I had the right http root or conf file.

eugene
 
I'm sure I have only one apache process running from the information ps -ef | grep httpd returns.

I also know the httpd.conf file I'm editing is the one that causes the errors when I do a apachect start and throws errors I purposely create.

Here's the output of /usr/sbin/httpd -V:

-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=128
-D HTTPD_ROOT=""
-D SUEXEC_BIN="/bin/suexec"
-D DEFAULT_PIDLOG="/var/run/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="/var/run/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="/etc/apache2/mime.types"
-D SERVER_CONFIG_FILE="/etc/apache2/httpd.conf"

Thanks for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top