lamp禁止IP直接访问服务器

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_33733970/article/details/89636745

配置如下:

NameVirtualHost IP地址
<virtualhost IP地址:80>
    ServerName  IP地址
    <Directory />
       Order Allow,Deny
       Deny from all
    </Directory>
</virtualhost>



<VirtualHost IP地址:80>
    ServerName urdomain.cn
    ServerAlias urdomain.cn
    DocumentRoot /data/www
    <Directory /data/www>
        SetOutputFilter DEFLATE
        Options FollowSymLinks
        AllowOverride All
        Order Deny,Allow
        Require all granted
        DirectoryIndex index.php index.html index.htm
    </Directory>
</VirtualHost>

修改完毕记得重启服务!
nginx配置:
https://www.cnblogs.com/weifeng1463/p/9197971.html

猜你喜欢

转载自blog.csdn.net/qq_33733970/article/details/89636745