# Apache not starting



## richtestani (Aug 17, 2005)

This morning Apache was running

When trying to stop then start - i'd get this error



> Starting hxxpd298)Address already in use: make_sock: could not bind to address [::]:80
> no listening sockets available, shutting down
> Unable to open logs


(note above: this site wont let you write protocol.)

I am not quite sure where to begin. Im relatively new to Linux, and know some basics and can access the server via SSH.

I was wondering if anyone can help troubleshoot or if anyone can reccomend a possible pay server to use. It's quite urgent and needs to be taken care of fast.

Thanks
Rich


----------



## linuxphile (Mar 6, 2003)

Try the following from a terminal/command prompt:
ps -ef | grep httpd 
If you see any lines other than a line containing the above command there is still a lingering httpd (Apache) process running, therefore still bound to port 80. If you've already stopped httpd it may be necessary to kill the process. If kill isn't enough try kill -9.


----------



## richtestani (Aug 17, 2005)

Hi Linuxphile,

There was no return after issuing that command.


----------



## linuxphile (Mar 6, 2003)

Is anything returned with
netstat -an | grep ":80" 
?


----------



## richtestani (Aug 17, 2005)

Nothing there either.


----------



## Squashman (Apr 4, 2003)

Have you tried restarting all the network services.


----------



## linuxphile (Mar 6, 2003)

If the above command did not return anything then there are no processes bound to port 80. You might want to try starting Apache now, as root of course.


----------



## richtestani (Aug 17, 2005)

when I try to start apache it never gets running. Seems to hang.


```
[[email protected] root]# apachectl status

Apache is *not* running.

Use /usr/sbin/apachectl extendedstatus for more information.

[[email protected] root]# apachectl start
Starting httpd2:
```
If run apache in debug mode, the server starts up - runs slowly but its working. Stopping that, will then return the original error when trying to start.


----------



## linuxphile (Mar 6, 2003)

After trying to start Apache what do you see in /var/log/messages ?


----------



## richtestani (Aug 17, 2005)

```
[[email protected] root]# /var/log/messages
-bash: /var/log/messages: Permission denied
```


----------



## linuxphile (Mar 6, 2003)

You will need to be root to view /var/log/messages and to start Apache. 
/var/log/messages itself is not a command. You can issue, as root, after attempting to start Apache: 
tail -n100 /var/log/messages


----------



## richtestani (Aug 17, 2005)

Would it make sense to use urpmi to remove apache then install?
Is that safe or would I just make more problems?


----------



## richtestani (Aug 17, 2005)

I was in root - but as you prob guessed, I'm a relatively inexperienced with troubleshooting linux  I appreciate your time though.


```
[[email protected] root]# tail -n100 /var/log/messages
Aug 18 14:26:01 divvies saslauthd[1286]: logusercolumn changed.
Aug 18 14:26:01 divvies saslauthd[1286]: loghostcolumn changed.
Aug 18 14:26:01 divvies saslauthd[1286]: logpidcolumn changed.
Aug 18 14:26:02 divvies saslauthd[1286]: logtimecolumn changed.
Aug 18 14:26:02 divvies saslauthd[1286]: db_connect  called.
Aug 18 14:26:02 divvies saslauthd[1286]: returning 0 .
Aug 18 14:26:02 divvies saslauthd[1286]: db_checkpasswd called.
Aug 18 14:26:02 divvies saslauthd[1286]: pam_mysql: where clause = 
Aug 18 14:26:02 divvies saslauthd[1286]: SELECT password FROM accountuser WHERE username='lori'
Aug 18 14:26:02 divvies saslauthd[1286]: sqlLog called.
Aug 18 14:26:02 divvies saslauthd[1286]: insert into log (msg, user, host, pid, time) values('AUTH SUCCESSFUL', 'lori', '', '1286', NOW())
Aug 18 14:26:02 divvies saslauthd[1286]: Returning 0
Aug 18 14:26:02 divvies saslauthd[1286]: returning 0 .
Aug 18 14:26:02 divvies saslauthd[1286]: returning 0.
Aug 18 14:26:02 divvies saslauthd[1286]: pam_mysql: acct_mgmt called but not implemented. Dont panic though :)
Aug 18 14:27:02 divvies imap[8433]: sql_select option missing
Aug 18 14:27:02 divvies imap[8433]: auxpropfunc error no mechanism available 
Aug 18 14:27:15 divvies imap[8434]: sql_select option missing
Aug 18 14:27:15 divvies imap[8434]: auxpropfunc error no mechanism available 
Aug 18 14:27:15 divvies saslauthd[1279]: pam_sm_authenticate called.
Aug 18 14:27:15 divvies saslauthd[1279]: dbuser changed.
Aug 18 14:27:15 divvies saslauthd[1279]: dbpasswd changed.
Aug 18 14:27:15 divvies saslauthd[1279]: host changed.
Aug 18 14:27:15 divvies saslauthd[1279]: database changed.
Aug 18 14:27:15 divvies saslauthd[1279]: table changed.
Aug 18 14:27:15 divvies saslauthd[1279]: usercolumn changed.
Aug 18 14:27:15 divvies saslauthd[1279]: passwdcolumn changed.
Aug 18 14:27:15 divvies saslauthd[1279]: crypt changed.
Aug 18 14:27:15 divvies saslauthd[1279]: logtable changed.
Aug 18 14:27:15 divvies saslauthd[1279]: logmsgcolumn changed.
Aug 18 14:27:15 divvies saslauthd[1279]: logusercolumn changed.
Aug 18 14:27:15 divvies saslauthd[1279]: loghostcolumn changed.
Aug 18 14:27:15 divvies saslauthd[1279]: logpidcolumn changed.
Aug 18 14:27:15 divvies saslauthd[1279]: logtimecolumn changed.
Aug 18 14:27:15 divvies saslauthd[1279]: db_connect  called.
Aug 18 14:27:15 divvies saslauthd[1279]: returning 0 .
Aug 18 14:27:15 divvies saslauthd[1279]: db_checkpasswd called.
Aug 18 14:27:15 divvies saslauthd[1279]: pam_mysql: where clause = 
Aug 18 14:27:15 divvies saslauthd[1279]: SELECT password FROM accountuser WHERE username='lori'
Aug 18 14:27:15 divvies saslauthd[1279]: sqlLog called.
Aug 18 14:27:15 divvies saslauthd[1279]: insert into log (msg, user, host, pid, time) values('AUTH SUCCESSFUL', 'lori', '', '1279', NOW())
Aug 18 14:27:15 divvies saslauthd[1279]: Returning 0
Aug 18 14:27:15 divvies saslauthd[1279]: returning 0 .
Aug 18 14:27:15 divvies saslauthd[1279]: returning 0.
Aug 18 14:27:15 divvies saslauthd[1279]: pam_mysql: acct_mgmt called but not implemented. Dont panic though :)
Aug 18 14:27:16 divvies saslauthd[1287]: pam_sm_authenticate called.
Aug 18 14:27:16 divvies saslauthd[1287]: dbuser changed.
Aug 18 14:27:16 divvies saslauthd[1287]: dbpasswd changed.
Aug 18 14:27:16 divvies saslauthd[1287]: host changed.
Aug 18 14:27:16 divvies saslauthd[1287]: database changed.
Aug 18 14:27:16 divvies saslauthd[1287]: table changed.
Aug 18 14:27:16 divvies saslauthd[1287]: usercolumn changed.
Aug 18 14:27:16 divvies saslauthd[1287]: passwdcolumn changed.
Aug 18 14:27:16 divvies saslauthd[1287]: crypt changed.
Aug 18 14:27:16 divvies saslauthd[1287]: logtable changed.
Aug 18 14:27:16 divvies saslauthd[1287]: logmsgcolumn changed.
Aug 18 14:27:16 divvies saslauthd[1287]: logusercolumn changed.
Aug 18 14:27:16 divvies saslauthd[1287]: loghostcolumn changed.
Aug 18 14:27:16 divvies saslauthd[1287]: logpidcolumn changed.
Aug 18 14:27:16 divvies saslauthd[1287]: logtimecolumn changed.
Aug 18 14:27:16 divvies saslauthd[1287]: db_connect  called.
Aug 18 14:27:16 divvies saslauthd[1287]: returning 0 .
Aug 18 14:27:16 divvies saslauthd[1287]: db_checkpasswd called.
Aug 18 14:27:16 divvies saslauthd[1287]: pam_mysql: where clause = 
Aug 18 14:27:16 divvies saslauthd[1287]: SELECT password FROM accountuser WHERE username='lori'
Aug 18 14:27:16 divvies saslauthd[1287]: sqlLog called.
Aug 18 14:27:16 divvies saslauthd[1287]: insert into log (msg, user, host, pid, time) values('AUTH SUCCESSFUL', 'lori', '', '1287', NOW())
Aug 18 14:27:16 divvies saslauthd[1287]: Returning 0
Aug 18 14:27:16 divvies saslauthd[1287]: returning 0 .
Aug 18 14:27:16 divvies saslauthd[1287]: returning 0.
Aug 18 14:27:16 divvies saslauthd[1287]: pam_mysql: acct_mgmt called but not implemented. Dont panic though :)
Aug 18 14:28:16 divvies imap[8438]: sql_select option missing
Aug 18 14:28:16 divvies imap[8438]: auxpropfunc error no mechanism available 
Aug 18 15:01:00 divvies CROND[8460]: (root) CMD (nice -n 19 run-parts /etc/cron.hourly) 
Aug 18 15:32:06 divvies sshd[8478]: fatal: Timeout before authentication for ::ffff:67.153.120.12
Aug 18 15:51:29 divvies sshd[8487]: Invalid user tracy from ::ffff:67.153.120.12
Aug 18 15:51:29 divvies sshd[8487]: error: Could not get shadow information for NOUSER
Aug 18 15:51:29 divvies sshd[8487]: Failed password for invalid user tracy from ::ffff:67.153.120.12 port 52758 ssh2
Aug 18 15:51:34 divvies sshd[8489]: Invalid user content from ::ffff:67.153.120.12
Aug 18 15:51:34 divvies sshd[8489]: error: Could not get shadow information for NOUSER
Aug 18 15:51:34 divvies sshd[8489]: Failed password for invalid user content from ::ffff:67.153.120.12 port 53354 ssh2
Aug 18 15:51:35 divvies sshd[8491]: Invalid user article from ::ffff:67.153.120.12
Aug 18 15:51:35 divvies sshd[8491]: error: Could not get shadow information for NOUSER
Aug 18 15:51:35 divvies sshd[8491]: Failed password for invalid user article from ::ffff:67.153.120.12 port 55328 ssh2
Aug 18 15:51:38 divvies sshd[8493]: Invalid user ahernandez from ::ffff:67.153.120.12
Aug 18 15:51:38 divvies sshd[8493]: error: Could not get shadow information for NOUSER
Aug 18 15:51:38 divvies sshd[8493]: Failed password for invalid user ahernandez from ::ffff:67.153.120.12 port 55935 ssh2
Aug 18 15:51:40 divvies sshd[8495]: Invalid user alberto from ::ffff:67.153.120.12
Aug 18 15:51:40 divvies sshd[8495]: error: Could not get shadow information for NOUSER
Aug 18 15:51:40 divvies sshd[8495]: Failed password for invalid user alberto from ::ffff:67.153.120.12 port 57162 ssh2
Aug 18 16:01:00 divvies CROND[8499]: (root) CMD (nice -n 19 run-parts /etc/cron.hourly) 
Aug 18 16:01:46 divvies postfix/smtpd[8514]: sql_select option missing
Aug 18 16:01:46 divvies postfix/smtpd[8514]: auxpropfunc error no mechanism available 
Aug 18 16:01:47 divvies lmtpunix[8524]: sql_select option missing
Aug 18 16:01:47 divvies lmtpunix[8524]: auxpropfunc error no mechanism available 
Aug 18 17:01:00 divvies CROND[8546]: (root) CMD (nice -n 19 run-parts /etc/cron.hourly) 
Aug 18 17:21:36 divvies sshd[8556]: Failed password for root from ::ffff:69.120.167.216 port 54432 ssh2
Aug 18 17:21:43 divvies sshd[8556]: Accepted password for root from ::ffff:69.120.167.216 port 54432 ssh2
Aug 18 17:37:40 divvies httpd2: Syntax OK
Aug 18 17:37:40 divvies apachectl: Checking configuration sanity for Apache 2.0:  succeeded
```


----------

