apache架设网站局域网访问403:在httpd中找到
# onlineoffline tag - don't remove
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
把127.0.0.1改成服务器在内网中的地址或者直接为all就可。
禁止下载:
<directory d:/wamp/www/aic/disk>
<FilesMatch "\.(rar|txt|doc|xls|ppt|bmp)">
Order Deny,Allow
Deny from all
</FilesMatch>
</directory>
<Directory "D:/wamp/www">
Options SymLinksIfOwnerMatch
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://localhost.*$ [NC]
RewriteCond %{HTTP_REFERER} !http://172.23.167 [NC]
RewriteRule .*\.(gif|jpg|jpeg|JPG|)$ - [F]
</Directory>
禁止列目录:
Options Indexes FollowSymLinks
去掉indexes
防止域名恶意绑定
<VirtualHost *>
DocumentRoot /var/www/html/yukon12345.com
ServerName www.yukon12345.com
ServerAlias yukon12345.com
</VirtualHost>
<VirtualHost *>
RedirectMatch ^/(.*) http://www.baidu.com
# onlineoffline tag - don't remove
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
把127.0.0.1改成服务器在内网中的地址或者直接为all就可。
禁止下载:
<directory d:/wamp/www/aic/disk>
<FilesMatch "\.(rar|txt|doc|xls|ppt|bmp)">
Order Deny,Allow
Deny from all
</FilesMatch>
</directory>
<Directory "D:/wamp/www">
Options SymLinksIfOwnerMatch
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://localhost.*$ [NC]
RewriteCond %{HTTP_REFERER} !http://172.23.167 [NC]
RewriteRule .*\.(gif|jpg|jpeg|JPG|)$ - [F]
</Directory>
禁止列目录:
Options Indexes FollowSymLinks
去掉indexes
防止域名恶意绑定
<VirtualHost *>
DocumentRoot /var/www/html/yukon12345.com
ServerName www.yukon12345.com
ServerAlias yukon12345.com
</VirtualHost>
<VirtualHost *>
RedirectMatch ^/(.*) http://www.baidu.com
</VirtualHost>
开启.htaccess:
AllowOverride All
或者
AllowOverride FileInfo
在本地使用虚拟主机如e.com访问 本地网站
改主机host文件:添加 127.0.0.1 e.com
改apache的httpd-vhosts.conf,添加
<VirtualHost *:80>
ServerName e.com
DocumentRoot d:/wamp64/www/ipad/web
ErrorLog "logs/eovas-error.log"
CustomLog "logs/eovas-access.log" common
<Directory "d:/wamp64/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>