怎么用Apache服務(wù)器搭建http網(wǎng)站-創(chuàng)新互聯(lián)

這篇文章主要介紹“怎么用Apache服務(wù)器搭建http網(wǎng)站”,在日常操作中,相信很多人在怎么用Apache服務(wù)器搭建http網(wǎng)站問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”怎么用Apache服務(wù)器搭建http網(wǎng)站”的疑惑有所幫助!接下來,請跟著小編一起來學(xué)習(xí)吧!

建網(wǎng)站原本是網(wǎng)站策劃師、網(wǎng)絡(luò)程序員、網(wǎng)頁設(shè)計師等,應(yīng)用各種網(wǎng)絡(luò)程序開發(fā)技術(shù)和網(wǎng)頁設(shè)計技術(shù)配合操作的協(xié)同工作。創(chuàng)新互聯(lián)專業(yè)提供成都網(wǎng)站建設(shè)、成都做網(wǎng)站,網(wǎng)頁設(shè)計,網(wǎng)站制作(企業(yè)站、響應(yīng)式網(wǎng)站設(shè)計、電商門戶網(wǎng)站)等服務(wù),從網(wǎng)站深度策劃、搜索引擎友好度優(yōu)化到用戶體驗的提升,我們力求做到極致!

準(zhǔn)備工具

  一臺帶有Linux系統(tǒng)的主機,這里使用CentOS 7.1 64位系統(tǒng)

  一個備案過的域名,這里使用www.hellopage.cn

  一臺可以訪問網(wǎng)絡(luò)的pc,這里使用的Win7_pro_sp1

步驟

1、解析域名

  在域名管理控制臺添加對主機ip的解析,如下圖

怎么用Apache服務(wù)器搭建http網(wǎng)站
怎么用Apache服務(wù)器搭建http網(wǎng)站

2、Apache安裝  啟動CentOS系統(tǒng),安裝httpd

  # yum install httpd

3、配置Apache環(huán)境

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

  添加如下代碼至文件末尾

怎么用Apache服務(wù)器搭建http網(wǎng)站

  同時修改文件的以下部分,來修改默認(rèn)的主目錄

怎么用Apache服務(wù)器搭建http網(wǎng)站

  同時別忘了創(chuàng)建此目錄,否則會報錯

  # cd /var/www/html

  # mkdir hellopage

  最后重新啟動httpd

  # /bin/systemctl start httpd.service

4、測試

  1.打開瀏覽器,輸入www.hellopage.cn,若出現(xiàn)如下頁面,則建立成功

  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.在剛剛創(chuàng)建的/var/www/html/hellopage/下創(chuàng)建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.重新登錄網(wǎng)站www.hellopage.cn
怎么用Apache服務(wù)器搭建http網(wǎng)站

到此,關(guān)于“怎么用Apache服務(wù)器搭建http網(wǎng)站”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識,請繼續(xù)關(guān)注創(chuàng)新互聯(lián)-成都網(wǎng)站建設(shè)公司網(wǎng)站,小編會繼續(xù)努力為大家?guī)砀鄬嵱玫奈恼拢?/p>

網(wǎng)頁題目:怎么用Apache服務(wù)器搭建http網(wǎng)站-創(chuàng)新互聯(lián)
網(wǎng)頁路徑:http://muchs.cn/article4/djigie.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供商城網(wǎng)站、網(wǎng)站維護網(wǎng)站內(nèi)鏈、軟件開發(fā)虛擬主機、企業(yè)建站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都定制網(wǎng)站建設(shè)