1、登录linux,输入登录密码
2、mkdir /var/www/html
3、vi index.html 写入内容 (不vi的,见4;vi的见5)
4、在桌面新建word文档,写入内容,另存为index.html,使用rz上传,上传完成后,
cp index.html /var/www/html 即可;后续网页查看乱码失败建议操作第3步
5、安装 yum install httpd -y (linux里面安装httpd;ubuntu安sudo apt-get apache2)
6、systemctl restart httpd 重启httpd; systemctl enable httpd 设置开机自启
7、systemctl status firewalld 查看防火墙是否启动(有active running即启动)输入 systemctl stop firewalld 关闭防火墙
8、关闭selinux命令: setenforce 0
9、网页查看:http://ip地址/index.html (失败,见10)
10、html下权限不够,更改权限 chmod 755 /var/www/
linux-apache2-静态网页访问
最新推荐文章于 2024-03-22 21:34:02 发布