# Apache
version:2.4 source code
yum -y install apr* gcc-c++ make pcre-devel zlib-devel
tar -xvf httpd-2.4.37.tar.gz
cd httpd-2.4.37
./configure --prefix=/usr/local/httpd --enable-so --enable-cgi --enable-rewrite --enable-charset-lite --enable-deflate && make && make install
cp /usr/local/httpd/bin/apachectl /etc/init.d/httpd
sed -i -e '2s/#/#chkconfig: 2345 85 32/' /etc/init.d/httpd
chkconfig httpd on
sed -i -e 's/#ServerName/ServerName/' httpd.conf
/etc/init.d/httpd start
ln -s /usr/local/httpd/bin/* /usr/local/bin
# Php
version:7.2 source code
yum -y install gd gd-devel libpng libpng-devel libjepg libjepg-devel mysql-devel gcc gcc-c++ autoconf httpd-manual mod_perl mod_auth_mysql httpd
mysql-connector-odbc libdbi-dbd-mysql net-snmp-devel curl-devel unixODBC-devel java-devel openldap openldap-devel ncurses-devel httpd-devel
libxml2-devel
tar -xvf php-7.2.11.tar.gz
cd php-7.2.11
./configure --prefix=/usr/local/php7 --with-apxs2=/usr/bin/apxs --with-pdo-mysql=/usr/bin/mysql --with-openssl --enable-sockets --enable-sysvshm
--with-mysqli=/usr/bin/mysql_config --enable-mbstring --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib-dir --with-libxml-dir=/usr
--enable-xml --with-mhash --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-curl --with-gd --with-gettext --enable-bcmath --enable-opcache
make && make install
cd /root/php-7.2.11/php.ini-production /etc/php.ini
vim /etc/httpd/conf/httpd.conf
<IfModule dir_module>
DirectoryIndex index.html index.php #添加index.php
</IfModule>
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php #添加这一句
# Mysql
version:5.7 yum
yum -y install mysql-community-server