超碰中文网,91久久精品日日躁夜夜躁欧美,一区二区三区精品道,一区二区国产在线观看,亚洲精品中文字幕乱码一区二区,天天看片高清影视在线观看,久久99精品久久久久蜜桃,久久成人影视

VPS參考測評推薦
專注分享VPS主機優惠信息
衡天云優惠活動
熱網互聯2026年促銷活動
hostkvm優惠促銷活動
zji優惠促銷活動
QQGNET優惠促銷活動
QQGNET優惠促銷活動

apache

主機參考:VPS測評參考推薦/專注分享VPS服務器優惠信息!若您是商家可以在本站進行投稿,查看詳情!此外我們還提供軟文收錄、PayPal代付、廣告贊助等服務,查看詳情!
我們發布的部分優惠活動文章可能存在時效性,購買時建議在本站搜索商家名稱可查看相關文章充分了解該商家!若非中文頁面可使用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.監聽端口:803.apache的默認發布文件index.html4.apache的默認發布目錄/var/www/html#############apache的基本設置####################[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測試############apache用戶訪問設置##########[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主機進行訪問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測試

[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主機訪問125?????? Order Allow,Deny126?????? Allow from All127?????? Deny from 172.25.254.75128 </Directorygt;[root@localhost admin]# systemctl restart httpd
測試[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"??? #####允許有密碼的用戶訪問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? ###用戶認證文件126????? AuthName "please input your name and password !!"??????? ###用戶認證提示信息127????? AuthType basic?????????????? ###認證類型128????? Require valid-user?????????? ###認證用戶,認證文件中所用的用戶可以通過129 </Directorygt;[root@localhost httpd]# systemctl restart httpd

測試###############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測試############apache虛擬主機##############1.定義可以讓我們的一臺apache服務器訪問不同域名時顯示不同的網頁2.建立測試頁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????? ##指定域名的訪問都訪問default? 1 <Virtualhost???? _default_:80gt;????? ##虛擬主機開啟的端口? 2?????????? DocumentRoot "/var/www/html" ##虛擬主機的默認發布目錄? 3?????????? CustomLog "logs/default.log" combined? ##虛擬主機的日志? 4 </Virtualhostgt;vim /etc/httpd/conf.d/news.conf?????? ##指定域名news.westos.com訪問到默認發布目錄? 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;??? ##默認發布目錄的訪問授權? 7?????????? Require all granted? 8 </Directorygt;vim /etc/httpd/conf.d/money.conf???? ####指定域名money.westos.com訪問到默認發布目錄? 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; ####默認發布目錄的訪問授權? 7?????????? Require all granted? 8 </Directorygt;3.在客戶主機中添加解析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~??????????????????? ?測試

###############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.監聽端口:803.apache的默認發布文件index.html4.apache的默認發布目錄/var/www/html#############apache的基本設置####################[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測試############apache用戶訪問設置##########[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主機進行訪問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測試

[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主機訪問125?????? Order Allow,Deny126?????? Allow from All127?????? Deny from 172.25.254.75128 </Directorygt;[root@localhost admin]# systemctl restart httpd
測試[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"??? #####允許有密碼的用戶訪問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? ###用戶認證文件126????? AuthName "please input your name and password !!"??????? ###用戶認證提示信息127????? AuthType basic?????????????? ###認證類型128????? Require valid-user?????????? ###認證用戶,認證文件中所用的用戶可以通過129 </Directorygt;[root@localhost httpd]# systemctl restart httpd

測試###############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測試############apache虛擬主機##############1.定義可以讓我們的一臺apache服務器訪問不同域名時顯示不同的網頁2.建立測試頁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????? ##指定域名的訪問都訪問default? 1 <Virtualhost???? _default_:80gt;????? ##虛擬主機開啟的端口? 2?????????? DocumentRoot "/var/www/html" ##虛擬主機的默認發布目錄? 3?????????? CustomLog "logs/default.log" combined? ##虛擬主機的日志? 4 </Virtualhostgt;vim /etc/httpd/conf.d/news.conf?????? ##指定域名news.westos.com訪問到默認發布目錄? 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;??? ##默認發布目錄的訪問授權? 7?????????? Require all granted? 8 </Directorygt;vim /etc/httpd/conf.d/money.conf???? ####指定域名money.westos.com訪問到默認發布目錄? 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; ####默認發布目錄的訪問授權? 7?????????? Require all granted? 8 </Directorygt;3.在客戶主機中添加解析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~??????????????????? ?測試

###############https###############yum install -y mod_sslyum install -y crypto-utilssystemctl stop firewalldgenkey www.westos.com

--------------------------------------------------------------
主機參考,收集國內外VPS,VPS測評,主機測評,云服務器,虛擬主機,獨立服務器,國內外服務器,高性價比建站主機相關優惠信息@www.k2270.com
詳細介紹和測評國外VPS主機,云服務器,國外服務器,國外主機的相關優惠信息,商家背景,網絡帶寬等等,也是目前國內最好的主機云服務器VPS參考測評資訊優惠信息分享平臺

這幾篇文章你可能也喜歡:

本文由主機參考刊發,轉載請注明:apache http://www.k2270.com/12684.html

【騰訊云】領8888元采購禮包,搶爆款云服務器 每月 9元起,個人開發者加享折上折!
打賞
轉載請注明原文鏈接:主機參考 » apache
主機參考僅做資料收集,不對商家任何信息及交易做信用擔保,購買前請注意風險,有交易糾紛請自行解決!請查閱:特別聲明

相關推薦

評論 搶沙發

評論前必須登錄!