欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

怎么在CentOS8上安裝與配置Apache虛擬主機(jī)-創(chuàng)新互聯(lián)

怎么在CentOS 8上安裝與配置Apache虛擬主機(jī),很多新手對此不是很清楚,為了幫助大家解決這個難題,下面小編將為大家詳細(xì)講解,有這方面需求的人可以來學(xué)習(xí)下,希望你能有所收獲。

10年積累的網(wǎng)站設(shè)計、成都做網(wǎng)站經(jīng)驗,可以快速應(yīng)對客戶對網(wǎng)站的新想法和需求。提供各種問題對應(yīng)的解決方案。讓選擇我們的客戶得到更好、更有力的網(wǎng)絡(luò)服務(wù)。我雖然不認(rèn)識你,你也不認(rèn)識我。但先做網(wǎng)站后付款的網(wǎng)站建設(shè)流程,更有零陵免費(fèi)網(wǎng)站建設(shè)讓你可以放心的選擇與我們合作。
Apache服務(wù)器是現(xiàn)代操作系統(tǒng)包括UNIX和Windows等開發(fā)和維護(hù)開源的HTTP服務(wù)器,apache提供一個安全、高效、可擴(kuò)展的服務(wù)器,提供與當(dāng)前HTTP標(biāo)準(zhǔn)同步的HTTP服務(wù)。

實驗環(huán)境

操作系統(tǒng): Centos 8

web應(yīng)用:apache

內(nèi)網(wǎng)IP:192.168.3.21

shell執(zhí)行:root

怎么在CentOS 8上安裝與配置Apache虛擬主機(jī)

以root或具有sudo權(quán)限的用戶身份登錄執(zhí)行如下操作。

安裝httpd服務(wù)

[root@linuxcool ~]# yum install httpd-devel.x86_64 httpd.x86_64 httpd-tools.x86_64

驗證httpd是否安裝成功

[root@linuxcool ~]# httpd -v Server version: Apache/2.4.6 (CentOS) Server built:   Apr  2 2020 13:13:23

啟動httpd服務(wù)

[root@linuxcool ~]# systemctl start httpd.service          [root@linuxcool ~]# systemctl status httpd.service  ● httpd.service - The Apache HTTP Server    Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)    Active: active (running) since Fri 2020-05-22 12:23:03 CST; 25s ago      Docs: man:httpd(8)            man:apachectl(8)  Main PID: 952 (httpd)    Status: "Total requests: 0; Current requests/sec: 0; Current traffic:   0 B/sec"     Tasks: 6    Memory: 3.6M    CGroup: /system.slice/httpd.service            ├─952 /usr/sbin/httpd -DFOREGROUND            ├─953 /usr/sbin/httpd -DFOREGROUND            ├─954 /usr/sbin/httpd -DFOREGROUND            ├─955 /usr/sbin/httpd -DFOREGROUND            ├─956 /usr/sbin/httpd -DFOREGROUND            └─957 /usr/sbin/httpd -DFOREGROUND May 22 12:23:03 linuxcool systemd[1]: Starting The Apache HTTP Server... May 22 12:23:03 linuxcool httpd[952]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, u...message May 22 12:23:03 linuxcool systemd[1]: Started The Apache HTTP Server. Hint: Some lines were ellipsized, use -l to show in full.

apache安裝成功,默認(rèn)web目錄/var/www/

測試

http://192.168.3.21/

怎么在CentOS 8上安裝與配置Apache虛擬主機(jī)

安裝成功!

配置apache虛擬主機(jī)創(chuàng)建網(wǎng)站目錄

[root@linuxcool ~]# mkdir -p /var/www/web1 [root@linuxcool ~]# mkdir -p /var/www/web2

web1添加index.html

[root@linuxcool ~]# vim /var/www/web1/index.html <!DOCTYPE html> <html dir="ltr">   <head>     <meta charset="utf-8">     <title>Welcome to Web1</title>   </head>   <body>     <h2>Success! Web1 home page!</h2>   </body> </html>

web2添加index.html

[root@linuxcool ~]# vim /var/www/web2/index.html <!DOCTYPE html> <html dir="ltr">   <head>     <meta charset="utf-8">     <title>Welcome to Web1</title>   </head>   <body>     <h2>Success! Web1 home page!</h2>   </body> </html>

授權(quán)web目錄權(quán)限

[root@linuxcool ~]# chown -R apache: /var/www/web1/ [root@linuxcool ~]# chown -R apache: /var/www/web2/

創(chuàng)建虛擬主機(jī)文件

#web1

[root@linuxcool ~]# vim /etc/httpd/conf.d/web1.conf <VirtualHost *:80> ServerName web1.com ServerAlias www.web1.com ServerAdmin webmaster@example.com DocumentRoot /var/www/web1 <Directory /var/www/web1/> Options -Indexes +FollowSymLinks AllowOverride All </Directory> ErrorLog /var/log/httpd/example.com-error.log CustomLog /var/log/httpd/example.com-access.log combined </VirtualHost>

#web2

[root@linuxcool ~]# vim /etc/httpd/conf.d/web2.conf <VirtualHost *:80> ServerName web2.com ServerAlias www.web2.com ServerAdmin webmaster@example.com DocumentRoot /var/www/web2 <Directory /var/www/web2/> Options -Indexes +FollowSymLinks AllowOverride All </Directory> ErrorLog /var/log/httpd/example.com-error.log CustomLog /var/log/httpd/example.com-access.log combined </VirtualHost>

重啟httpd服務(wù)

[root@linuxcool ~]# systemctl restart httpd.service

驗證httpd虛擬主機(jī)結(jié)果

http://www.web1.com

怎么在CentOS 8上安裝與配置Apache虛擬主機(jī)

http://www.web2.com

怎么在CentOS 8上安裝與配置Apache虛擬主機(jī)

看完上述內(nèi)容是否對您有幫助呢?如果還想對相關(guān)知識有進(jìn)一步的了解或閱讀更多相關(guān)文章,請關(guān)注創(chuàng)新互聯(lián)-成都網(wǎng)站建設(shè)公司行業(yè)資訊頻道,感謝您對創(chuàng)新互聯(lián)的支持。

網(wǎng)站名稱:怎么在CentOS8上安裝與配置Apache虛擬主機(jī)-創(chuàng)新互聯(lián)
本文鏈接:http://chinadenli.net/article10/edjdo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供App開發(fā)網(wǎng)站營銷標(biāo)簽優(yōu)化網(wǎng)站設(shè)計公司網(wǎng)站內(nèi)鏈網(wǎng)站制作

廣告

聲明:本網(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è)