Unable to start Apache2 service on Solaris 10

apache-2.2debuggingsolaris-10

This is a default installation of Solaris 10 x86. No tweaks or customization.

1) I first enable apache2.

bash-3.00# svcadm enable apache2

2) Restart apache2

bash-3.00# svcadm restart apache2

3) Check whether the service is running.

bash-3.00# svcs | grep apache

legacy_run     Aug_08   lrc:/etc/rc3_d/S50apache

maintenance    18:41:16 svc:/network/http:apache2

4) The service has gone into maintenance and hence I am looking at the explanation of what is wrong.

bash-3.00# svcs -xv

svc:/network/http:apache2 (Apache 2 HTTP server)


    State: maintenance since Thu Aug 11 18:41:16 2011

    Reason: Start method exited with $SMF_EXIT_ERR_CONFIG.

    See: http://sun.com/msg/SMF-8000-KS

    See: man -M /usr/apache2/man -s 8 httpd

    See: /var/svc/log/network-http:apache2.log

5) Cat the log file.

bash-3.00# cat /var/svc/log/network-http:apache2.log

[ Aug  4 15:09:31 Rereading configuration. ]

[ Aug 11 12:54:23 Enabled. ]

[ Aug 11 12:59:58 Executing start method ("/lib/svc/method/http-apache2 start") ]

[ Aug 11 12:59:58 Method "start" exited with status 96 ]

[ Aug 11 17:35:48 Leaving maintenance because disable requested. ]

[ Aug 11 17:35:48 Disabled. ]

[ Aug 11 17:40:26 Enabled. ]

[ Aug 11 17:40:26 Executing start method ("/lib/svc/method/http-apache2 start") ]

[ Aug 11 17:40:26 Method "start" exited with status 96 ]

[ Aug 11 17:41:05 Leaving maintenance because clear requested. ]

[ Aug 11 17:41:05 Enabled. ]

[ Aug 11 17:41:05 Executing start method ("/lib/svc/method/http-apache2 start") ]

[ Aug 11 17:41:05 Method "start" exited with status 96 ]

[ Aug 11 18:40:30 Leaving maintenance because clear requested. ]

[ Aug 11 18:40:30 Enabled. ]

[ Aug 11 18:40:30 Executing start method ("/lib/svc/method/http-apache2 start") ]

[ Aug 11 18:40:30 Method "start" exited with status 96 ]

[ Aug 11 18:41:16 Leaving maintenance because clear requested. ]

[ Aug 11 18:41:16 Enabled. ]

[ Aug 11 18:41:16 Executing start method ("/lib/svc/method/http-apache2 start") ]

[ Aug 11 18:41:16 Method "start" exited with status 96 ]

I don't know how I can proceed from this place "Method "start" exited with status 96"

Best Answer

The SMF_EXIT_ERR_CONFIG code is returned when the SMF checks for the existence of the /etc/apache2/httpd.conf file and it is missing. A default Solaris Apache install will be provided with several template files in /etc/apache2, copy one of these to /etc/apache2/httpd.conf e.g.

cp /etc/apache2/httpd.std.conf /etc/apache2/httpd.conf

Once you have a httpd.conf file, any subsequent error messages will be sent to /var/apache2/logs/error_log.

You may need to make changes to /etc/apache2/httpd.conf to get Apache running in your environment.