前端html页面我是打算用apache服务器运行
下载apache
在Xshell输入代码
yum install httpd httpd-devel

输入y确认

启动并且验证
service httpd start
service httpd status
配置apache文件
1.找到apache的配置文件apache2.conf
cd /etc/apache2
vim apache2.conf
2.添加如下代码
NameVirtualHost 39.xx.xxx.xxx.xx
<VirtualHost 39.xx.xxx.xxx.xx >
<VirtualHost www.xxx.xxx>
39.xx.xxx.xxx.xx :阿里云公网ip
www.xxx.xxx:域名(没有也可以不设置)

3.ESC后:wq保存退出
4.Curl http://公网IP/

本文介绍了如何将前端HTML页面部署到阿里云,通过Apache服务器运行。首先下载Apache,然后配置Apache的配置文件,将公网IP和(可选的)域名添加。接着将页面复制到指定目录,并修改项目中访问路径的localhost为公网IP和后端端口。最后通过XFTP上传页面,通过公网IP+端口即可访问。

2万+

被折叠的 条评论
为什么被折叠?



