Starting httpd: Warning: DocumentRoot does not exist
来源:互联网 发布:心神战机击落歼20 知乎 编辑:程序博客网 时间:2024/06/06 01:27
Here's a tutorial approach to the SELinux case:
Find out if SELinux is active:
$ sestatus SELinux status: enabled SELinuxfs mount: /selinux Current mode: enforcing Mode from config file: enforcing Policy version: 24 Policy from config file: targeted
If so, some comparative checking might help. For instance, a server has a default DocumentRoot at /var/www/html
, but we want it somewhere else like /path/to/document/root
.
If SELinux is not actively messing with the resource, ls -dZ
on the directory will show something like:
$ ls -dZ /path/to/document/root? /path/to/document/root/
On the other hand, if SELinux contexts are applied, ls -dZ
looks more like:
$ ls -dZ /path/to/document/rootdrwxrws--x+ cfgadm cfgadmin system_u:object_r:file_t:s0 /path/to/documentroot
If we compare to a working DocumentRoot, it would look something like:
$ ls -dZ /var/www/htmldrwxr-xr-x. root root system_u:object_r:httpd_sys_content_t:s0 /var/www/html
The _r
and _t
relate to -r
(--role
and -t
(--type
) arguments to chcon
. Here is a cut-down man page:
NAME chcon - change file security contextSYNOPSIS chcon [OPTION]... CONTEXT FILE... chcon [OPTION]... [-u USER] [-r ROLE] [-l RANGE] [-t TYPE] FILE... chcon [OPTION]... --reference=RFILE FILE...DESCRIPTION Change the security context of each FILE to CONTEXT. With --reference, change the security context of each FILE to that of RFILE. --reference=RFILE use RFILE's security context rather than specifying a CONTEXT value -R, --recursive operate on files and directories recursively
At first guess, the following might seem to work, but might not.
$ sudo chcon -R -t httpd_sys_content_t /path/to/document/root
If the web server still cannot see the DocumentRoot, note that the context matters all the way back to root:
$ sudo chcon -R -t httpd_sys_content_t /path/to/document$ sudo chcon -R -t httpd_sys_content_t /path/to$ sudo chcon -R -t httpd_sys_content_t /path
At this point, the web server can see the directory.
- Starting httpd: Warning: DocumentRoot does not exist
- httpd DocumentRoot does not exist
- DocumentRoot does not exist
- [liunx apache配置]DocumentRoot does not exist解决方法
- Warning: user mockbuild does not exist: using root
- Warning: user mockbuild does not exist. using root
- Error starting static Resources:* does not exist or is not a readable directory
- mapreduce_shuffle does not exist
- @Scripts “does not exist”
- 'resourceFile' does not exist.
- react-native run-android Starting: Intent Error type 3 Error: Activity class does not exist
- 测试apache时出现[error] [client 192.168.6.1] File does not exist: /etc/httpd/htdocs
- U盘安装centos 7 提示 “Warning: /dev/root does not exist, could not boot” 解决办法
- U盘安装CentOS 7提示 “Warning: /dev/root does not exist, could not boot” 解决办法
- U盘安装centos 7 提示 “Warning: /dev/root does not exist, could not boot” 解决办法
- U盘安装centos 7 提示 “Warning: /dev/root does not exist, could not boot” 解决办法
- [WARNING] The requested profile "pom.xml" could not be activated because it does not exist.解决方法
- [WARNING] The requested profile "pom.xml" could not be activated because it does not exist.
- [Java 12 IO] InputStream 继承自 它 的类,都是向 程序中 输入数据
- 我该如何动态分配多维数组?
- JavaFX -- 如何隐藏Tooltip右下角的翻页效果
- 浪涌的介绍
- 学习iOS开发之NSFileManager类和NSFileHandle类的使用
- Starting httpd: Warning: DocumentRoot does not exist
- PCRE - Perl Compatible Regular Expressions
- Django模型中的OneToOneField和ForeignKey有什么区别?
- 预览来电铃声,如何让背景音乐暂停播放
- flv录制开发遇到的一些问题总结
- Android自动测试之monkeyrunner工具(一)
- pulltorefresh修改背景
- 网页三维地图技术初探
- 互联网App的频繁心跳给移动运营商带来的网络压力