First, the preparatory work
Turn off the firewall, SELinux, configure the Yum source, and remove the httpd,mysql,php that the system has installed
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/45/C5/wKiom1PrELvhQC2ZAAM-fNhJrDI080.jpg "title=" 1.png " alt= "Wkiom1prelvhqc2zaam-fnhjrdi080.jpg"/>
Second, install Apache
TTPD-2.4.10 requires a newer version of APR and Apr-util, so it needs to be upgraded beforehand. There are two ways to upgrade, one is to compile the installation through source code, and the other is to upgrade the RPM package directly. The demo is compiled here using source code.
1. Install Apr
[Email protected]/]# tar XF apr-1.5.1.tar.bz2-c/usr/src/
[Email protected]/]# CD/USR/SRC/APR-1.5.1/
[Email protected] apr-1.5.1]#/configure--PREFIX=/USR/LOCAL/APR
[[email protected] apr-1.5.1]# make && make install
2, Installation Apr-util
[Email protected]/]# tar XF apr-util-1.5.3.tar.bz2-c/usr/src/
[Email protected]/]# cd/usr/src/apr-util-1.5.3/
[Email protected] apr-util-1.5.3]#/configure--prefix=/usr/local/apr-util
--with-apr=/usr/local/apr/
[[email protected] apr-util-1.5.3]# make && make install
3, installation httpd
[Email protected]/]# tar XF httpd-2.4.10.tar.bz2-c/usr/src/
[Email protected]/]# cd/usr/src/httpd-2.4.10/
[Email protected] httpd-2.4.10]#/configure--prefix=/usr/local/apache
--sysconfdir=/etc/httpd24--enable-so--enable-ssl--enable-cgi
--enable-rewrite--with-zlib--with-pcre--WITH-APR=/USR/LOCAL/APR
--with-apr-util=/usr/local/apr-util--enable-modules=most
--enable-mpms-shared=all--with-mpm=event
[[email protected] httpd-2.4.10]# make && make install
Add:
(1) Constructing MPM as static module
In all platforms, MPM can be built as a static module. Select a mpm at build time, linked to the server. If you want to change MPM, you must rebuild it. In order to use the specified MPM, use the parameter--with-mpm=name when executing the Configure script. Name is the specified MPM name. After the compilation is complete, you can use./httpd-l to determine the selected MPM. This command lists all modules that are compiled into the server program, including MPM.
(2) Build MPM as dynamic module
In UNIX or similar platforms, MPM can be built as a dynamic module and loaded at run time as with other dynamic modules. Building MPM as a dynamic module allows you to change the MPM by modifying the contents of the LoadModule directive without rebuilding the server program. Use the--enable-mpms-shared option to enable this feature when you execute a configure script. All MPM modules supported by this platform will be installed when the given parameter is all. You can also give a list of modules in the parameters. The default MPM, which can be automatically selected or specified by the--WITH-MPM option when the Configure script is executed, then appears in the generated server configuration file. Edit the loadmodule instruction content to select a different mpm.
4. Modify the main configuration file of httpd and set its PID file path
[Email protected] ~]# vim/etc/httpd24/httpd.conf
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/45/C8/wKioL1PrJAPA3XSiAAC8lcYgSlE895.jpg "title=" 2.png " alt= "Wkiol1prjapa3xsiaac8lcygsle895.jpg"/>
Providing service scripts
[Email protected] ~]# VIM/ETC/RC.D/INIT.D/HTTPD24
#!/bin/bash
#
# httpd Startup script for the Apache HTTP Server
#
# Chkconfig:-85 15
# Description:apache is a world Wide Web server. It's used to serve \
# HTML files and CGI.
# PROCESSNAME:HTTPD
# config:/etc/httpd/conf/httpd.conf
# config:/etc/sysconfig/httpd
# Pidfile:/var/run/httpd.pid
# Source function library.
. /etc/rc.d/init.d/functions
if [-F/ETC/SYSCONFIG/HTTPD]; Then
. /etc/sysconfig/httpd
Fi
# Start httpd in the C locale by default.
httpd_lang=${httpd_lang-"C"}
# This would prevent Initlog from swallowing up a pass-phrase prompt if
# Mod_ssl needs a pass-phrase from the user.
Initlog_args= ""
# Set Httpd=/usr/sbin/httpd.worker in/etc/sysconfig/httpd to use a server
# with the thread-based "worker" MPM; Be warned this some modules may not
# work correctly with a thread-based MPM; Notably PHP would refuse to start.
# Path to the Apachectl script, server binary, and short-form for messages.
Apachectl=/usr/local/apache/bin/apachectl
HTTPD=${HTTPD-/USR/LOCAL/APACHE/BIN/HTTPD}
Prog=httpd
Pidfile=${pidfile-/var/run/httpd.pid}
LOCKFILE=${LOCKFILE-/VAR/LOCK/SUBSYS/HTTPD}
Retval=0
Start () {
Echo-n $ "Starting $prog:"
lang= $HTTPD _lang Daemon--pidfile=${pidfile} $httpd $OPTIONS
Retval=$?
Echo
[$RETVAL = 0] && Touch ${lockfile}
Return $RETVAL
}
Stop () {
Echo-n $ "Stopping $prog:"
Killproc-p ${pidfile}-D $httpd
Retval=$?
Echo
[$RETVAL = 0] && rm-f ${lockfile} ${pidfile}
}
Reload () {
Echo-n $ "Reloading $prog:"
if! lang= $HTTPD _lang $httpd $OPTIONS-T >&/dev/null; Then
Retval=$?
echo $ "not reloading due to configuration syntax error"
Failure $ "not reloading $HTTPD due to configuration syntax error"
Else
Killproc-p ${pidfile} $httpd-hup
Retval=$?
Fi
Echo
}
# See how we were called.
Case "$" in
Start
Start
;;
Stop
Stop
;;
Status
Status-p ${pidfile} $httpd
Retval=$?
;;
Restart
Stop
Start
;;
Condrestart)
If [-f ${pidfile}]; Then
Stop
Start
Fi
;;
Reload
Reload
;;
Graceful|help|configtest|fullstatus)
$apachectl [email protected]
Retval=$?
;;
*)
echo $ "Usage: $prog {start|stop|restart|condrestart|reload|status|fullstatus|graceful|help|configtest}"
Exit 1
Esac
Exit $RETVAL
Empower and turn on service testing
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/45/C7/wKiom1PrJKiQ42R5AAGqCib8reQ862.jpg "title=" 3.png " alt= "Wkiom1prjkiq42r5aagqcib8req862.jpg"/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/45/C7/wKiom1PrJd7iG0SUAAC2PU-9DNM566.jpg "title=" 4.png " alt= "Wkiom1prjd7ig0suaac2pu-9dnm566.jpg"/>
Third, install MySQL on the CENTOS7
This article is from the "Broken Saber" blog, please be sure to keep this source http://90sec.blog.51cto.com/7404127/1539510