Lamp Compiler Installation HTTPD

Source: Internet
Author: User

Compile and install lamp sequence:

httpd--> mysql--php-->xcache



httpd

Apr--> Apr-util-->httpd


0. Ensure installation Environment

#yum Groupinstall "Development Tools" "Compatibility Libraries"

#yum-y Install pcre-devel openssl-devel



1. Install Apr and Apr-util:

Apr (Apache protable Runtime) and apr-util, can be used in RPM packages or compiled in a way.

#tar-XF httpd-xxx-deps.tar.bz2

#cd HTTPD-XXXX/SRCLIB/APR

#./configure--PREFIX=/USR/LOCAL/APR

#make && make Install


#cd: /apr-util

#./configure--prefix=/usr/local/apr-util--WITH-APR=/USR/LOCAL/APR

#make && make Install



2. Installing httpd

#tar-XF httpd-xxx.tar.bz2

#cd httpd-xxx

#./configure--prefix=/usr/local/httpdxx--sysconfdir=/etc/httpd--enable-so--enable-ssl--enable-cgi-- Enable-rewrite--with-z--with-pcre--enable-modules=most--enable-mpms-shared=all--with-mpm=event--with-apr=/usr/ LOCAL/APR--with-apr-util=/usr/local/apr-util

#make

#make Install


Compile options:

--PREFIX=/USR/LOCAL/HTTPD specifying the file installation path

--SYSCONFDIR=/ETC/HTTPD specifying the configuration file directory

--enable-so Enable module

--enable-ssl The SSL feature is enabled, the Openssl-devel package is required.


--enable-deflate the default file compression mechanism. Zlib-devel package is required.


--enable-modules=most

Enable the module with the option to have Moulde-list|all|most|few|reallyall


--enable-mods-shared=most

Enable the module in a shared way with the option to Moulde-list|all|most|few|reallyall


--eanble-mods-static=most

Options have moulde-list|all|most|few|reallyall to statically enable the module, which is compiled into httpd.


--enable-proxy enabling the HTTPD proxy module


--ENABLE-PROXY-FCGI allows httpd and PHP to work in fastcgi mode


--enable-mpms-shared=all

Options available are mpm-list|all. Using Mpm,prefork mode in a shared modular manner without compiling PHP, if it is a worker or an event, PHP needs to be compiled into ZTS format.


--with-mpm=event

EVENT|WORKER|PREFORK|WINNT Specifies that a MPM is used by default, and the event mode is not specified by default.


--enable-rewrite Support for URL rewriting


--enable-cgi

Enables CGI scripts to be used by non-threaded MPM, prefork.


--enable-cgid

Enables CGI scripts to be used by the thread mpm. Worker and event mode.


--WITH-APR=/USR/LOCAL/APR Specify the installation location for Apr


--WIHT-APR-UTIL=/USR/LOCAL/APR-UTIL Specifies the installation location of the Apr-util.



--WITH-Z=DIR Specifies the location of the Zlib library and does not specify that it will be searched automatically. Zlib-devel package is required.



3. Create a soft link to facilitate multiple versions coexistence:

#ln-sv/usr/local/httpdxx/usr/local/httpd


Note: In the case of multiple versions coexistence, it is recommended to modify the path in the configuration file to create a soft link. This allows you to simply re-create the soft link when switching versions.




4. Export header file and man document path

#ln-sv/usr/local/httpd/include//usr/include/httpd


#vim/etc/man_db.conf

Mandatory_manpath/usr/local/httpd/man


5. Add a service script:

#cp/usr/local/httpd/bin/apachectl/etc/init.d/httpd

#vim/etc/init.d/httpd

: 1, $s/httpdxx/httpd/g

#sed-i ' 2a # chkconfig:-/ETC/INIT.D/HTTPD

#sed-i ' 3a # Description:apache is a world Wide Web server. It's used to server '/ETC/INIT.D/HTTPD

#chmod 755/etc/rc.d/init.d/httpd


6. Add Environment variables:

#vim/etc/profile.d/httpd.sh

Export path= $PAHT:/usr/local/httpd/bin


7. Modify the configuration file:

#vim/etc/httpd/httpd.conf

: 1, $s/httpdxx/httpd/g


8. Start httpd

#systemctl Start httpd


Or

#chkconfig--add httpd

#chkconfig--level 2345 httpd on

#service httpd Start

#netstat-TNLP |grep httpd Verify that port 80 is open




Build the directory after compiling the installation:

/usr/local/httpdxx/

Bin Level Two Program

The directory used when build compiles

Cgi-bin CGI Program

Error message

Htdocs Web File storage location

Icons icon

Include header file location

Logs log file location

Mans Man File

Manual Handbook

Modules Module

Conf default configuration file location


directory where the/etc/httpd/configuration file resides

Extra additional configuration files

httpd-vhosts.conf Virtual Host Parameters

Httpd-ssl.conf parameters related to SSL

Httpd-mpm.conf defining different PMP working parameters


This article is from "Small Private blog" blog, please be sure to keep this source http://ggvylf.blog.51cto.com/784661/1654510

Lamp Compiler Installation HTTPD

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.