PHP connection MySQL
[email protected] mysql]# Yum install Php-mysql
CMS: (Open source)
Drupal
Joomla
Compile and install lamp httpd
Installation Order: httpd-->mysql-->php
Version:
httpd:2.4.12
mysql:5.6.10
php:5.4.42
Apr:apache Portable Runtime, is the httpd virtual machine
Apr-util
Apr-iconv
Compile and install the HTTPD software:
# yum -y install pcre-devel #HTTPD的编译环境 # tar xf apr-1.4.6.tar.bz2 #httpd虚拟机apr软件安装 # cd apr-1.4.6# ./configure -- prefix=/usr/local/apr# make# make install# tar xf apr-util-1.4.1.tar.bz2 #apr installation of the-util kit # cd apr-util-1.4.1# ./configure --prefix=/usr/local/ apr-util --with-apr=/usr/local/apr# make# make install# tar xf httpd-2.4.4.tar.bz2# cd httpd-2.4.4./configure --prefix=/usr/local/apache --sysconfdir=/ etc/httpd --enable-so --enable-rewirte --enable-ssl --enable-cgi --enable-cgid - -enable-modules=most --enable-mods-shared=most --enable-mpms-shared=all --enable-deflate - -with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util# make# make install--prefix=/ usr/local/apache #安装Path--sysconfdir=/etc/httpd #配置文件路径--enable-so #支持共享模块--enable-rewirte # Support for URL rewriting--enable-ssl #支持ssl--enable-cgi #进程方式使用cgi--enable-cgid #纯种方式使用cgi--enable-modules= most--enable-mods-shared=most #启用共享模块--enable-mods-static=module-list #静态库, directly compiled into the main program--enable-mpms-shared=all # Multi-channel Processing module (MPM) Support--with-apr=/usr/local/apr--with-apr-util=/usr/local/apr-util -- enable-authn-dbm #启用认证, the default is enabled--enable-deflate #启用网页传输压缩
--enable-mpms-shared=all #多道处理模块 (MPM) support, it should be noted that if the use of Worker,event mode, PHP must be compiled and installed into ZTS format, Prefork mode does not need to compile PHP separately
Configure the installed HTTPD service:
#修改httpd的pid进程文件路径 [[email protected] apache]# vim /etc/httpd/httpd.confPidFile "/var/run/httpd.pid" #需要停用服务, then modify the configuration [[email protected] apache]# ./bin/ apachectl start #启动服务 [[email protected] apache]# ls /var/run/ | grep httpdhttpd.pid# Configuring HTTPD service Management Scripts:vim /etc/rc.d/init.d/httpd#!/bin/bash## httpd startup script for the apache http server## chkconfig: - 85 15# description: apache is a world wide Web server. It is 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/functionsif [ -f /etc/sysconfig/httpd ]; then . /etc/sysconfig/httpdfi# start httpd in the c locale by default. httpd_lang=${httpd_lang-"C"}# this will 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 That some modules may not# work correctly with a thread-based MPM; notably PHP will refuse to start.# Path to the Apachectl script, server binary, and short-form for messages.apachectl=/usr/local/apache/bin/apachectlhttpd=${httpd-/usr/local/apache/bin/httpd}prog= Httpdpidfile=${pidfile-/var/run/httpd.pid}lockfile=${lockfile-/var/lock/subsys/httpd}retval=0start () { 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 10 $ httpdretval=$?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} $ HttpdretVal=$?;; restart) Stopstart;; condrestart) if [ -f ${pidfile} ] ; thenstopstartfi;; reload) reload;; graceful|help|configtest|fullstatus) $apachectl [email protected]RETVAL=$?;; *) echo $ "usage: $prog {start|stop|restart|condrestart|reload|status|fullstatus| Graceful|help|configtest} "exit 1esacexit $RETVAL [[email protected] tmp]# chmod + x /etc/rc.d/init.d/httpd #给服务脚本权限 [[Email protected] tmp]# chkconfig --add httpd #加入服务列表 [[email protected] tmp]# chkconfig --level 2345 httpd on #加入运行启动级别 [[email protected] tmp]# chkconfig -- List | grep httpdhttpd 0:off1:off2:o n3:on4:on5:on6:off# can now use SERVICE HTTPD start the way to manage the HTTPD service # Add the PATH environment variable to execute the HTTP-related command in normal condition [[email protected] ~]# cat /etc/ Profile.d/httpd.sh export path= $PATH:/usr/local/apache/bin
Build a lamp platform