Apache Installation In Solaris| How To Install Apache In Solaris

Download the source file of apache installing in solaris , it will be .gz extension.
Now let’s uncompress that archive using gunzip and tar. You should replace the httpd-
2.0.36.tar.gz below with the name of the gzip’d file you downloaded.
gunzip < httpd-2.0.36.tar.gz | tar xvf –
You should end up with an httpd-2.0.x directory, x being the particular sub-version of Apache you downloaded. Move into the newly created directory.
cd httpd-2.0.x
Now we’ll use the the configure and make commands to configure, make, and install Apache.
$ ./configure
The above command makes the shell run the script named ‘ configure ‘ which exists in the current directory. The configure script basically consists of many lines which are used to check some details about the machine on which the software is going to be installed. This script checks for lots of dependencies on your system. For the particular software to work properly, it may be requiring a lot of things to be existing on your machine already. When you run the configure script you would see a lot of output on the screen , each being some sort of question and a respective yes/no as the reply. If any of the major requirements are missing on your system, the configure script would exit and you cannot proceed with the installation, until you get those required things.
The main job of the configure script is to create a ‘ Makefile ‘ .
$ make

make ‘ is actually a utility which exists on almost all Unix systems. For make utility to work it requires a file named Makefile in the same directory in which you run make. The configure script’s main job was to create a file named Makefile to be used with make utility. (Sometimes the Makefile is named as makefile also)
make would use the directions present in the Makefile and proceed with the installation. The Makefile indicates the sequence, that Linux must follow to build various components / sub-programs of your software. The sequence depends on the way the software is designed as well as many other factors.
The Makefile actually has a lot of labels (sort of names for different sections). Hence depending on what needs to be done the control would be passed to the different sections within the Makefile Or it is possible that at the end of one of the section there is a command to go to some next section.
Basically the make utility compiles all your program code and creates the executables. For particular section of the program to complete might require some other part of the code already ready, this is what the Makefile does. It sets the sequence for the events so that your program does not complain about missing dependencies.
One of the labels present in the Makefile happens to be named ‘ install ‘ .
If make ran successfully then you are almost done with the installation. Only the last step remains which is
$ make install

As indicated before make uses the file named Makefile in the same directory. When you run make without any parameters, the instruction in the Makefile begin executing from the start and as per the rules defined within the Makefile (particular sections of the code may execute after one another..thats why labels are used..to jump from one section to another). But when you run make with install as the parameter, the make utility searches for a label named install within the Makefile, and executes only that section of the Makefile.
The install section happens to be only a part where the executables and other required files created during the last step (i.e. make) are copied into the required final directories on your machine. E.g. the executable that the user runs may be copied to the /usr/local/bin so that all users are able to run the software. Similarly all the other files are also copied to the standard directories in Linux. Remember that when you ran make, all the executables were created in the temporary directory where you had unzipped your original tarball. So when you run make install, these executables are copied to the final directories.
$./configure –prefix=/apache_home_path
Your screen should look something like:
$ ./configure –PREFIX==/root/apache2
checking for chosen layout… Apache
checking for working mkdir -p… yes
checking build system type… i686-pc-linux-gnu
checking host system type… i686-pc-linux-gnu
checking target system type… i686-pc-linux-gnu
Configuring Apache Portable Runtime library …
config.status: executing default commands
Unless errors were reported (not warnings), your Apache installation is now configured and we can move on.
Making Apache produces screen full of Output. Your screen should look something like:
$ make
Making all in srclib
make[1]: Entering directory `/home/ryan/dl/apache_guide/httpd-
2.0.36/srclib’
Making all in apr
make[2]: Entering directory `/home/ryan/dl/apache_guide/httpd-
2.0.36/srclib/apr’

make[1]: Leaving directory `/home
Finally, you’re ready to install your Apache build.
$ make install
Now Apache is installed.
Testing Apache:
Go to apache home directory , for example if your apache_home is /root/apache2/
$ cd /root/apache2/bin
To check the syntax of your httpd.conf use the below command..
$ ./apachectl –t
If syntax is ok , the output would be “ Syntax is OK”.
Now start the apache instance using below command..
$ ./apachectl –k start
Test using http://hostip:port/
Output would be “ It Works”.