17、实现LAMP安装wordpress以及日志的收集

1、部署分离的LAMP,部署到二台服务器上,php加载xcache模块

1、两台主机 
A:192.168.44.128	安装http,php,xcache
B:192.168.44.130	安装mariadb
2、安装http,php,xcache
[root@C76 ~]# yum  install httpd php php-devel php-mysql gcc -y
3、下载xcache并安装
[root@C76 ~]# wget http://xcache.lighttpd.net/pub/Releases/3.1.2/xcache-3.1.2.tar.gz
[root@C76 ~]# tar -xvf xcache-3.1.2.tar.gz
[root@C76 ~]# cd xcache-3.1.2/
[root@C76 xcache-3.1.2]# phpize
[root@C76 xcache-3.1.2]#  ./configure --enable-xcache
[root@C76 xcache-3.1.2]# make && make install
[root@C76 xcache-3.1.2]# systemctl restart httpd

2、部署wordpress论坛,并实现正常访问登录论坛。

1、#先下载好maridb10.4,apr-1.7,apr until-1.6,wordpress-5.4并编译安装好
解压缩WordPress博客程序到网页站点目录下
unzip wordpress-5.0.3-zh_CN.zip
修改配置文件
// ** MySQL 设置 - 具体信息来自您正在使用的主机 ** //
/** WordPress数据库的名称 */
define('DB_NAME', 'wpdb');
/** MySQL数据库用户名 */
define('DB_USER', 'wpuser');
/** MySQL数据库密码 */
define('DB_PASSWORD', 'redhat');
/** MySQL主机 */
define('DB_HOST', '192.168.44.128')
4、安装mariadb新建wpdb库和wpuser用户
[root@C76 ~]# yum install mariadb-server -y
[root@C76 ~]# systemctl start mariadb  #启动服务
MariaDB [(none)]> create database wpdb;
MariaDB [(none)]> grant all privileges on wpdb.* to wpuser@'%' identified by
"redhat";
MariaDB [(none)]> grant all on wpdb.* to wpuser@'192.168.44.%' identified by 'redhat';
MariaDB [(none)]> flush privileges;   #刷新表
3、打开http://webserver/wordpress进行页面安装
注意wordpress目录权限
Setfacl –R –m u:apache:rwx wordpress

3、收集apache访问日志,并实现图形化展示

1、安装LAMP环境
[root@C76 ~]# yum  install httpd php php-mysql rsyslog-mysql mariadb-server -y
2、安装并导入数据库
[root@C76 ~]# yum install mariadb-server -y
[root@C76 ~]# systemctl start mariadb  #启动服务
[root@C76 ~]#  mysql < /usr/share/doc/rsyslog-8.24.0/mysql-createDB.sql
MariaDB [(none)]> grant all on Syslog.* to syslog@'192.168.4.%' identified by "redhat";
MariaDB [(none)]> flush privileges;
3、修改配置文件
[root@C76 ~]# vim /etc/httpd/conf/httpd.conf
# CustomLog "logs/access_log" combined
  CustomLog "| /usr/bin/logger -p local6.info" combined
[root@C76 ~]# vim /etc/rsyslog.conf
#添加
#### MODULES ####
$ModLoad ommysql
#添加
#### RULES ####
local6.*
4、重启服务
[root@C76 ~]# systemctl restart httpd rsyslog
5、下载loganalyzer
[root@C76 ~]# cd /var/www/html/
[root@C76 html]# wget http://download.adiscon.com/loganalyzer/loganalyzer-4.1.10.tar.gz
[root@C76 html]# tar xvf loganalyzer-4.1.10.tar.gz
[root@C76 html]# mv loganalyzer-4.1.10 log
[root@C76 html]# touch log/src/config.php
[root@C76 html]# chmod 666 log/src/config.php
[root@C76 ~]# systemctl restart httpd rsyslog
#web安装完后取消权限
[root@C76 html]# chmod 644 log/src/config.php
6、测试
访问http://192.168.44.128/log/src/进行web安装
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值