Apache on Solaris 10
The apache webserver is already included in Solaris 10. We just need to enable it. Following are the steps to enable it.
1.Create a default apache config file. All apache file’s are in /etc/apache2 directory.
# cd /etc/apache2
# cp httpd.conf-example httpd.conf
2. Enable the http/apache service
Ckeck to see if its already running
# svcs -a | grep -i http
disable 10:00:00 svc:/network/http:apache2
Use the svcadm command to start the webserver. This will also make it automatically start if your machine reboots.
svcadm -v enable /network/http:apache2
Use the following svcs command to make sure it worked:
# svcs -p /network/http:apache2
STATE STIME FMRI online 10:00:00 svc:/network/http:apache2 10:00:00 5354 httpd 10:00:01 5355 httpd 10:00:01 5356 httpd 10:00:01 5357 httpd 10:00:01 5358 httpd 10:00:01 5359 httpd
This is showing that the webserver is online and working.
3. Add the web contents.
Put your html page in the /var/apache2/htdocs directory. If everything went OK, you should have a functioning apache webserver.
For apache webserver we need to type http://localhost:80 on the web browser.
4.Troubleshooting
If the svcs -p command from the above step doesn’t show a STATE of online, do the followig:
# svcs -a | grep -i http
You’ll probably see that it’s in maintenance mode:
maintenance 10:00:02 svc:/network/http:apache2 For more detail run following comand # svcs -x http svc:/network/http:apache2 (Apache 2 HTTP server) State: maintenance since September 2, 2010 10:15:26 AM CDT Reason: Start method failed repeatedly. See: http://sun.com/msg/SMF-8000-05 See: httpd(8) See: /var/svc/log/network-http:apache2.log Impact: This service is not running. Look for the log file and restart the server # svcadm restart /network/http:apache2 # svcadm -v enable svc:/network/http:apache2 # svcs -p | grep -i http online 10:22:36 svc:/network/http:apache2 10:22:36 5391 httpd 10:22:37 5392 httpd 10:22:37 5393 httpd 10:22:37 5394 httpd 10:22:37 5395 httpd 10:22:37 5396 httpd

Leave a Reply