平时大家都是在Windows系统的电脑下部署网站。linux系统的电脑想必大家都很少使用吧。下面我来简单讲解下如何在linux系统的电脑下部署一个Apache服务器。
Apache安装
-
1
yum install httpd
-
2
安装httpd会自动安装一下依赖包:
这是要下载的依赖包
-
3
选择y及安装已下载好的安装包。安装大概需要30秒左右。
-
4
配置
进入配置界面vi httpd.conf
把里面的 AllowOverride None 全部修改为 AllowOverride All
顺便在 DirectoryIndex index.html 后面加上 index.htm index.php index.shtml
这个是配置默认首页的
:wq 保存退出 service httpd restart 重启 apache 服务,再访问一下。果然可以访问了。
-
5
重启服务器
-
6
systemctl start httpd.service #启动apache
systemctl stop httpd.service #停止apache
systemctl restart httpd.service #重启apache
systemctl enable httpd.service #设置apache开机启动
-
7
测试。在浏览器中输入相应网址。
END
经验内容仅供参考,如果您需解决具体问题(尤其法律、医学等领域),建议您详细咨询相关领域专业人士。
作者声明:本篇经验系本人依照真实经历原创,未经许可,谢绝转载。
展开阅读全部
文章评论