第十七周

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

主机1:192.168.37.207,部署apache、php和xcache。主机2:192.168.37.217,部署mariaDB。

[root@localhost ~]# yum install httpd php php-mysql php-xcache
[root@localhost ~]# vim /var/www/html/index.php

<?php
    phpinfo();
?>
[root@localhost ~]# systemctl start httpd.service

在这里插入图片描述

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

部署mariadb并创建wordpress数据库

[root@localhost ~]# yum install mariadb-server
[root@localhost ~]# systemctl start mariadb.service
[root@localhost ~]# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.65-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database wordpress;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> grant all on wordpress.* to wpuser@'192.168.37.%' identified by 'password';
Query OK, 0 rows affected (0.00 sec)

部署wordpress

[root@localhost html]# ls
wordpress-5.0.10-zh_CN.tar.gz
[root@localhost html]# tar xvf wordpress-5.0.10-zh_CN.tar.gz 
[root@localhost html]# setfacl -Rm u:apache:rwx wordpress

在这里插入图片描述
在这里插入图片描述

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

部署loganalyzer

[root@localhost html]# yum install php-gd rsyslog-mysql
[root@localhost html]# tar xvf loganalyzer-4.1.11.tar.gz
[root@localhost html]# mv loganalyzer-4.1.11/src/ .
[root@localhost html]# touch src/config.php
[root@localhost html]# chmod 666 src/config.php
[root@localhost html]# rpm -ql rsyslog-mysql
/usr/lib64/rsyslog/ommysql.so
/usr/share/doc/rsyslog-8.24.0/mysql-createDB.sql
[root@localhost ~]# mysql < mysql-createDB.sql

MariaDB [(none)]> grant all on Syslog.* to rsyslog@'192.168.37.%' identified by 'password';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| Syslog             |
| mysql              |
| performance_schema |
| test               |
| wordpress          |
+--------------------+
6 rows in set (0.00 sec)

MariaDB [Syslog]> show tables;
+------------------------+
| Tables_in_Syslog       |
+------------------------+
| SystemEvents           |
| SystemEventsProperties |
+------------------------+
2 rows in set (0.00 sec)
[root@localhost html]# vim /etc/httpd/conf/httpd.conf
CustomLog "| /usr/bin/logger -p local1.info" combined
[root@localhost ~]# vim /etc/rsyslog.conf
$ModLoad ommysql
local1.info                                            :ommysql:192.168.37.217,Syslog,rsyslog,password

在这里插入图片描述
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值