Lamp Forum Architecture One of the trilogy manually compiled and installed Apache

Source: Internet
Author: User

Lamp Forum Architecture One of the trilogy manually compiled and installed Apache

---------------------------------Installation Environment----------------------------------


Lamp Package:

Baidu Network Disk Link: Https://pan.baidu.com/s/1V1hkdGdl9e1Os_aaGMxg7A Password: gca0


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

(pcre: A Perl library that supports regular expressions)

----------------------------------installation-----------------------------------


1. To mount a shared file on a host:

2.

3. Unzip three files

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

Tar xzvf apr-1.4.6.tar.gz-c/opt (supports Apache upper application cross-platform, provides the bottom interface library)

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

4. After the decompression is complete, copy to the/opt/httpd-2.4.2/srclib directory, respectively.

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

(pcre: A Perl library that supports regular expressions)




6. Source Manual configuration file information

./configure \ #源码

--prefix=/usr/local/apache \ #配置文件目标路径

--ENABLE-SO \ #让apache核心装载DSO

--enable-rewrite \ #启用重写功能

--enable-mods-shared=most \ #告诉编译器将所有标准模块都动态编译为DSO模块

--with-mpm=worker \ #让apache以worker方式运行

--disable-cgid \ #禁止用一个外部 CGI daemon execution CGI script

--disable-cgi #禁止编译 CGI version of PHP

7. Input command: make compiles the program into an executable program

8 . Input command: make install

9. Grep-v "#"/usr/local/apache/bin/apachectl >/ETC/INIT.D/HTTPD filter Apache execute file Import into initialization init.d directory with file name httpd

10. vim/etc/init.d/httpd Modify the file to make the file an executable file

Insert the following line at the front of the file

#!/bin/sh

# chkconfig:2345 85 15

# Description:apache is a world Wide Web server.

After entering, press ESC to enter command mode, then press: Enter the last line mode, press Wq to save exit

11. chmod +x/etc/init.d/httpd Add permissions to make the file an executable file

12. Chkconfig--add HTTPd added to the service Management Command Table

Note: Enables programs to use service admin, "service commands for administration are all in /etc/init.d/ in this directory "

if it is rpm command-installed packages do not need to be used Service command management, can be directly executed Service command,

but the manual code compiled software package, the program can not directly execute Service command.

13. Chkconfig--level-httpd on open for use in 3 and 5 modes

Chkconfig--list httpd Show Open list

14. Ln-s/usr/local/apache/conf/httpd.conf/etc/httpd.conf Building Soft links for easy management

15. vim/usr/local/apache/conf/httpd.conf/etc/httpd.conf for file configuration

Find and modify

(1) Listen:ipv4

(2) ServerName: hostname. Domain Name

16. After the modification is complete, press ESC to enter command mode, then press: Enter the last line mode, press Wq to save exit



17. Restart the HTTPD service

18. Apache Basic Build Complete

19. Host opens the Web page to prove the installation is successful

20. Crawl display file content is consistent, if the same proves successful

Manually compile and install Apache successfully!



PS: If the connection is not on, it is likely that your firewall is not shut down, you can try to do the following, and then try to connect

Lamp Forum Architecture One of the trilogy manually compiled and installed 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.