#!/bin/bash
#安装lamp
yum -y install gcc gcc-c++ make
yum -y install apr-devel* cyrus-sasl-devdl* expat-devel* libdb-devel* cyrus-sasl* openldap-devel* apr-util-devel* pcre-devel*
yum -y install zlib-devel*
cd /usr/src && tar xf apr-1.4.6.tar.gz
cd /usr/src && tar xf apr-util-1.5.1.tar.gz
cd /usr/src && tar xf pcre-8.32.tar.gz
cd /usr/src && tar xf httpd-2.4.38.tar.gz
cd /usr/src/apr-1.4.6
./configure --prefix=/usr/local/apr && make && make install
cd /usr/src/apr-util-1.5.1
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr && make && make install
cd /usr/src/apr-pcre-8.32
./configure --prefix=/usr/local/pcre --with-apr=/usr/local/apr && make && make install
cd /usr/src/httpd-2.4.38
./configure --prefix=/usr/local/httpd
–enable-so
–enable-rewrite
–enable-charset-lite
–enable-cgi
&& make && make install
ln -s /usr/local/httpd/bin/* /usr/local/bin
touch /lib/systemd/system/httpd.service
echo "[Unit]
Description=The Apache HTTP Server
After=network.target
[Service]
Type=forking
PIDFile=/usr/local/httpd/logs/httpd.pid
ExecStart=/usr/local/httpd/bin/apachectl
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
RetartSec=42s
[Install]
WantedBy=graphical.targe
">> /lib/systemd/system/httpd.service
systemctl start httpd
systemctl status httpd
yum -y install ncurses-devel autoconf
cd /usr/src/ && tar xf cmake-2.8.6.tar.gz
cd /usr/src/ && tar xf mysql-5.6.36.tar.gz
cd /usr/src/ && tar xf php-5.5.38.tar.gz
cd /usr/src/ && tar xf zend-loader-php5.5-linux-x86_64_update1.tar.gz
cd /usr/src/cmake-2.8.6
./configure && gmake && gmake install
cd /usr/src/mysql-5.6.36 && cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DSYSCONFDIR=/etc -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=all && make && make install
AC=grep mysql /etc/group
if [ KaTeX parse error: Expected 'EOF', got '&' at position 284: …c/mysql-5.6.36 &̲& /usr/local/my…PATH:/usr/local/mysql/bin" >> /etc/profile && . /etc/profile
cp /usr/src/mysql-5.6.36/support-files/mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
chkconfig --add mysqld
systemctl start mysql
systemctl status mysql
yum -y install zlib-devel* libxml2-devel* xz-devel*
cd /usr/src/php-5.5.38
./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/httpd/bin/apxs --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-config-file-path=/usr/local/php5 --enable-mbstring
make && make install
cp /usr/src/php-5.5.38/php.ini-development /usr/local/php5/php.ini
sed -i ‘190adefault_charset = “UTF-8”’ /usr/local/php5/php.ini
echo “zend_extension=/usr/local/php5/lib/php/ZendGuardLoader.so” >> /usr/local/php5/php.ini
echo “zend_loader.enable=1” >> /usr/local/php5/php.ini
cd /usr/local/httpd/conf/ && cp httpd.conf httpd.conf.bak
sed -i ‘260cDirectoryIndex index.php index.html’ /usr/local/httpd/conf/httpd.conf
sed -i ‘398aAddType application/x-httpd-php.php’ /usr/local/httpd/conf/httpd.conf
echo '安装完成