| 主機(jī)參考:VPS測(cè)評(píng)參考推薦/專注分享VPS服務(wù)器優(yōu)惠信息!若您是商家可以在本站進(jìn)行投稿,查看詳情!此外我們還提供軟文收錄、PayPal代付、廣告贊助等服務(wù),查看詳情! |
| 我們發(fā)布的部分優(yōu)惠活動(dòng)文章可能存在時(shí)效性,購(gòu)買(mǎi)時(shí)建議在本站搜索商家名稱可查看相關(guān)文章充分了解該商家!若非中文頁(yè)面可使用Edge瀏覽器同步翻譯!PayPal代付/收錄合作 |
############apache的安裝###############vim /etc/yum.repos.d/rhel_dvd.repoyum install -y httpdsystemctl start httpdsystemctl stop firewalldsystemctl enable httpdsystemctl disable firewalld#############apache的信息###################1.Apache主配置文件:?/etc/httpd/conf/httpd.conf2.監(jiān)聽(tīng)端口:803.apache的默認(rèn)發(fā)布文件index.html4.apache的默認(rèn)發(fā)布目錄/var/www/html#############apache的基本設(shè)置####################[root@localhost ~]# cd /var/www/html[root@localhost html]# ls[root@localhost html]# vim /var/www/html/westos.html?? 1 <h2gt;westos's page</h2gt;[root@localhost html]# vim /etc/httpd/conf/httpd.conf?166 <IfModule dir_modulegt;?167???? DirectoryIndex westos.html index.html?168 </IfModulegt;[root@localhost html]# cd[root@localhost ~]# mkdir /westos/www/html[root@localhost ~]# mkdir /westos/www/test -p?? 1 /westos/www/test/westos.html's page[root@localhost ~]# vim /etc/httpd/conf/httpd.conf???????? ?119 #DocumentRoot "/var/www/html"120 DocumentRoot "/westos/www/test"121 <Directory "/westos/www/test"gt;122?????? Require all granted123 </Directorygt;[root@localhost ~]# getenforceEnforcing[root@localhost ~]# setenforce 0[root@localhost ~]# getenforcePermissive[root@localhost ~]# systemctl restart httpd測(cè)試############apache用戶訪問(wèn)設(shè)置##########[root@localhost html]# mkdir admin[root@localhost admin]# vim admin?1 <h2gt;admin's page</h2gt;[root@localhost html]# lsadmin? index.html? westos.html[root@localhost html]# cd admin/[root@localhost admin]# ls[root@localhost admin]# vim admin[root@localhost admin]# vim /etc/httpd/conf/httpd.conf119 DocumentRoot "/var/www/html"120 #DocumentRoot "/westos/www/test"121 <Directory "/westos/www/test"gt;122?????? Require all granted123 </Directorygt;124 <Directory "/var/www/html/admin"gt;???? #####只允許75主機(jī)進(jìn)行訪問(wèn)125?????? Order Deny,Allow126?????? Allow from 172.25.254.75127?????? Deny from All128 </Directorygt;171 <IfModule dir_modulegt;172???? DirectoryIndex admin westos.html index.html173 </IfModulegt;[root@localhost admin]# systemctl restart httpd測(cè)試
[root@localhost admin]# vim /etc/httpd/conf/httpd.conf119 DocumentRoot "/var/www/html"120 #DocumentRoot "/westos/www/test"121 <Directory "/westos/www/test"gt;122?????? Require all granted123 </Directorygt;124 <Directory "/var/www/html/admin"gt;???????????? ####允許其他用戶訪問(wèn),但不允許75主機(jī)訪問(wèn)125?????? Order Allow,Deny126?????? Allow from All127?????? Deny from 172.25.254.75128 </Directorygt;[root@localhost admin]# systemctl restart httpd
測(cè)試[root@localhost admin]# cd /etc/httpd[root@localhost httpd]# lsconf? conf.d? conf.modules.d? logs? modules? run[root@localhost httpd]# htpasswd -cm /etc/httpd/accessuser adminNew password: Re-type new password: Adding password for user admin[root@localhost httpd]# cat /etc/httpd/accessuseradmin:$apr1$hLx1MnNl$J9vtdAFtpX2BjL6eMD22x.[root@localhost httpd]# vim /etc/httpd/conf/httpd.conf119 DocumentRoot "/var/www/html"??? #####允許有密碼的用戶訪問(wèn)120 #DocumentRoot "/westos/www/test"121 <Directory "/westos/www/test"gt;122?????? Require all granted123 </Directorygt;124 <Directory "/var/www/html/admin"gt; 125????? AuthUserFile /etc/httpd/accessuser? ###用戶認(rèn)證文件126????? AuthName "please input your name and password !!"??????? ###用戶認(rèn)證提示信息127????? AuthType basic?????????????? ###認(rèn)證類(lèi)型128????? Require valid-user?????????? ###認(rèn)證用戶,認(rèn)證文件中所用的用戶可以通過(guò)129 </Directorygt;[root@localhost httpd]# systemctl restart httpd
測(cè)試###############CGI#####################[root@localhost html]# yum install -y php[root@localhost html]# systemctl restart httpd[root@localhost html]# vim index.php?? 1 <?php?? 2???????? phpinfo();?? 3 ?gt;[root@localhost html]# cd /etc/httpd/conf.d[root@localhost conf.d]# lsautoindex.conf? php.conf? README? userdir.conf? welcome.conf[root@localhost conf.d]# mkdir /var/www/html/cgi[root@localhost conf.d]# cd /var/www/html/cgi[root@localhost cgi]# ls[root@localhost cgi]# vim index.cgi?? 1 #!/usr/bin/perl?? 2 print "Content-type: text/htmlnn";?? 3 print `date`;[root@localhost cgi]# perl index.cgiContent-type: text/html2017年? 5月 16日 火曜日 07:24:23 EDT[root@localhost cg i]# chmod +x index.cgi[root@localhost cgi]# vim /etc/httpd/conf/httpd.conf 130 <Directory "/var/www/html/cgi"gt;131??????? Options +ExecCGI132??????? AddHandler cgi-script .cgi133 </Directorygt;176 <IfModule dir_modulegt;177???? DirectoryIndex index.cgi admin westos.html index.html178 </IfModulegt;[root@localhost cgi]# systemctl restart httpd測(cè)試############apache虛擬主機(jī)##############1.定義可以讓我們的一臺(tái)apache服務(wù)器訪問(wèn)不同域名時(shí)顯示不同的網(wǎng)頁(yè)2.建立測(cè)試頁(yè)mkdir virtual/news.westos.com -pmkdir virtual/money.westos.com -pmkdir virtual/news.westos.com/html -pmkdir virtual/money.westos.com/html -pecho "new.westos.com's page" gt;virtual/news.westos.com/html/index.htmlecho "money.westos.com's page" gt;virtual/money.westos.com/html/index.html3.配置vim /etc/httpd/conf.d/default.conf????? ##指定域名的訪問(wèn)都訪問(wèn)default? 1 <Virtualhost???? _default_:80gt;????? ##虛擬主機(jī)開(kāi)啟的端口? 2?????????? DocumentRoot "/var/www/html" ##虛擬主機(jī)的默認(rèn)發(fā)布目錄? 3?????????? CustomLog "logs/default.log" combined? ##虛擬主機(jī)的日志? 4 </Virtualhostgt;vim /etc/httpd/conf.d/news.conf?????? ##指定域名news.westos.com訪問(wèn)到默認(rèn)發(fā)布目錄? 1 <Virtualhost *:80gt;? 2????????? ServerName "news.westos.com"? 3????????? DocumentRoot "/var/www/virtual/news.westos.com/html"? 4????????? CustomLog "logs/news.log" combined? 5 </Virtualhostgt;? 6 <Directory "/var/www/virtual/news.westos.com/html"gt;??? ##默認(rèn)發(fā)布目錄的訪問(wèn)授權(quán)? 7?????????? Require all granted? 8 </Directorygt;vim /etc/httpd/conf.d/money.conf???? ####指定域名money.westos.com訪問(wèn)到默認(rèn)發(fā)布目錄? 1 <Virtualhost *:80gt;? 2????????? ServerName "money.westos.com"? 3????????? DocumentRoot "/var/www/virtual/money.westos.com/html"? 4????????? CustomLog "logs/news.log" combined? 5 </Virtualhostgt;? 6 <Directory "/var/www/virtual/money.westos.com/html"gt; ####默認(rèn)發(fā)布目錄的訪問(wèn)授權(quán)? 7?????????? Require all granted? 8 </Directorygt;3.在客戶主機(jī)中添加解析vim /etc/hosts?127.0.0.1?? localhost localhost.localdomain localhost4 localhost4.localdomain4::1???????? localhost localhost.localdomain localhost6 localhost6.localdomain6172.25.254.250? content.exle.com172.25.254.195 www.westos.com news.westos.com money.westos.com~??????????????????? ?測(cè)試
###############https###############yum install -y mod_sslyum install -y crypto-utilssystemctl stop firewalldgenkey www.westos.com
############apache的安裝###############vim /etc/yum.repos.d/rhel_dvd.repoyum install -y httpdsystemctl start httpdsystemctl stop firewalldsystemctl enable httpdsystemctl disable firewalld#############apache的信息###################1.Apache主配置文件:?/etc/httpd/conf/httpd.conf2.監(jiān)聽(tīng)端口:803.apache的默認(rèn)發(fā)布文件index.html4.apache的默認(rèn)發(fā)布目錄/var/www/html#############apache的基本設(shè)置####################[root@localhost ~]# cd /var/www/html[root@localhost html]# ls[root@localhost html]# vim /var/www/html/westos.html?? 1 <h2gt;westos's page</h2gt;[root@localhost html]# vim /etc/httpd/conf/httpd.conf?166 <IfModule dir_modulegt;?167???? DirectoryIndex westos.html index.html?168 </IfModulegt;[root@localhost html]# cd[root@localhost ~]# mkdir /westos/www/html[root@localhost ~]# mkdir /westos/www/test -p?? 1 /westos/www/test/westos.html's page[root@localhost ~]# vim /etc/httpd/conf/httpd.conf???????? ?119 #DocumentRoot "/var/www/html"120 DocumentRoot "/westos/www/test"121 <Directory "/westos/www/test"gt;122?????? Require all granted123 </Directorygt;[root@localhost ~]# getenforceEnforcing[root@localhost ~]# setenforce 0[root@localhost ~]# getenforcePermissive[root@localhost ~]# systemctl restart httpd測(cè)試############apache用戶訪問(wèn)設(shè)置##########[root@localhost html]# mkdir admin[root@localhost admin]# vim admin?1 <h2gt;admin's page</h2gt;[root@localhost html]# lsadmin? index.html? westos.html[root@localhost html]# cd admin/[root@localhost admin]# ls[root@localhost admin]# vim admin[root@localhost admin]# vim /etc/httpd/conf/httpd.conf119 DocumentRoot "/var/www/html"120 #DocumentRoot "/westos/www/test"121 <Directory "/westos/www/test"gt;122?????? Require all granted123 </Directorygt;124 <Directory "/var/www/html/admin"gt;???? #####只允許75主機(jī)進(jìn)行訪問(wèn)125?????? Order Deny,Allow126?????? Allow from 172.25.254.75127?????? Deny from All128 </Directorygt;171 <IfModule dir_modulegt;172???? DirectoryIndex admin westos.html index.html173 </IfModulegt;[root@localhost admin]# systemctl restart httpd測(cè)試
[root@localhost admin]# vim /etc/httpd/conf/httpd.conf119 DocumentRoot "/var/www/html"120 #DocumentRoot "/westos/www/test"121 <Directory "/westos/www/test"gt;122?????? Require all granted123 </Directorygt;124 <Directory "/var/www/html/admin"gt;???????????? ####允許其他用戶訪問(wèn),但不允許75主機(jī)訪問(wèn)125?????? Order Allow,Deny126?????? Allow from All127?????? Deny from 172.25.254.75128 </Directorygt;[root@localhost admin]# systemctl restart httpd
測(cè)試[root@localhost admin]# cd /etc/httpd[root@localhost httpd]# lsconf? conf.d? conf.modules.d? logs? modules? run[root@localhost httpd]# htpasswd -cm /etc/httpd/accessuser adminNew password: Re-type new password: Adding password for user admin[root@localhost httpd]# cat /etc/httpd/accessuseradmin:$apr1$hLx1MnNl$J9vtdAFtpX2BjL6eMD22x.[root@localhost httpd]# vim /etc/httpd/conf/httpd.conf119 DocumentRoot "/var/www/html"??? #####允許有密碼的用戶訪問(wèn)120 #DocumentRoot "/westos/www/test"121 <Directory "/westos/www/test"gt;122?????? Require all granted123 </Directorygt;124 <Directory "/var/www/html/admin"gt; 125????? AuthUserFile /etc/httpd/accessuser? ###用戶認(rèn)證文件126????? AuthName "please input your name and password !!"??????? ###用戶認(rèn)證提示信息127????? AuthType basic?????????????? ###認(rèn)證類(lèi)型128????? Require valid-user?????????? ###認(rèn)證用戶,認(rèn)證文件中所用的用戶可以通過(guò)129 </Directorygt;[root@localhost httpd]# systemctl restart httpd
測(cè)試###############CGI#####################[root@localhost html]# yum install -y php[root@localhost html]# systemctl restart httpd[root@localhost html]# vim index.php?? 1 <?php?? 2???????? phpinfo();?? 3 ?gt;[root@localhost html]# cd /etc/httpd/conf.d[root@localhost conf.d]# lsautoindex.conf? php.conf? README? userdir.conf? welcome.conf[root@localhost conf.d]# mkdir /var/www/html/cgi[root@localhost conf.d]# cd /var/www/html/cgi[root@localhost cgi]# ls[root@localhost cgi]# vim index.cgi?? 1 #!/usr/bin/perl?? 2 print "Content-type: text/htmlnn";?? 3 print `date`;[root@localhost cgi]# perl index.cgiContent-type: text/html2017年? 5月 16日 火曜日 07:24:23 EDT[root@localhost cg i]# chmod +x index.cgi[root@localhost cgi]# vim /etc/httpd/conf/httpd.conf 130 <Directory "/var/www/html/cgi"gt;131??????? Options +ExecCGI132??????? AddHandler cgi-script .cgi133 </Directorygt;176 <IfModule dir_modulegt;177???? DirectoryIndex index.cgi admin westos.html index.html178 </IfModulegt;[root@localhost cgi]# systemctl restart httpd測(cè)試############apache虛擬主機(jī)##############1.定義可以讓我們的一臺(tái)apache服務(wù)器訪問(wèn)不同域名時(shí)顯示不同的網(wǎng)頁(yè)2.建立測(cè)試頁(yè)mkdir virtual/news.westos.com -pmkdir virtual/money.westos.com -pmkdir virtual/news.westos.com/html -pmkdir virtual/money.westos.com/html -pecho "new.westos.com's page" gt;virtual/news.westos.com/html/index.htmlecho "money.westos.com's page" gt;virtual/money.westos.com/html/index.html3.配置vim /etc/httpd/conf.d/default.conf????? ##指定域名的訪問(wèn)都訪問(wèn)default? 1 <Virtualhost???? _default_:80gt;????? ##虛擬主機(jī)開(kāi)啟的端口? 2?????????? DocumentRoot "/var/www/html" ##虛擬主機(jī)的默認(rèn)發(fā)布目錄? 3?????????? CustomLog "logs/default.log" combined? ##虛擬主機(jī)的日志? 4 </Virtualhostgt;vim /etc/httpd/conf.d/news.conf?????? ##指定域名news.westos.com訪問(wèn)到默認(rèn)發(fā)布目錄? 1 <Virtualhost *:80gt;? 2????????? ServerName "news.westos.com"? 3????????? DocumentRoot "/var/www/virtual/news.westos.com/html"? 4????????? CustomLog "logs/news.log" combined? 5 </Virtualhostgt;? 6 <Directory "/var/www/virtual/news.westos.com/html"gt;??? ##默認(rèn)發(fā)布目錄的訪問(wèn)授權(quán)? 7?????????? Require all granted? 8 </Directorygt;vim /etc/httpd/conf.d/money.conf???? ####指定域名money.westos.com訪問(wèn)到默認(rèn)發(fā)布目錄? 1 <Virtualhost *:80gt;? 2????????? ServerName "money.westos.com"? 3????????? DocumentRoot "/var/www/virtual/money.westos.com/html"? 4????????? CustomLog "logs/news.log" combined? 5 </Virtualhostgt;? 6 <Directory "/var/www/virtual/money.westos.com/html"gt; ####默認(rèn)發(fā)布目錄的訪問(wèn)授權(quán)? 7?????????? Require all granted? 8 </Directorygt;3.在客戶主機(jī)中添加解析vim /etc/hosts?127.0.0.1?? localhost localhost.localdomain localhost4 localhost4.localdomain4::1???????? localhost localhost.localdomain localhost6 localhost6.localdomain6172.25.254.250? content.exle.com172.25.254.195 www.westos.com news.westos.com money.westos.com~??????????????????? ?測(cè)試
###############https###############yum install -y mod_sslyum install -y crypto-utilssystemctl stop firewalldgenkey www.westos.com
--------------------------------------------------------------
主機(jī)參考,收集國(guó)內(nèi)外VPS,VPS測(cè)評(píng),主機(jī)測(cè)評(píng),云服務(wù)器,虛擬主機(jī),獨(dú)立服務(wù)器,國(guó)內(nèi)外服務(wù)器,高性價(jià)比建站主機(jī)相關(guān)優(yōu)惠信息@m.k2270.com
詳細(xì)介紹和測(cè)評(píng)國(guó)外VPS主機(jī),云服務(wù)器,國(guó)外服務(wù)器,國(guó)外主機(jī)的相關(guān)優(yōu)惠信息,商家背景,網(wǎng)絡(luò)帶寬等等,也是目前國(guó)內(nèi)最好的主機(jī)云服務(wù)器VPS參考測(cè)評(píng)資訊優(yōu)惠信息分享平臺(tái)
這幾篇文章你可能也喜歡:
- 搬瓦工VPS,限量款套餐補(bǔ)貨,美國(guó)CN2 GIA/日本軟銀/荷蘭AS9929,1Gbps超大高端網(wǎng)絡(luò)線路,KVM虛擬架構(gòu),1核1G內(nèi)存1Gbps帶寬,80美元/年,機(jī)房可隨意切換
- RAKsmart,黑色星期五特別優(yōu)惠,特價(jià)獨(dú)立服務(wù)器/獨(dú)服30美元/月,全場(chǎng)VPS云服務(wù)器/裸金屬服務(wù)器終身7折,美國(guó)/香港/日本/韓國(guó)機(jī)房,E3-1230處理器16G內(nèi)存100Mbps帶寬,30美元/月
- 搬瓦工VPS,黑色星期五特別優(yōu)惠活動(dòng),全場(chǎng)VPS云服務(wù)器9折,香港/美國(guó)CN2 GIA,分配高達(dá)10Gbps超大帶寬,1核2G內(nèi)存2.5Gbps帶寬,45美元/季
- #實(shí)時(shí)更新#最新2021年主機(jī)商雙十一活動(dòng)匯總,國(guó)內(nèi)外VPS主機(jī)商雙11促銷(xiāo)優(yōu)惠活動(dòng)匯總,海外免備案VPS云服務(wù)器/獨(dú)立服務(wù)器超大帶寬不限流量雙11活動(dòng)
- iON Cloud,雙十一優(yōu)惠,美國(guó)VPS云服務(wù)器低至11.11美元/季,洛杉磯/圣何塞機(jī)房,KVM虛擬架構(gòu),1核2G內(nèi)存1Gbps帶寬,11.11元/季
本文由主機(jī)參考刊發(fā),轉(zhuǎn)載請(qǐng)注明:apache http://m.k2270.com/12656.html
主機(jī)參考

















評(píng)論前必須登錄!
注冊(cè)