标签:fpm source 部署 rtu 服务器 database dex pcr sts
1、部署分离的LAMP,部署到二台服务器上,php加载xcache模块,并且部署wordpress论坛,并实现正常访问登录论坛。-->2-实现编译安装httpd
1)安装相关的包
yum install gcc prce-devel openssl-devel expat-devel -y
2)编译安装
for i in *.bz2 ;do tar xvf $i;done
mv apr-1.7.0 httpd-2.4.39/srclib/apr
mv apr-util-1.6.1 httpd-2.4.39/srclib/apr-util
useradd -r -s /sbin/nologin apache
cd httpd-2.4.39/ --编译配置
./configure \
--prefix=/app/httpd24 \
--enable-so \
--enable-ssl \
--enable-cgi \
--enable-rewrite \
--with-zlib \
--with-pcre \
--with-included-apr \
--enable-modules=most \
--enable-mpms-shared=all \
--with-mpm=prefork
make -j 2 && make install --编译安装
环境变量和启动
echo ‘PATH=/app/httpd24/bin:$PATH‘ > /etc/profile.d/httpd24.sh
. /etc/profile.d/httpd24.sh
更改配置文件:vim /app/httpd24/conf/httpd.conf
--增加两个策略模块
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
DirectoryIndex index.php index.html
--更改用户
User apache
Group apache
--添加配置
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
ProxyRequests Off
<virtualhost :80>
servername www.a.com
documentroot /data/wordpress
<directory /data/wordpress>
require all granted
</directory>
ProxyPassMatch ^/(..php)$ fcgi://127.0.0.1:9000/data/wordpress/$1
</virtualhost>
mkdir -p /data/wordpress
setfacl -Rm u:apache:rwx /data/wordpress
-->3 实现编译安装php
1) yum install libxml2-devel bzip2-devel libmcrypt-devel
2)
tar xvf php-7.3.7.tar.xz
cd php-7.3.7/
./configure --prefix=/app/php --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-openssl --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --enable-mbstring --enable-xml --enable-sockets --enable-fpm --enable-maintainer-zts --disable-fileinfo
make && make install
3)创建配置文件:
cp php.ini-production /etc/php.ini
cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chmod +x /etc/init.d/php-fpm
cd /app/php/etc
cp php-fpm.conf.default php-fpm.conf
cd php-fpm.d/
cp www.conf.default www.conf
更改配置文件:vim www.conf
user = apache
group = apache
启动:service php-fpm start
-->4-配置wordpress
unzip wordpress-5.4.1-zh_CN.zip
mv wordpress /data/
chown -R root.apache wordpress/
cp wp-config-sample.php wp-config.php
更改配置文件:
vim wp-config.php
service php-fpm restart --重启php-fpm
验证:
2、收集apache访问日志,并实现图形化展示。
-->准备两台机器:
(1) 准备MySQL Server
yum -y install mariadb-server
systemctl start mariadb
GRANT ALL ON Syslog.* TO ‘loguser‘@‘192.168.10.%‘ IDENTIFIED BY ‘centos‘;
(2) 在rsyslog服务器上安装mysql模块相关的程序包
yum install rsyslog-mysql
mysql -uroot < /usr/share/doc/rsyslog-8.24.0/mysql-createDB.sql
(3) 配置rsyslog将日志保存到mysql中: vim /etc/rsyslog.conf
$ModLoad ommysql
-->另一台机器:
(1) 在rsyslog服务器上准备amp或nmp组合
yum install httpd php php-mysql php-gd
?(2) 安装LogAnalyzer
tar xf loganalyzer-4.1.10.tar.gz
cp -a loganalyzer-4.1.10/src /var/www/html/loganalyzer
cd /var/www/html/loganalyzer
touch config.php
chmod 666 config.php
(3)启动httpd和rsyslog,进行验证:
标签:fpm source 部署 rtu 服务器 database dex pcr sts
原文地址:https://blog.51cto.com/14688684/2503082