centos下,apache问题及解决方案

1,使用python调用os.mkdir无文件创建权限:
chcon -R -t httpd_sys_content_t /path/to/www chcon -R -t httpd_sys_content_rw_t /path/to/www/dir/for/rw


参考资料:
http://stackoverflow.com/questions/28856148/centos-7-apache-php-mkdir-permission-denied
http://serverfault.com/questions/626610/selinux-preventing-apache-from-writing-to-a-file

2,调用urllib2.urlopen()无调用权限[Errno 13] Permission denied:
命令行调用:setenforce 0 
或者修改配置文件:/etc/selinux/config 设置:SELINUX=“disabled”

参考资料:http://www.cnblogs.com/javawebsoa/p/3241092.html

3,使用/usr/local/apache2/bin/apachectl -k start启用apache的时候,提示错误如下:httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName
解决办法:在/usr/local/apache2/conf/httpd.conf配置文件里面启用ServerName那一行配置,并在/etc/hosts文件中配置好域名
posted @ 2015-08-26 16:19  doublehappyi  阅读(408)  评论(0编辑  收藏  举报