VPS
Main PagecPanel and DirectAdmin LicensingServer Management PlansVirtual Private ServersDedicated Servers
Control Panel Licensing
ServerTune ResellersResellersSpecial PromotionsServerTune SpecialsHomeAbout ServerTuneContact usTechnical SupportKB
ServerTune Main Page
Space
Space
Our most popular products:

SPECIAL PROMOTION: cPanel License $36 /month. more info

Issues, Tips, and Solutions

Protect your server with Mod Security rules written specifically for your system. more info ...

Space
Search:    Advanced search
Browse by category:
Errors and Solutions
Printer Friendly
email to a friend
Add comment Add comment
Views: 559
Votes: 0
Comments: 0
Posted: 18 Oct, 2007
by: Support T.
* * * * *
Updated: 18 Oct, 2007
by: Support T.
Starting Apache

Sometimes Apache refuses to start. When this happens sweat instantly appears on your forehead because without apache running none of your website's are available. Here are some things you can try based on problems we've come across. Hitting the reset switch isn't the solution and not something you should do when you come across a problem like this.

The correct way to start, stop or restart apache is by using the apachectl program. Such as:

  • /sbin/service httpd graceful
  • /sbin/service httpd stop
  • /sbin/service httpd restart

Checking Apache configuration
Apachectl can also be used to check the apache configuration, such as:

  • /sbin/service httpd configtest
    This will return warnings and errors.

Check the Apache error logs
Take a look at the error logs (usually "/var/log/httpd/") and see if you can find what's causing the problem.

1) ---------- Error ----------

    (98)Address already in use: make_sock: could not bind to address 0.0.0.0:443
    no listening sockets available, shutting down

---------- Solution ----------
This is caused by one or more processes running on the 443 (secure socket ) port. To fix this problem first find the process ID's that are running on port 443:

  • /sbin/fuser 443/tcp

This will return results which look something like:

    443/tcp: xxxx yyyy zzzz <- processes using 443

Where xxxx yyyy & zzzz are numbers for the process ID's. Now kill the processes with:

  • Kill -9 xxxx yyyy & zzzz

Apache will not start. Error log contains:

2) ---------- Error ----------

    (98)Address already in use: make_sock: could not bind to address 0.0.0.0:443
    no listening sockets available, shutting down
    [emerg] (28)No space left on device: Couldn't create accept lock

 OR

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

Now, checking your disk shows that you have plenty of space. The problem is that apache didn't shut down properly, and it's left myriads of semaphore-arrays left, owned by my apache-user. Run:

---------- Solution ----------
Run the following commands (in that order):

  • /usr/bin/ipcs -s | grep nobody

Removing these semaphores immediately should solve the problem and allow apache to start:

  • usr/bin/ipcs -s | grep nobody | perl -e 'while (<STDIN>) { @a=split(/\s+/); print `ipcrm sem $a[1]`}'
Other articles in this Category
document How do I force SSL for specific pages with Apache & mod_rewrite?
document Hw can I view the modules compiled with Apache?
document Error Messages :: Invalid argument: core_output_filter: writing data to the network
document Error Messages :: Premature end of script headers
document Address already in use: make_sock: could not bind to address [::]:80/443
document Premature end of script headers
document HowTo view compiled modules with Apache



RSS