eva*_*dez 34 server permissions apache2.4
所以我刚刚安装了一个带有 Ubuntu 13.10 的虚拟机。我想在更新我的 ubuntu 12.04 服务器之前使用 apache 2.4.6。我希望我的文档根目录位于我的主文件夹中,因此我在etc/apache2/sites-available/000-default.conf
当我这样做时,我只会收到禁止的消息。我将新文件夹权限设置为 777,但仍然被禁止。我什至在新目录中放了一个 index.html 文件,它只是说 hello world 但什么也没有。这是我的 000-default.conf 文件。
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /home/everett/webroot
<Directory /home/everett/webroot>
Options FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
Run Code Online (Sandbox Code Playgroud)
小智 74
我遇到了完全相同的问题,我是这样解决的:
第一的; 我按照Ubuntu 服务器指南页面上的说明进行操作
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/mynewsite.conf)sudo gedit /etc/apache2/sites-available/mynewsite.conf) 并将DocumentRoot更改为您自己的(保存并关闭..)sudo a2ensite mynewsite.conf) 并禁用默认的 ( sudo a2dissite 000-default.conf)sudo gedit /etc/apache2/apache2.conf) 并将默认 -section 更改为:(
<Directory [write_your_dir_here]>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>保存并关闭..)sudo service apache2 restart)如果它已经有效:太棒了!
如果没有,那么您应该检查是否每个命名的基础都<VirtualHost *:80>需要一个不同的ServerName集合,包括000-default.conf它是否存在。您可以apachectl -S在终端中运行以查看所有内容的快速列表。
如果它仍然不起作用,那么您应该检查您的目录(以及通向它的完整路径!)是否具有正确的读取和执行权限(rx)。
cd /) 并ls -l在您可以看到类似drwxr-xr-x 14 root root 4096 mei 1 01:24 [your_directory].sudo chmod -R a+rx [your_directory]如果你仍然不能让它工作,你应该检查 apache 错误日志 ( sudo gedit /var/log/apache2/error.log) 并进一步挖掘......
祝你好运!
亲爱的,我想通知您,您正在更改默认的 apache 配置。
从 000-default.conf 文件中删除这些行。
<Directory /home/everett/webroot>
选项 FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Require all allowed
</Directory>
打开您的 apache.conf 文件 (/etc/apache2/apache.conf) 并找出目录或转到第 1 行。172.在那里找到“目录/var/www/”定义你的目录“/home/everett/webroot”这里保存并重启你的apache并刷新你的网页。
| 归档时间: |
|
| 查看次数: |
212785 次 |
| 最近记录: |