Install and configure apache in Linux

Source: Internet
Author: User
Install and configure apacheubuntu in Linux. initialize the root password sudopasswdroot and enter the password twice. set the root password. 1. obtain the software: http://httpd.apache.org/ Httpd-2.2.21.tar.gz2. installation steps: unzip the source file: 1tarzv .. Linux installation configuration apache ubuntu initialization root password sudo passwd root and then casually enter the password twice, the root password is set up 1. get software: http://httpd.apache.org/ Httpd-2.2.21.tar.gz 2. installation steps: extract the source file: 1 tar zvxf httpd-2.2.21.tar.gz 2 cd httpd-2.2.213. /configure -- prefix =/usr/local/apache2 -- enable-so -- enable-rewrite 4 make5 make install run. the/configure command is used to compile the source code. -- prefix =/usr/local/apach2 is the system directory to which the compilation is installed. the -- enable-s parameter enables the httpd service to dynamically load the module function, -- enable-rewrite enables the httpd service to rewrite webpage addresses. 3. start apache:/usr/local/apache2/bin/apachectl start 4. add apache to the system service and use the service command to control apache startup and stop. First, use the apachectl script as the template to generate the Apache service control script: grep-v "#"/usr/local/apache2/bin/apachectl>/etc/init. d/apache use vi to edit the Apache service control script/etc/init. d/apache: vi/etc/init. d/apache inserts the following line at the beginning of the file to support the chkconfig command :#! /Bin/sh # chkconfig: 2345 85 15 # description: Apache is a World Wide Web server. save and exit the vi editor. run the following command to add the Apache service control script execution permission: chmod + x/etc/init. d/apache: run the following command to add the Apache service to the system service: chkconfig -- add apache: run the following command to check whether the Apache service has taken effect: the chkconfig -- list apache command outputs results similar to the following: apache 0: off 1: off 2: on 3: on 4: on 5: on 6: off indicates that the apache service has taken effect, the running levels 2, 3, 4, and 5 are automatically started with the system startup. in the future, you can use the service command to control Apache startup and stop. Start Apache service: service apache start stop Apache service: service apache stop run the following command to disable automatic startup: chkconfig apache off
Related Article

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.