Yum Installation
Installation:
Yum-y Install httpd
Configuration file:
/etc/httpd/conf/httpd.conf
And
Under All files ending with. conf
Service Control:
Systemctl Start|restart|stop|reload httpd
Site Web page document root directory:
/var/www/html
Module file path:
/usr/lib64/httpd/modules
Main Program Files:
/usr/sbin/httpd
Main process file:
/run/httpd/httpd.pid
Log file directory:
/var/log/httpd
Offline Help documentation Package:
Yum-y Install Httpd-manual
After restarting the service, you can enter it in the browser. http://IP/manual/
Compiling the installation
System Environment: CentOS6.9
ARP version: 1.6# wget http://mirror.bit.edu.cn/apache//apr/apr-1.6.3.tar.gz
Arp-util Version: 1.6# wget http://mirror.bit.edu.cn/apache//apr/apr-util-1.6.1.tar.gz
HTTPD version: 2.4# wget http://mirrors.shu.edu.cn/apache//httpd/httpd-2.4.33.tar.gz
? 1) Install the required packages
~]# yum-y Groupinstall "Development tools" ~]# yum-y install Openssl-devel expat-devel pcre-devel
? 2) Configuring the compilation Installation
~]# tar xf apr-1.6.3.tar.gz~]# tar xf apr-util-1.6.1.tar.gz~]# tar xf httpd-2.4.33.tar.gz~]# cp-a apr-util-1.6.1 httpd-2. 4.33/srclib/apr-util~]# cp-a apr-1.6.3 httpd-2.4.33/srclib/apr~]# cd httpd-2.4.33httpd-2.4.33]#./configure--prefix= /data/httpd24 --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib -- With-pcre --with-included-apr --enable-modules=most --enable-mpms-shared=all --with-mpm= preforkhttpd-2.4.33]# make-j 4 && make install
? 3) Configure Environment variables
~]# Echo ' export path=/data/httpd24/bin: $PATH ' >/etc/profile.d/httpd.sh~]# echo ' Manpath/data/httpd24/man ' > >/etc/man.config
~]# source/etc/profile.d/httpd.sh~]# Source/etc/man.config
4) Start the service and test
~]# Apachectl Start
Apache httpd Service--Installation