怎么用Apache服务器搭建http网站

这篇文章主要介绍“怎么用Apache服务器搭建http网站”,在日常操作中,相信很多人在怎么用Apache服务器搭建http网站问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”怎么用Apache服务器搭建http网站”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!

让客户满意是我们工作的目标,不断超越客户的期望值来自于我们对这个行业的热爱。我们立志把好的技术通过有效、简单的方式提供给客户,将通过不懈努力成为客户在信息化领域值得信任、有价值的长期合作伙伴,公司提供的服务项目有:主机域名、网络空间、营销软件、网站建设、贵州网站维护、网站推广。

准备工具

一台带有Linux系统的主机,这里使用CentOS 7.1 64位系统

一个备案过的域名,这里使用www.hellopage.cn

一台可以访问网络的pc,这里使用的Win7_pro_sp1

步骤

1、解析域名

在域名管理控制台添加对主机ip的解析,如下图

怎么用Apache服务器搭建http网站
怎么用Apache服务器搭建http网站

2、Apache安装  启动CentOS系统,安装httpd

# yum install httpd

3、配置Apache环境

# vim /etc/httpd/conf/httpd.conf

添加如下代码至文件末尾

怎么用Apache服务器搭建http网站

同时修改文件的以下部分,来修改默认的主目录

怎么用Apache服务器搭建http网站

同时别忘了创建此目录,否则会报错

# cd /var/www/html

# mkdir hellopage

最后重新启动httpd

# /bin/systemctl start httpd.service

4、测试

1.打开浏览器,输入www.hellopage.cn,若出现如下页面,则建立成功

Testing 123..

This page is used to test the proper http://www.bbqmw.net/   operation of the Apache HTTP server after it has been installed. If you can read this page it means that this site is working properly. This server is powered by CentOS.

2.在刚刚创建的/var/www/html/hellopage/下创建html

# cd /var/www/html/hellopage/

# touch index.html

# vim index.html

添加如下代码

God Sacred

hello world!

3.重新登录网站www.hellopage.cn
怎么用Apache服务器搭建http网站

到此,关于“怎么用Apache服务器搭建http网站”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注创新互联网站,小编会继续努力为大家带来更多实用的文章!


文章名称:怎么用Apache服务器搭建http网站
文章路径:http://bzwzjz.com/article/pgochi.html

其他资讯

Copyright © 2007-2020 广东宝晨空调科技有限公司 All Rights Reserved 粤ICP备2022107769号
友情链接: 营销网站建设 成都定制网站建设 H5网站制作 成都网站建设 企业网站设计 成都h5网站建设 高端网站建设 成都网站建设公司 成都网站设计 成都网站制作 品牌网站建设 成都网站制作 高端网站设计 成都网站建设 成都网站设计 成都网站设计 响应式网站设计 成都网站制作 成都网站设计公司 网站建设方案 重庆电商网站建设 手机网站制作