在域名管理控制檯添加對主機ip的解析,以下圖html
啓動CentOS系統,安裝httpdapache
# yum install httpd
# vim /etc/httpd/conf/httpd.conf
添加以下代碼至文件末尾vim
同時修改文件的如下部分,來修改默認的主目錄瀏覽器
同時別忘了建立此目錄,不然會報錯服務器
# cd /var/www/html # mkdir hellopage
最後從新啓動httpd網絡
# /bin/systemctl start httpd.service
1.打開瀏覽器,輸入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.cnthis