The following is the complete installation of apache linux code, the system is redhat55 download httpd-226tarbz2 put the httpd-226tarbz2 under soft [root @ localhost ~] Cdsoft [root @ localhostsoft] tarjxvfhttpd-226tar
The following is the complete code for installing apache in linux. The system is redhat5.5.
Download httpd-2.2.6.tar.bz2 and put httpd-2.2.6.tar.bz2 under/soft.
[Root @ localhost ~] # Cd/soft
[Root @ localhost soft] # tar jxvf httpd-2.2.6.tar.bz2 // decompress apache's compressed package
[Root @ localhost soft] # cd httpd-2.2.6 // locate under the httpd-2.2.6 folder
[Root @ localhost httpd-2.2.6] # ls // view display contents under the httpd-2.2.6 folder
[Root @ localhost httpd-2.2.6] #./configure -- help | more // view apache installation configuration parameters
[Root @ localhost httpd-2.2.6] #./configure -- prefix =/usr/local/apache -- enable-so // configure the apache path
[Root @ localhost httpd-2.2.6] # make // compile apache
[Root @ localhost httpd-2.2.6] # make install // install apache
[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-// back up the apache configuration file
[Root @ localhost conf] # chkconfig -- list httpd // check whether the httpd service already exists
[Root @ localhost conf] # chkconfig httpd off // disable the httpd service that comes with the system. if the httpd service exists
[Root @ localhost conf] # service httpd status // view the built-in httpd service status
[Root @ localhost conf] #/usr/local/apache/bin/apachectl-k start // start apache command in linux
[Root @ localhost conf] # netstat-an | grep: 80 // check whether Port linux80 is enabled
[Root @ localhost conf] # ps-aux | grep httpd // view the apache process in 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 // edit the apache startup script.
Starting #! Add
# Chkconfig: 2345 85 15
[Root @ localhost local] # chkconfig -- add apache // add apache service
[Root @ localhost local] # chkconfig -- list apache // list apache services
[Root @ localhost local] # service apache stop // stop the apache service
[Root @ localhost local] # netstat-an | grep: 80 // check whether Port 80 of linux is disabled
[Root @ localhost local] # ps-aux | grep httpd // check whether the httpd service exists. if the built-in httpd service is started, the newly added apache service fails to be started.
[Root @ localhost local] # service apache start // start the apache service
Open your server IP address and check whether the default homepage of tomcat appears. if so, congratulations.
Apache is successfully installed in linux.