安装AWstats分析http日志信息.php
[root@client ~]# yum -y install awstatshtml
自动生成相关配置文件awstats.(hostname).conf mysql
[root@client ~]# vim /etc/awstats/awstats.server.example.com.confsql
# line 122: 修改数据库
# 若是你的httpd.conf配置文件中的日志类型是 'combined' 就设置为 '1'apache
# 若是是 'common' set here '4'。vim
LogFormat=1服务器
# line 153: 指定你的主机名curl
SiteDomain="server.example.com"ide
# line 168: 主机别名:
HostAliases="localhost 127.0.0.1 REGEX[server\.world$] REGEX[^10\.0\.0\.]"
[root@client ~]# vi /etc/httpd/conf.d/awstats.conf
# line 30: 容许访问的IP地址
Require ip 192.168.96.0/24
[root@client ~]# systemctl restart httpd
# 生成报告 ( 报告会被计划任务每间隔一个小时更新一次 )
[root@client ~]# /usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=server.example.com -update
[root@client ~]# mysql -u root -p
# create "wordpress" databse (用户名为wordpress,密码为redhat)
MariaDB [(none)]> create database wordpress;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> grant all privileges on wordpress.* to wordpress@'localhost' identified by 'redhat';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> exit
Bye
[root@client ~]# yum -y install wordpress
[root@client ~]# vim /etc/wordpress/wp-config.php
# line 23: 定义数据库
define('DB_NAME', 'wordpress');
# line 26: 定义数据库用户
define('DB_USER', 'wordpress');
# line 29: 定义数据库密码
define('DB_PASSWORD', 'password');
[root@client ~]# vi /etc/httpd/conf.d/wordpress.conf
# line 8: 添加
Require all granted
[root@client ~]# systemctl restart httpd
[root@client ~]# mysql -u root -p
# 建立 "mediawiki" 数据库 (用户名mediawiki,密码是redhat)
MariaDB [(none)]> create database mediawiki;
MariaDB [(none)]> grant all privileges on mediawiki.* to mediawiki@'localhost' identified by 'redhat';
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit
Bye
[root@client ~]# yum -y install php-mysql
[root@client ~]# curl -O https://releases.wikimedia.org/mediawiki/1.27/mediawiki-1.27.0.tar.gz
[root@client ~]# tar zxvf mediawiki-1.27.0.tar.gz
[root@client ~]# mv mediawiki-1.27.0 /var/www/html/mediawiki
[root@client ~]# chown -R apache. /var/www/html/mediawiki
[root@client ~]# systemctl restart httpd