首页 > Web开发 > 详细

Apache部署静态html

时间:2018-07-18 01:03:52      阅读:223      评论:0      收藏:0      [点我收藏+]
ubantu16.04

 

安装

sudo apt-get install apache2

 

index.html

cd /var/www/html
vi index.html

curl http://127.0.0.1/

可以访问 index.html

配置Apache环境

cd /etc/apache2
vi apache2.conf

 修改apache2.conf

 省略部分代码

<Directory />
        Options FollowSymLinks
        AllowOverride None
        Require all denied
</Directory>
 
<Directory /usr/share>
        AllowOverride None
        Require all granted
</Directory>
 
<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>
 
NameVirtualHost 47.**.***.***
<VirtualHost 47.**.**.***>
ServerName www.***.com
<VirtualHost>

 curl http://127.0.0.1/

可以本地访问

 curl http://公网IP/

可以公网访问

此处需要注意

阿里云apache服务器外网无法访问(配置安全组,添加80服务)

阿里云云服务器控制台 ,在安全组,安全组规则或者配置规则,添加安全组规则,进行设置。

 

技术分享图片

参考:https://www.cnblogs.com/ScratchingBear/p/5397940.html

https://blog.csdn.net/qq_33813365/article/details/76633751

 

Apache部署静态html

原文:https://www.cnblogs.com/wanglinjie/p/9326802.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!