在域名管理控制台添加对主机ip的解析,如下图
启动CentOS系统,安装httpd
# yum install httpd添加如下代码至文件末尾
同时修改文件的以下部分,来修改默认的主目录
同时别忘了创建此目录,否则会报错
# cd /var/www/html # mkdir hellopage最后重新启动httpd
# /bin/systemctl start httpd.service1.打开浏览器,输入www.hellopage.cn,若出现如下页面,则建立成功
Testing 123.. This page is used to test the proper 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添加如下代码
<!DOCTYPE html> <html> <head> <title>God Sacred</title> </head> <body> <p>hello world!</p> </body> </html>3.重新登录网站www.hellopage.cn
转载于:https://www.cnblogs.com/ScratchingBear/p/5397940.html
相关资源:安装apache http server详细步骤