1. 程式人生 > >Apache部署靜態html

Apache部署靜態html

har sym 設置 安全 blog 技術分享 *** tor 需要

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