Common errors while starting Apache server on linux

Bash - GNU Shell, Common CLI, Tips Add comments

The correct way to start the apache server is to use the apachectl command.

apachectl stop

apachectl start

apachectl graceful

You can also check your configuration files.

apachectl configtest

A common error is probably this one :

(98)Address already in use: make_sock: could not bind to address 0.0.0.0:443

no listening sockets available, shutting down

This is caused by one or more processes running on the 443 (secure socket) port. You can get all the process ID’s that are running on this port with the command fuser or a more classical “ps auxww” with a less readable format.

nicolas@grimm:~$ fuser 443/tcp

443/tcp: 7977 6815 9819 35217

Now you just have to do a kill on those process.

nicolas@grimm:~$ kill -9 7977 6815 9819 35217

Or in a more sys admin useful way :

nicolas@grimm:~$ kill -9 $(fuse 443/tcp 2>/dev/null)

Other typical error would be those following :

(28)No space left on device: Couldn’t create accept lock

or

(28)No space left on device: mod_rewrite: could not create rewrite_log_lock Configuration Failed

Brain dead things is that you have plenty of space on your disk. Problem comes from apache that was not shutdown properly and lets lot of semaphore-arrays left. So, here comes ipcs command. ipcs provides information on the ipc facilities for which the calling process has read acccess.

nicolas@grimm:~$ ipcs -s | grep www-data

0×00000000 163840 www-data 600 1
0×00000000 196609 www-data 600 1
0×00000000 229378 www-data 600 1

Before restart your apache you have to remove all this semaphore arrays by using ipcrm. ipcrm remove a message queue, semaphore set or shared memory id.

nicolas@grimm:~$ ipcs -s | grep www-data | perl -e ‘while () { @a=split(/\s+/); print `ipcrm sem $a[1]`}’

Now you should be able to start your apache. Lot of other error can happens. first thing to do is to take a look at your error log file then googleize ! ;-)

Share this post with your network :These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blinkbits
  • BlinkList
  • blogmarks
  • co.mments
  • connotea
  • del.icio.us
  • De.lirio.us
  • digg
  • Fark
  • feedmelinks
  • Furl
  • LinkaGoGo
  • Ma.gnolia
  • NewsVine
  • Netvouz
  • RawSugar
  • Reddit
  • scuttle
  • Shadows
  • Simpy
  • Smarking
  • Spurl
  • TailRank
  • Wists
  • YahooMyWeb

Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in