---
title: "apache权限问题 "
author: "JLK"
date: "2015-01-09T14:30:57Z"
tags: []
categories: ["操作系统"]
slug: "apache"
draft: false
lastmod: "2015-01-09T14:30:57Z"
id: 2174360
url: "https://jlk.iteye.com/blog/2174360"
---

\[root@localhost ~]# service httpd restart  
停止 httpd： \[失败]  
正在启动 httpd：Syntax error on line 293 of /etc/httpd/conf/httpd.conf:  
DocumentRoot must be a directory  
\[失败]  
\[root@localhost ~]# service httpd restart  
停止 httpd： \[失败]  
正在启动 httpd： \[确定]

 

解决 方法 :

这是因为 selinux 的权限问题导致，

解决方法 ：

给网站文件 加apache 的权限 :

chcon -R -h -t httpd\_sys\_content\_t /var/www/filename

即可