Manually compile and install Apache

Source: Internet
Author: User
Tags server website

Apache Web server: As the front end of the lamp architecture, it is a powerful and stable Web server program that provides website access directly to users, sending Web pages, images and other file contents.

Experimental requirements:

Manually compile and install the Apache server so that the host can access the built Apache server website

Lab Environment:

First, the required package

Http-2.4.2.tar.gz

Apr-1.4.6.tar.gz

Apr-util-1.4.1.tar.gz

Ii. Main directories and documents

Home Store Path:? /usr/local/apache/htdocs/index.html

Master configuration file path:/usr/local/apache/conf/httpd.conf

Service Script path:/usr/local/apache/bin/apachectl

Experimental steps:

First, download the installation environment package

Mount.cifs//192.168.100.102/GONGXIANG/ABC
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
Cp-r? Apr (unpacked folder)/OPT/HTTPD-2.4.2/SRCLIB/APR
Cp-r? Apr-util (unzipped folder)/opt/httpd-2.4.2/srclib/apr-util

Second, install the decoder

Installing GCC, gcc-c++? , make? , Pcre, Pcre-devel four packs
(pcre: A Perl library that supports regular expressions)

Third, install the package

cd/opt/httpd-2.4.2

./configure \
--prefix=/usr/local/apache \????????????? #指定安装路径
--ENABLE-SO \??????????????????????????? ? #让 Apache can support DSO mode
--enable-rewrite \?????????????????? ? #支持 URL Rewriting
--enable-mods-shared=most \???? ?? #告诉编译器将所有标准模块都动态编译为DSO模块
--with-mpm=worker \???????????????????? # Let Apache run in worker mode
--disable-cgid \??????????????????????????????? # Prohibit execution of CGI scripts with an external CGI daemon
--disable-cgi?????????????????????????????????? # Disable compiling CGI versions of PHP

Make
Make install

Four, optimize the httpd boot automatic loading service

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

VI/ETC/INIT.D/HTTPD Insert the following line at the front of the file

#!/bin/sh
???? # chkconfig:2345 85 15
???? # Description:apache is a world Wide Web server.chmod +x/etc/init.d/httpd
Chkconfig--add httpd
Chkconfig--list httpd
Chkconfig--level httpd on

V. Modify the HTTPD configuration file

Establish a soft connection for easy management
Ln-s/usr/local/apache/conf/httpd.conf/etc/httpd.conf (Note: A soft connection uses an absolute path)

Vim/etc/httpd.conf

Listen:ipv4
ServerName: hostname. Domain Name

Service httpd Stop

Service httpd Start


Experimental content:

First, download the installation environment package

Second, install the decoder

Third, install the package

Four, optimize the httpd boot automatic loading service

V. Modify the HTTPD configuration file





















Manually compile and install Apache

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.