安裝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