Showing posts with label Solaris 10. Show all posts
Showing posts with label Solaris 10. Show all posts

Monday, June 16, 2008

Configuring Apache 2 HTTP Server on Solaris 10

How do you configure Apache 2 HTTP Server to run automatically on Solaris 10 using rc init scripts.

Log into the Solaris box as root, or su root.
Go to the /etc/init.d directory.
Copy the apache startup script to apache2
cp apache apache2

Change the group to sys
chgrp sys apache2
Next change the flags on the file to execute
chmod u+x apache2
Open the apache2 file with your favorite editor and modify the following lines:

APACHE_HOME=/usr/apache
CONF_FILE=/etc/apache/httpd.conf
RUNDIR=/var/run/apache
PIDFILE=${RUNDIR}/httpd.pid

as follows:

APACHE_HOME=/usr/apache2
CONF_FILE=/etc/apache2/httpd.conf
RUNDIR=/var/run/apache2
PIDFILE=${RUNDIR}/httpd.pid

Check to make sure you have a valid httpd.conf file located in /etc/apache2. You can copy the httpd.conf-example file to httpd.conf. This will create a basic httpd.conf file.

Next go to the /etc/init.d directory and try executing the apache2 file. You should see something like this:

[dev1:init.d:root]#./apache2 start
httpd starting.
You can check your configuration by using a browser to check it.

Next you will want to configure it to start/stop at the various runlevels.

Go to /etc/rc0.d and add the following:
ln -s ../init.d/apache2 K17apache2
Go to /etc/rc1.d and add the following:
ln -s ../init.d/apache2 K17apache2
Go to /etc/rc3.d and add the following:
ln -s ../init.d/apache2 S51apache2
Go to /etc/rcS.d and add the following:
ln -s ../init.d/apache2 K17apache2

This will complete the configuration for your server. Next time you change run levels, or reboot, the Apache 2 HTTP Server will restart as you expect.

Addendum:

Zaphod commented on my page about using Solaris SMF. This is truly easier.

1. Check to make sure you have a valid httpd.conf file located in /etc/apache2. You can copy the httpd.conf-example file to httpd.conf. This will create a basic httpd.conf file.

2. Execute svcadm -v enable -rs apache2

3. You are now running on Apache2 on SMF.

Sunday, November 05, 2006

Subversion 1.4.0 Build Configuration (Solaris 10) (SPARC)

Set the library path using crle
crle -c /var/ld/ld.config -l /lib:/usr/lib:/usr/local/lib:/usr/sfw/lib

***You may need to unset the LD_LIBRARY_PATH
unset LD_LIBRARY_PATH

set make to gmake
export MAKE=/opt/sfw/bin/gmake

Add additional directories to the path
export PATH=$PATH:/usr/ccs/bin:/usr/sfw/sparc-sun-solaris2.10/bin

CONFIGURE SCRIPT

./configure --enable-maintainer-mode --enable-javahl --with-zlib --with-apxs=/usr/apache2/bin/apxs --with-jikes=no --with-jdk=/usr/jdk/jdk1.5.0_07 --without-berkeley-db --with-apr=/usr/apache2/bin/apr-config --with-apr-util=/usr/apache2/bin/apu-config --with-editor=/opt/sfw/bin/pico

Popular Posts