虚拟主机Apache2(Ubuntu 14.04)
我试图在apache2上设置VH,所以我创建了文件“mysite.conf”,如下所示虚拟主机Apache2(Ubuntu 14.04),apache2,Apache2,我试图在apache2上设置VH,所以我创建了文件“mysite.conf”,如下所示 <Virtual Host *:80> ServerName mysite.net ServerAlias www.mysite.net ServerAdmin webmaster@mysite.net DocumentRoot /var/www/webmaster_home ErrorLog [...] CustomLog [...] </
<Virtual Host *:80>
ServerName mysite.net
ServerAlias www.mysite.net
ServerAdmin webmaster@mysite.net
DocumentRoot /var/www/webmaster_home
ErrorLog [...]
CustomLog [...]
</VirtualHost>
在谷歌搜索我的问题后,它会导致我的“mysite.conf”出现错误,其中应包括:
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/webmaster_home>
Options -Indexes -FollowSymLinks +MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
查看它报告的日志文件:
AH00670: Options FollowSymLinks and SymLinksIfOwnerMatch are bot off, so the
RewriteRule directive is also forbidden due to its similar ability to
circumvent directory restrictions
因此,如果我设置了FollowSymLinks或symlinksFownerMatch,我会得到一个循环,如果我不设置,我的用户将无法访问该目录
如果有用的话,这是我的“apache2.conf”
好吧,我通过将.htaccess移到mysite.net/从网站管理员的主页/
当我从上一个目录中移动整个sito时,隐藏的文件不会与其他文件一起移动
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/webmaster_home>
Options -Indexes -FollowSymLinks +MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
You don't have permission to access / on this server.
AH00670: Options FollowSymLinks and SymLinksIfOwnerMatch are bot off, so the
RewriteRule directive is also forbidden due to its similar ability to
circumvent directory restrictions
<Directory />
Options FollowSymLink
AllowOverride None
</Directory>
<Directory var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<ifModule mod_rewrite.c>
<ifModule mod_negotiation.c>
Options -MultiViews
</ifModule>
RewriteEngine On
##
## You may need to uncomment the following line for some hosting enviroments,
## if you have installed to a subdirectory, enter the name here also.
##
# RewriteBase /
##
## Black liste protected files
##
RewriteRule themes/.*/(layouts|pages|partials)/.*.htm index.php [L,NC]
RewriteRule uploads/protected/.* index.php [L,NC]
##
## White listed folders and files
##
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_URI} !\.js
RewriteCond %{REQUEST_URI} !\.ico
RewriteCond %{REQUEST_URI} !\.jpg
RewriteCond %{REQUEST_URI} !\.jpeg
RewriteCond %{REQUEST_URI} !\.gif
RewriteCond %{REQUEST_URI} !\.css
RewriteCond %{REQUEST_URI} !\.less
RewriteCond %{REQUEST_URI} !\.scss
RewriteCond %{REQUEST_URI} !\.pdf
RewriteCond %{REQUEST_URI} !\.png
RewriteCond %{REQUEST_URI} !\.swf
RewriteCond %{REQUEST_URI} !\.txt
RewriteCond %{REQUEST_URI} !\.xml
RewriteCond %{REQUEST_URI} !\.xls
RewriteCond %{REQUEST_URI} !\.eot
RewriteCond %{REQUEST_URI} !\.woff
RewriteCond %{REQUEST_URI} !\.ttf
RewriteCond %{REQUEST_URI} !\.svg
RewriteCond %{REQUEST_URI} !\.wmv
RewriteCond %{REQUEST_URI} !\.avi
RewriteCond %{REQUEST_URI} !\.mov
RewriteCond %{REQUEST_URI} !\.mp4
RewriteCond %{REQUEST_URI} !\.webm
RewriteCond %{REQUEST_URI} !\.ogg
RewriteCond %{REQUEST_URI} !docs/.*
RewriteCond %{REQUEST_URI} !themes/.*
RewriteCOnd ^ index.php [L,NC]
##
## Standard routes
##
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</ifModule>
/var
|----www/
|----webmaster_home/
|----mysite.net/
|----logs/