Linux installation apache detailed

  

The following is the complete code to install apache under linux, the system is redhat5.5

Download httpd-2.2.6.tar.bz2 put httpd-2.2.6.tar.bz2 Put it under /soft

[root@localhost ~]#cd /soft

[root@localhost soft]#tar jxvf httpd-2.2.6.tar.bz2 //Unzip apache Compressed package

[root@localhost soft]#cd httpd-2.2.6 //Locate under httpd-2.2.6 folder

[root@localhost httpd-2.2.6]# Ls //View the contents of the httpd-2.2.6 folder

[root@localhost httpd-2.2.6]#./configure --help |  More //View installation apache configuration parameters

[root@localhost httpd-2.2.6]#./configure --prefix=/usr/local/apache --enable-so //Configure apache path

[root@localhost httpd-2.2.6]#make //Compile apache

[root@localhost httpd-2.2.6]#make install //Install apache

[ ,null,null,3],Root@localhost httpd-2.2.6]#cd /usr/local/apache //Enter the apache directory

[root@localhost apache]# cd conf/

[root@localhost conf ]#cp -a httpd.conf httpd.conf- //Backup apache configuration file

[root@localhost conf]#chkconfig --list httpd //Check if the httpd service already exists

[root@localhost conf]#chkconfig httpd off //Close the system with httpd service, if there is httpd service

[root@localhost conf]#service httpd status //View the httpd service status< Br>

[root@localhost conf]#/usr/local/apache/bin/apachectl -k start //linux start apache command

[root@localhost conf]#netstat -an |  Grep :80 //Check if linux80 port is enabled

[root@localhost conf]#ps -aux |  Grep httpd //View apache process under linux

[root@localhost conf]#cd ../..

[root@localhost local]#cp /usr/local/apache/bin /apachectl /etc/rc.d/init.d/apache //Copy apache startup script

[root@localhost local]#vi /etc/rc.d/init.d/apache //Here is Edit apache startup script

Add

at the beginning of #!/bin/sh #chkconfig: 2345 85 15

[root@localhost local]#chkconfig -- Add apache //Add apache service

[root@localhost local]#chkconfig --list apache //list apache service

[root@localhost local]#service apache stop //stop Apache service

[root@localhost local]#netstat -an |  Grep :80 //Check if port 80 of linux is closed

[root@localhost local]#ps -aux |  Grep httpd //Check whether there is httpd service, if the original httpd service started will cause the newly added apache service to start failure

[root@localhost local]#service apache start //Start apache service< Br>

Open your server ip address to see if the default home page of tomcat appears, if it appears, then congratulations

apache has been successfully installed under linux

Copyright © Windows knowledge All Rights Reserved