How to install Apache in Linux

Source: Internet
Author: User

How to install Apache in Linux
Source: China data time: 21:19:00 popularity: 5208
Abstract: many of my friends have a headache in getting started with Linux. I have no idea how to install the source code package. The source code package is configured, compiled, and installed. Finally, the configuration after installation is complete, the following describes how to install Apache in Linux.
 
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.

This article by the Chinese data (www.zgsj.com) -- http://zhidao.zgsj.com original, reproduced please keep this sentence

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.