Apache2 在查看我的网站时,如何在没有禁止信息的情况下设置指示灯?
我使用LinuxMint16+最新的LAMP+Laravel 当我尝试通过“localhost”或“127.0.0.1”查看我的网站时,我遇到了这个错误 我的设置如下: 在/etc/hostname上Apache2 在查看我的网站时,如何在没有禁止信息的情况下设置指示灯?,apache2,lamp,Apache2,Lamp,我使用LinuxMint16+最新的LAMP+Laravel 当我尝试通过“localhost”或“127.0.0.1”查看我的网站时,我遇到了这个错误 我的设置如下: 在/etc/hostname上 NameServer ynwlocalwebserver 在/etc/hosts上 127.0.0.1 localhost 127.0.1.1 ynwlocalwebserver # The following lines are desirable for IPv6
NameServer ynwlocalwebserver
在/etc/hosts上
127.0.0.1 localhost
127.0.1.1 ynwlocalwebserver
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
我只有一个名为“ynwlocalwebserver.conf”的站点启用,目前它的当前内容是:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName ynwlocalwebserver
DocumentRoot /home/ynwmint/ynw/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /home/ynwmint/ynw/public>
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName localhost
DocumentRoot /home/ynwmint/ynw/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /home/ynwmint/ynw/public>
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
NameVirtualHost*:80
服务器名ynwlocalwebserver
DocumentRoot/home/ynwmint/ynw/public
ErrorLog${APACHE_LOG_DIR}/error.LOG
CustomLog${APACHE\u LOG\u DIR}/access.LOG组合
允许超越所有
命令允许,拒绝
通融
服务器名本地主机
DocumentRoot/home/ynwmint/ynw/public
ErrorLog${APACHE_LOG_DIR}/error.LOG
CustomLog${APACHE\u LOG\u DIR}/access.LOG组合
允许超越所有
命令允许,拒绝
通融
#vim:syntax=apachets=4sw=4sts=4srnoet
“/home/ynwmint/ynw/public”中的文件夹ynw是Laravel项目
我将公用文件夹的chmod设置为777(暂时),并将其置于www-data:www-data下
我做错了什么,或者我还需要检查什么
谢谢。Apache2.4在配置方面有一些小改动 这:
ServerName ynwlocalwebserver
DocumentRoot/home/ynwmint/ynw/public
ErrorLog${APACHE_LOG_DIR}/error.LOG
CustomLog${APACHE\u LOG\u DIR}/access.LOG组合
允许超越所有
命令允许,拒绝
通融
应改为:
<VirtualHost *:80>
ServerName ynwlocalwebserver
DocumentRoot /home/ynwmint/ynw/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /home/ynwmint/ynw/public>
Options +Indexes +FollowSymlinks + MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
服务器名ynwlocalwebserver
DocumentRoot/home/ynwmint/ynw/public
ErrorLog${APACHE_LOG_DIR}/error.LOG
CustomLog${APACHE\u LOG\u DIR}/access.LOG组合
选项+索引+跟随符号链接+多视图
允许超越所有
要求所有授权
此外,为了增加安全性,您可能希望使用此目录规则:
<Directory />
Options FollowSymlinks
AllowOverride None
</Directory>
选项如下符号链接
不允许超限
来源:“选项+索引+FollowSymlinks+多视图”有语法错误,但“需要所有授权”修复了该错误。谢谢
<VirtualHost *:80>
ServerName ynwlocalwebserver
DocumentRoot /home/ynwmint/ynw/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /home/ynwmint/ynw/public>
Options +Indexes +FollowSymlinks + MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<Directory />
Options FollowSymlinks
AllowOverride None
</Directory>