五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

Centos7.6 http服務(wù)搭建全攻略

2021-08-13 17:52 作者:墨大仙仙仙  | 我要投稿

1、安裝apache服務(wù)

yum??clean?all

yum?install?-y?httpd

2、啟動服務(wù)并驗(yàn)證

systemctl??start?httpd

瀏覽器127.0.0.1

3、創(chuàng)建網(wǎng)站根目錄和首頁文件

mkdir?-p?/data/www

chmod?-R?o+rx?/data

echo?"welcome?to?my?website"?>/data/www/index.html

cat??/data/www/index.html

4、修改apache主配置文件

cd?/etc/httpd/conf

mv??httpd.conf?httpd.conf.bak

grep?-v?"#"?httpd.conf.bak>httpd.conf

vim?httpd.conf

ServerName?ns1.myj.edu.cn

DocumentRoot?"/data/www"

<Directory?"/data/www">

AllowOverride?None

Require?all?granted

DirectoryIndex?index.html

</Directory>

5、重啟httpd服務(wù),防火墻放行

systemctl?restart?httpd

firewall-cmd?--permanent?--add-service=http

firewall-cmd?--reload

firewall-cmd?--list-all

setenforce?0



拓展1:創(chuàng)建虛擬目錄

1、創(chuàng)建虛擬目錄和分配權(quán)限

mkdir?-?p?/ito/www

chmod?-R?o+rx?/ito

echo?"this?is?in/ito/www">/ito/www/index.html

2、修改配置文件/etc/httpd/conf/httpd.conf

Alias?/doc?"/ito/www"

<Directory?"/ito/www">

AllowOverride?none

Require?all?granted

</Directory>

3、重啟httpd服務(wù)

systemctl?restart?httpd


拓展2:創(chuàng)建用戶個人主頁

1、創(chuàng)建用戶名和目錄

useradd??myj

useradd?myj2

chmod?-R?o+rx?/home/myj

chmod?-R?o+rx?/home/myj2

mkdir?-p?/home/myj/www

mkdir?-p?/home/myj2/www

echo?"this?is?myjwww"?>?/home/myj/www/index.html

echo?"this?is?myj2?www"?>?/home/myj/www/index.html

2、修改用戶主頁配置文件/etc/httpd/conf.d/userdir.conf

vim?/etc/httpd/conf.d/userdir.conf

<IfModule?mod_userdir.c>

#UserDir?disabled

UserDir?www

</IfModule>

<Directory?"/home/*/public_html">

修改成

<Directory?"/home/*/www">

3、重啟httpd服務(wù)

systemctl?restart?httpd

4、驗(yàn)證http://192.168.128.100/~myj

?????????????http://192.168.128.100/~myj2


拓展3:創(chuàng)建虛擬主機(jī)

1、修改網(wǎng)卡配置文件增加ip地址

cat?/var/named/zone.myj.edu.cn

vim?/etc/sysconfig/network-scripts/ifcfg-ens33

IPADDR0=192.168.128.100

PREFIX0=24

GATEWAY0=192.168.128.254

IPADDR1=192.168.128.120

PREFIX1=24

GATEWAY1=192.168.128.254

DNS1=192.168.128.100

systemctl?restart?network

2、創(chuàng)建虛擬主機(jī)的根目錄和首頁文件,分配權(quán)限

mkdir?-p?/data/www2

chmod?-R?o+rx?/data/www2

echo?"this?is?www.myj.edu.cn"?>?/data/www2/index.html

3、創(chuàng)建vhost.conf配置文件

vim?/etc/httpd/conf.d/vhost.conf

<Virtualhost?192.168.128.100>

????????????DocumentRoot?/data/www

????ServerName?ns1.myj.edu.cn

????????????<Directory?/>

????????????????AllowOverride?none

????????????????Require?all?granted

????????????</Directory>

</Virtualhost>

<Virtualhost?192.168.128.120>

????????????DocumentRoot?/data/www2

????????????ServerName?www.myj.edu.cn

????????????<Directory?/>

????????????????AllowOverride?none

????????????????Require?all?granted

????????????</Directory>

</Virtualhost>

4、重啟httpd服務(wù)

systemctl?restart?httpd



Centos7.6 http服務(wù)搭建全攻略的評論 (共 條)

分享到微博請遵守國家法律
庆云县| 河源市| 清水河县| 司法| 沭阳县| 新乐市| 肃宁县| 安国市| 唐山市| 景宁| 天峻县| 阿勒泰市| 淳化县| 两当县| 巧家县| 万安县| 双峰县| 礼泉县| 南川市| 前郭尔| 阜阳市| 大宁县| 大荔县| 浏阳市| 明光市| 客服| 谷城县| 偏关县| 八宿县| 西平县| 榆中县| 怀集县| 克东县| 华池县| 鹰潭市| 海原县| 安庆市| 永仁县| 密山市| 乐业县| 桃园县|