Wednesday, November 11, 2009

Solaris 10: Configuring a Stock Apache Server


Solaris 10: Configuring a Stock Apache Server

Abstract:

Sun had been a tremendous advocate of Open Standards for decades. One of the most influential standards advocated by Sun had been Hyper Text Transfer Protocol, or "http". This protocol is most often served by a server program, called a "daemon". Many people and organizations create "httpd" servers, one such group is the "Apache Software Foundation", where employees from Sun had been elected to the board, and members of the board had served in authoritative positions on other Sun open source projects. The "httpd" daemon from "Apache", one of the most popular http servers in the world today, is bundled into Sun's Solaris Operating System.

Identifying the Apache Service:

Solaris 10 comes shipped with an HTTP server, but it is disabled by default. The services infrastructure shows the server, even if you are uncertain how to identify the service.
Ultra2/root$ svcs apache2
STATE STIME FMRI
disabled 17:01:42 svc:/network/http:apache2

Ultra2/root$ svcs http
STATE STIME FMRI
disabled 17:01:42 svc:/network/http:apache2

Configuring the Apache Service

The Apache "httpd" server uses a configuration file, which must be minimally configured, before it will operate.
Ultra2/root$ cp /etc/apache2/httpd.conf-example /etc/apache2/httpd.conf

Ultra2/root$
vi /etc/apache2/httpd.conf
...
ServerAdmin user@fully.qualified.domain
...
ServerName fully.qualified.domain
...

Enabling the Apache Service

The service can be enabled in Solaris 10 via the Service Administration command.
Ultra2/root$ svcadm enable svc:/network/http:apache2

Ultra2/root$ svcs apache2
STATE STIME FMRI
online 1:07:55 svc:/network/http:apache2

Document Location

Documents are located in the following UNIX directory tree:
Ultra2/root$ ls -al /var/apache2/htdocs/index.html* | head
-rw-r--r-- 1 root bin 1663 Nov 21 2004 /var/apache2/htdocs/index.html.ca
-rw-r--r-- 1 root bin 1583 Nov 21 2004 /var/apache2/htdocs/index.html.cz.iso8859-2
-rw-r--r-- 1 root bin 2202 Nov 21 2004 /var/apache2/htdocs/index.html.de
-rw-r--r-- 1 root bin 1508 Nov 21 2004 /var/apache2/htdocs/index.html.dk
-rw-r--r-- 1 root bin 1828 Nov 21 2004 /var/apache2/htdocs/index.html.ee
...

No comments:

Post a Comment