linux安装php漏洞补丁教
程,LAAPLinux+Apache+Mysql(AliSQ。。。⼀、安装Apache
1.关闭 Selinuxvim /etc/selinux/config
SELINUX=disabled,将 enabled 改为 disabled
2.安装必需组件yum -y install libxml2-devel
yum -y install openssl-devel
yum -y install expat-devel
yum -y install gcc gcc-c++
yum -y install autoconf
yum -y install ncurses-devel
yum -y install unzip
yum -y install curl-devel
yum -y install libpng-devel
yum -y install freetype-devel
yum -y install libxslt-devel
3.安装 apr 和 apr-utilcd /usr/local/src
tar -zxvf apr-1.6.
cd apr-1.6.5/
./configure --prefix=/data/service/apr && make && make install
tar -zxvf apr-util-1.6.
cd apr-util-1.6.1/
./configure --prefix=/data/service/apr-util --with-apr=/data/service/apr && make
&& make install
4.安装zlibtar -zxvf zlib-1.2.
cd zlib-1.2.11/
./configure --prefix=/data/service/zlib && make && make install
5.安装pcretar -zxvf pcre-8.
cd pcre-8.39/
./configure --prefix=/data/service/pcre && make && make install
6.更新openssltar -zxvf openssl-1.1.
cd openssl-1.1.1b /
./config --prefix=/data/service/openssl && make && make install
mv /usr/bin/openssl /usr/bin/openssl.old
ln -s /data/service/openssl/bin/openssl /usr/bin/openssl
ln -s /data/service/openssl/include/openssl /usr/include/openssl
ln -s /data/service/openssl/lib/libssl.so /usr/local/lib64/libssl.so
7.安装Apache (httpd)tar -zxvf httpd-2.4.
cd httpd-2.4.39/./configure --prefix=/data/server/apache --enable-so --enable-rewrite --enable-ssl --
withssl=/usr/bin/openssl --enable-cgi --enable-modules=most --enable-mods-shared=most --enable-mpms-shared=all --with-mpm=event --with-pcre=/data/service/pcre --withz=/data/service/zlib --with-apr=/data/service/apr --with-apr-
util=/data/service/apr-util --enable-expires --enable-deflate && make && make installvim
/data/server/apache/f
修改 ServerName localhost:80cp /data/server/apache/bin/apachectl /etc/rc.d/init.d/httpd
sed -i '1a # chkconfig: 35 85 21' /etc/rc.d/init.d/httpd
sed -i '2a # description: apache 2.4.39' /etc/rc.d/init.d/httpd
service httpd restart
8.开启80端⼝firewall-cmd --zone=public --add-port=80/tcp --permanent
⼆、安装Mysql(AliSQL)
1.安装配置Java环境
2.安装 cmaketar -zxvf cmake-2.8.10.
cd cmake-2.8.10.2mysql下载libs包的网址
./bootstrap ; make ; make install
3.安isontar -zxvf bison-2.
cd bison-2.7
./configure
make -j 8 && make install
4.安装Mysql(AliSQL)数据库
(1)卸载系统⾃带的Mariadbrpm -qa|grep mariadb
rpm -e --nodeps mariadb-libs-5.5.60-1.el7_5.x86_64
(2)创建mysql⽤户组groupadd mysql
(3)创建⼀个⽤户名为mysql的⽤户并加⼊mysql⽤户组useradd -r -g mysql mysql
(4)将下载的压缩包放到/usr/local/src⽬录下并解压unzip AliSQL-master.zip
(5)创建⽬录mkdir -p /data/server/mysql
mkdir -p /data/server/AliSQL-data
(6)编译安装Mysql(AliSQL)cd AliSQL-master/cmake -DCMAKE_INSTALL_PREFIX=/data/server/mysql -
DMYSQL_UNIX_ADDR=/data/server/mysql/mysql.sock -DDEFAULT_CHARSET=utf8 -
DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=gbk,gb2312,utf8,ascii -
DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -
DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DMYSQL_DATADIR=/data/server/AliSQL-data -
DMYSQL_TCP_PORT=3306make
make install
(7)修改Mysql(AliSQL)⽬录所有者和组cd /data/server/mysql/
chown -R mysql:mysqlcd /data/server/AliSQL-data
chown -R mysql:mysql .
(8)初始化 Mysql(AliSQL)数据库cd /data/server/mysql/
scripts/mysql_install_db --user=mysql --datadir=/data/server/AliSQL-data
(9)复制 Mysql(AliSQL) 服务启动配置⽂件cp /data/server/mysql/support-files/my-defaultf /etc/myf
cp support-files/mysql.server /etc/init.d/mysqld
vim /etc/profile
加⼊ PATH=/data/server/mysql/bin:/data/server/mysql/lib:$PATH
source /etc/profile
(10)启动 Mysql(AliSQL) 服务并加⼊开机⾃启动service mysqld start
chkconfig --level 35 mysqld on
(11)配置数据库./bin/mysqladmin -u root password '1234abcd'
mysql -u root -p
(12)关闭防⽕墙systemctl stop firewalld
三、 安装 PHP
(1) 解压 PHP 安装包cd /usr/local/src
tar -zxvf php-7.1.
(2) 以 Apache 的模块安装cd php-7.1.29/./configure --prefix=/data/server/php7 --withapxs2=/data/server/apache/bin/apxs --with-curl --with-freetype-dir --with-gd
--with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --withlibxml-dir --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql - -with-pdo-sqlite --with-pear --with-png-dir --with-xmlrpc --with-xsl --withzlib --enable-fpm --enable-bcmath --enable-libxml --enable-inlineoptimization --enable-gd-native-ttf --enable-mbregex --enable-mbstring --
enable-opcache --enable-pcntl --enable-shmop --enable-soap --enablesockets --enable-sysvsem --enable-xml --enable-zipmake && make install
(3) 配置 php.ini ⽂件cp /usr/local/src/php-7.1.29/php.ini-development /data/server/php7/etc/php.inimysqli.default_socket =/data/server/mysql/mysql.sock
date.timezone = Asia/Shanghai
expose_php = Off
short_open_tag = ON
max_execution_time = 300
max_input_time = 300
memory_limit = 128M
post_max_size = 32M
(4) 关联 PHP 与 Apache 服务① vim /data/server/apache/f
② 在 LoadModule 处添加 LoadModule php7_module modules/libphp7.so
③ 在 DirectoryIndex 后⾯添加:index.php
④ 末尾添加
SetHandler application/x-httpd-php
(5) 修改环境变量vim /etc/profile
在末尾添加:PATH=$PATH:/data/server/php7/bin
export PATH
完成!

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。