Install Apache manually under Linux environment

Source: Internet
Author: User

Manually compile and install Apache Lab Preparation: 1.VMwore 12 Red Hat 6.5 virtual machine one 2. Related packages: Apr, apr-util, httpd Note: Apache official website Download http://www.apache.org/ Download the required packages for the experiment and extract them to the specified folder

``

I. Apache installation 1. First unpack the package HTTP, Apr, apr-util (support Apache Upper application cross-platform, provide the underlying interface library) to the/OPT directory

Tar xzvf http-2.4.2.tar.gz-c/opt

Tar xzvf apr-1.4.6.tar.gz-c/opt
(Support Apache Upper application cross-platform, provide the bottom interface library)

Tar xzvf apr-util-1.4.1.tar.gz-c/opt

2. Go to the package directory and copy the APR and Apr-util packets to the HTTPD directory

Cp-r APR/OPT/HTTPD-2.4.2/SRCLIB/APR

Cp-r Apr-util/opt/httpd-2.4.2/srclib/apr-util

3. Installation of GCC, gcc-c++, make, Pcre, pcre-devel four packs

Yum install gcc gcc-c++ make pcre pcre-devel-y

4. Enter the HTTPD directory and configure the Configure

cd/opt/httpd-2.4.2

5. Configuration

./configure \
--prefix=/usr/local/apache \
--ENABLE-SO \
--enable-rewrite \
--enable-mods-shared=most \
--with-mpm=worker \
--disable-cgid \
--disable-cgi

6. Compiling and installing

Make && make install

7. Filter out the comment lines (#) and copy the httpd service file to/etc/init.d/

Grep-v "#"/usr/local/apache/bin/apachectl >/ETC/INIT.D/HTTPD

8. Modify the configuration file vim/etc/init.d/httpd insert the following line at the bottom of the article

#!/bin/sh

chkconfig:2345 15description:apache is a world Wide Web server
9. Add execute permissions to the httpd file

chmod +x/etc/init.d/httpd

10. Add the HTTDP service, set to Init3, init5 to boot from.

Chkconfig--add httpd
Chkconfig--list httpd
Chkconfig--level httpd on

11. Create soft links for/etc/httpd.conf files for post-management purposes

Ln-s/usr/local/apache/conf/httpd.conf/etc/httpd.conf

12. Modify the configuration file httpd.conf
vim/etc/httpd.conf

Listen: #监听IP地址, modify this to your local IP address.

ServerName: hostname. Domain Name

13. Restart the httpd service

Service httpd Shop

Service httpd Start

14. Turn off the firewall

Service Iptables Stop

Setenforce 0

Final Test if the interface shows that Apache has been installed successfully, and the Home store path is/usr/local/apache/htdocs/index.html can edit this file to modify the content on the home page

Install Apache manually under Linux environment

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.