CentOS 常见问题

问题一
CentOS中,安装好apache后,更改根目录从/var/www/html改成/home/search/www3.x
DocumentRoot must be a directory
但/home/search/www.3.x确定存在
解决方案
system-config-securitylevel (or redhat-config-securitylevel) to
disable SELinux for httpd or give SELinux permissions to that
directory:
chcon -R -h -t httpd_sys_content_t /path/to/directory

默认当启用了SELinux后,APACHE无法访问/WWW目录,会提示documentroot must be a directory,这里需要改变目录策略,方法为:
# chcon  -R -h -t httpd_sys_content_t  /www/web/

更改MYSQL默认数据库安装路径后,重新启动MYSQL服务会遇到代码为13的错误,
       Can't change dir to '/var/lib/mysql/' (Errcode: 13)
这个错误同样是SELINUX引起,给相应目录增加权限即可:
#chcon  -R –t mysqld_db_t /mysql
重新启动服务,OK,如果不行就重启一下。

MYSQL ERROR 13表示MYSQL对指定目录没有权限,发生这个错误不一定都是SELINUX引起的,如果你的机子中没有SELINUX,请确定MYSQL所运行的目录属于MYSQL用户组,属于MYSQL用户。如果/var/lib/mysql为MYSQL数据目录,用如下指令指定其为MYSQL所属目录:
#chown -R mysql:mysql /var/lib/mysql
并将这个目录的权限更改为755

问题二
使用yum时,出现
Could not retrieve mirrorlistCould not retrieve mirrorlist
原因,域名不能解析,需要设DNS
解决方案
修改/etc/resolv.conf,增加
nameserver XXX.XXX.XXX.XXX

参考:
http://www.issociate.de/board/goto/695908/I_have_an_error_message_%22DocumentRoot_must_be_a_directory%22.html
http://blog.sina.com.cn/s/indexlist_1340543943_2.html

版权声明:
作者:Kiyo
链接:https://www.wkiyo.cn/html/2010-08/i668.html
来源:Kiyo's space
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>