\n' \       '\n' \       '\n'   response_header = [('content-type','text/html')]   start_response(status,response_header)   return [html]

CentOS7.2怎么配置Apache服务

[4]配置如果你使用django。 ([参考安装django](http://blog.csdn.net/wh211212/article/details/52992413))例如,在“wang”下拥有的“/home/wang/ venv/testproject”下配置“testapp”

[root@linuxprobe ~]# vi /etc/httpd/conf.d/django.conf
# create new

wsgidaemonprocess testapp python-path=/home/wang/venv/testproject:/home/wang/venv/lib/python2.7/site-packages
wsgiprocessgroup testapp
wsgiscriptalias /django /home/wang/venv/testproject/testproject/wsgi.py


  require all granted


[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 like to 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 )

[root@linuxprobe ~]# /usr/share/awstats/linuxproberoot/cgi-bin/awstats.pl -config=linuxprobe.org -update

create/update database for 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 after 20000 hosts)...
jumped lines in file: 0
parsed lines in file: 165
 found 0 dropped records,
 found 0 comments,
 found 0 blank records,
 found 0 corrupted records,
 found 0 old records,
 found 165 new qualified records.

[2]访问“http://(您的服务器的名称或ip地址/)/awstats/awstats.pl”,然后显示以下屏幕,可以看到httpd日志报告。

CentOS7.2怎么配置Apache服务

关于“CentOS7.2怎么配置Apache服务”这篇文章的内容就介绍到这里,感谢各位的阅读!相信大家对“CentOS7.2怎么配置Apache服务”知识都有一定的了解,大家如果还想学习更多知识,欢迎关注创新互联行业资讯频道。


网站栏目:CentOS7.2怎么配置Apache服务
网页链接:http://tjjierui.cn/article/pjisih.html

其他资讯

在线咨询
服务热线
服务热线:028-86922220
TOP