<Directory /home/wang/venv/testproject> Require all granted </Directory>
[root@linuxprobe ~]# systemctl restart httpd
四、访问日志分析器:AWstats
安装AWstats,它报告http日志以分析对http服务器的访问。
[1] 安装AWstats。 # install from EPEL [root@linuxprobe ~]# yum --enablerepo=epel -y install awstats # awstats.(hostname).conf是自动生成的 [root@linuxprobe ~]# vi /etc/awstats/awstats.linuxprobe.org.conf # line 122: change # if your config for log format in httpd.conf is 'combined' Set here '1' # If log-config is'common'set here '4', but in this case, some informations can't be get (browser info and so on) LogFormat=1 # line 153: specify your hostname SiteDomain="linuxprobe.org # line 168: set IP address you'd liketo exclude HostAliases="localhost 127.0.0.1 REGEX[server\.world$] REGEX[^10\.1\.1\.] " [root@linuxprobe ~]# vi /etc/httpd/conf.d/awstats.conf # line 30: IP address you permit to access Require ip 10.1.1.0/24
[root@linuxprobe ~]# systemctl restart httpd # generate reports ( reports are updated for hourly by Cron )
Create/Updatedatabasefor config "/etc/awstats/awstats.linuxprobe.org.conf"by AWStats version 7.4 (build 20150714) From data in log file "/var/log/httpd/access_log"... Phase 1 : First bypass old records, searching new record... Searching new records from beginning of log file... Phase 2 : Now process new records (Flush history on disk after20000 hosts)... Jumped lines in file: 0 Parsed lines in file: 165 Found0 dropped records, Found0 comments, Found0 blank records, Found0 corrupted records, Found0 old records, Found165 new qualified records.