Monday, December 20, 2010

Installation of Apache, PostgreSQL and PHP in Linux

Installation steps for PostgreSQL:
            Step 1: Open the konsole, go to directory as ---> cd/usr/local/src
            Step 2: Then extract tar file using following command,
                            Eg:  $usr/local/src> tar -xvjf home/postgresql-8.3.5.tar.bz2
            Step 3: Now Change the directory as,
                            Eg:  $usr/local/src>  cd postgresql-8.3.5/
            Stpe 4: Then configure the postgresql using
                            Eg:  $usr/local/src/postgresql-8.3.5>  . /configure
            Step 5: Then build a program from its source, give command as
                            Eg:  $usr/local/src/postgresql-8.3.5>  gmake
            Step 6: Then install the directory
                            Eg:  $usr/local/src/postgresql-8.3.5>  gmake install
            Step 7: Now Postgresql installed successfully.
            Step 8: Then add new user as ---->  useradd -M postgres
            Step 9: Then add the group as ---->  groupadd postgres
            Step 10: Then add another group as ---->  groupadd apache
            Step 11: Then add another user as ---->  useradd -M -g apache apache
            Step 12: Then create new directories as ---->  mkdir /usr/local/pgsql/data
            Step 13:Then change the owner as --->  chown postgres:postgres /usr/local/pgsql/data
            Step 14: Then set the Data directories,
                             su -c '/usr/local/pgsql/bin/initdb -D  /usr/local/pgsql/data' postgres
            Step 15: Then set postmaster directories,
                         su -c '/usr/local/pgsql/bin/postmaster -D  /usr/local/pgsql/data >logfile 2>&1&'  postgres
            Step 16: Then give the super user permission,
                             su -c '/usr/local/pgsql/bin/createuser USER NAME' postgres
            Step 17: Copy the start-script directories into init.d/postgresql directories,
                             cp contrib/start-scripts/linux   /etc/init.d/postgresql
            Step 18: Change the access mode of a file as,
                             chmod a+x /etc/init.d/postgresql
            Step 19: Change the access mode of a file as,
                             chmod a+x /usr/local/pgsql/bin/reindexdb
            Step 20: Then change directories as,
                              cd /etc/init.d
            Step 21: And give following commands to configure the postgresql,
                             chkconfig --add postgresql
                             chkconfig postgresql on
                             /etc/init.d/postgresql start
            Step 22: Then give profile path in bottom of .profile file,
                             # cd /home$ vi .profile
                             # PATH=/usr/local/pgsql/bin:$PATH:$HOME
            Step 23: Then Postgresql Installation Completed

Installation steps for Apache server:
            Step 1: Open the konsole, go to directory as --->  cd /usr/local/src
            Step 2: Then convert zip file into tar file using following command,
                             Eg:  $usr/local/src>  tar -xvzf /home/apache_1.3.31.tar.gz
            Step 3: Then change the directories as,
                             Eg:  $usr/local/src>  cd apache_1.3.31/
            Step 4: Then make configure apache as,
                             Eg:  $usr/local/src/apache_1.3.31>  . /configure –enable-module=so
            Step 5: Then build a program from its source, give command as,
                             Eg:  $usr/local/src/apache_1.3.31>  gmake
            Step6: Then make installation in current directories as,
                             Eg:  $usr/local/src/apache_1.3.31>  gmake install
            Step 7: Then, Apache Installation Completed

Installation steps for PHP:
            Step 1: Open the konsole, go to directory as --->  cd /usr/local/src
            Step 2: Then extract tar file into current directories, give following command as,
                      Eg:  $usr/local/src>  tar -xvjf /home/php-5.2.5.tar.bz2
            Step 3: Change the directories as,
                            Eg:  $usr/local/src>  cd php-5.2.5/
            Step 4: Then configure current directories using following command as,
                            Eg:  $usr/local/src/php-5.2.5>  ./configure --with-pgsql –with-apxs2 =/usr/local/apache2/bin/apxs    
            Step 5: Then build a program from its source, give command as,
                            Eg:  $usr/local/src/php-5.2.5>  gmake
            Step 6: Then make installation current directories
                            Eg:  $usr/local/src/php-5.2.5>  gmake install
            Step 7: Then, PHP Installation Completed.

After installing the Apache and PHP, steps to start the Apache server:
            Step 1: Copy the httpd file from apache directories, and paste into /etc/init.d/
                            cp /usr/local/apache2/bin/httpd   /etc/init.d/
            Step 2: Then change directories as,
                            cd /etc/init.d
                            chkconfig --add httpd
                            chkconfig httpd on
                            /etc/init.d/httpd start
            Step 3:  Create the new php file as following line,
                             <?
                                 phpinfo();
                             ?>

                            and saved as phpinfo.php into this following directory /usr/local/apache2/htdocs
              Step 4: Installation process is successfully completed.

No comments:

Post a Comment