apache installation in Solaris
Download: First download the source of the apache from its original site “http://archive.apache.org/dist/httpd/”. Here all versions are archived choose which version you want to install.
Extract: If that file is in .tar.gz format. In Solaris you have to first unzip that file
$ tar xvzf httpd-NN.tar
$ cd httpd-NN
NN is the version number of apache
Configure: ./configure –prefix=/usr/local/apache2 –enable-so –enable-mods-shared=all –enable-ssl –enable-proxy=shared
–prefix=/usr/local/apache2 in this location apache will be installed.
–enable-so Enable DSO capability provided by
mod_so. (modularizing the apache)
–enable-mods-shared=all all modules are shared.
–enable-ssl Enable support for SSL/TLS provided by
–enable-proxy=shared The proxy module will be build as DSO module.
In my case while configuring the apache I fall in the problem about gcc compiler. I have to add the path of the gcc compiler (/usr/sfw/bin) in my .profile file which determines my environment.
In ubuntu 9.04 I need to install g++, zlib1b, zlib1b-dev & libssl-dev for error free compilation.
Compile: $ make
Normally make command will not execute in the shell we have to find the file executes the make command that path (/usr/ccs/bin) should be added in the .profile file also.
Install: switch to root user & then make install
# vi PREFIX/conf/httpd.conf
after that checking the syntax of the httpd.conf file is necessary.
To me main thing in the apache is configuring the httpd.conf file.
for checking we have to execute the following command
$ PREFIX/apache/bin/httpd -t
starting the apache become the root user (as apache is listening in the 80 port) & then run the following command
# PREFIX/apache/bin/apachectl -k start
For checking whether apache is running or not netstat -f inet -an | grep 80 or netstat -an|grep -i lis|grep 80 (in ubuntu) & noticed that *.80 is LISTEN
after that in the browser write http://localhost/ then we can see the index file from htdocs
folder or which is default file written in the configuration file of the apache.
# PREFIX/apache/bin/apachectl -k stop //stopping the apache.