一级女人毛片人一女人-一级女性大黄生活片免费-一级女性全黄久久生活片-一级女性全黄生活片免费-国产美女在线一区二区三区-国产美女在线观看

始創于2000年 股票代碼:831685
咨詢熱線:0371-60135900 注冊有禮 登錄
  • 掛牌上市企業
  • 60秒人工響應
  • 99.99%連通率
  • 7*24h人工
  • 故障100倍補償
您的位置: 網站首頁 > 幫助中心>文章內容

LINUX下的APACHE的配置

發布時間:  2012/8/6 19:25:31

今天寫一下LINUX下的APACHE的配置方法。
  APACHE是作為WEB服務器的。它的優點在于用緩存方式來加快網頁的搜索速度。
  APACHE缺省只支持靜態網頁
  LINUX下有APACHE的RPM包
  安裝上第一張盤里的httpd-2.0.40-21.i386.rpm 包
  1 /etc/httpd/conf.d 放在這里的都是動態網頁的配置文件
  2 /etc/httpd/conf/httpd.conf 主配置文件
  3 /var/log/httpd   日志文件目錄。
  4 /var/www/html 網頁的存放目錄
  5 /etc/rc.d/init.d 工具文件目錄。
  6 vi /etc/httpd/conf/httpd.conf
  Section 1: Global Environment(全局設置)
  ServerRoot "/etc/httpd" (APACHE安裝路徑)
  DirectoryIndex index.html index.html.var (網頁首頁的第一頁)
  Timeout 300 (超出時間)
  KeepAlive Off(保持Httpd激活)
  MaxKeepAliveRequests 100 (保持的連接的人數,改成0就是說沒有人數的限制)
  KeepAliveTimeout 15 (保持激活的超出時間)
  prefork MPM (預派生模式)
  worker MPM (工作者模式)
  Listen 80 (偵聽的端口)
  LoadModule (加載模塊)
  Section 2: 'Main' server configuration(服務器配置)
  User apache Group apache (由誰啟動APACHE服務器)
  ServerAdmin root@localhost (網頁出錯給誰發信通知)
  ServerName new.host.name:80(設置網站的域名)
  DocumentRoot "/var/www/html"(網頁存放的路徑)
  <Directory /> (目錄容器)
  Options (選項) FollowSymLinks(允許符號連接,允許這個網頁以外的地方)
  AccessFileName .htaccess(訪問文件定義名稱文件容器)
  <Files ~ "^\.ht"> 想把所有以 .ht 開頭的文件做限制
  Order allow,deny 定義訪問順序 先允許,后拒絕
  Deny from all  拒絕所有人
  </Files>
  Section 3: Virtual Hosts (虛擬主機)
  NameVirtualHost * (虛擬主機工作的IP)
  ServerAdmin webmaster@dummy-host.example.com (虛擬主機的管理員的郵件地址)
  DocumentRoot /www/docs/dummy-host.example.com (網頁放在那)
  ServerName dummy-host.example.com (主機名是什么)
  ErrorLog logs/dummy-host.example.com-error_log(錯誤日記路徑)
  CustomLog logs/dummy-host.example.com-access_log common(訪問日志路徑)
  1 基于IP的虛擬主機
  1 NameVirtualHost * 放開
  2 <VirtualHost 192.168.0.12:80>
  ServerAdmin webmaster@yirehe.com
  DocumentRoot /web1
  ServerName [url]www.yirehe.com[/url]
  ErrorLog logs/www.yirehe.com-error_log
  CustomLog logs/www.yirehe.com-access_log common
  </VirtualHost>
  3 <VirtualHost 192.168.0.13:80>
  ServerAdmin webmaster@zuanmou.com
  DocumentRoot /web2
  ServerName [url]www.zuanmou.com[/url]
  ErrorLog logs/www.zuanmou.com-error_log
  CustomLog logs/www.zuanmou.com-access_log common
  </VirtualHost>
  2 基于端口的虛擬主機
  1 NameVirtualHost 192.168.0.12 放開
  2 <VirtualHost 192.168.0.12:8080>
  ServerAdmin webmaster@yirehe.com
  DocumentRoot /web1
  ServerName [url]www.yirehe.com[/url]
  ErrorLog logs/www.yirehe.com-error_log
  CustomLog logs/www.yirehe.com-access_log common
  </VirtualHost>
  3 <VirtualHost 192.168.0.12:80>
  ServerAdmin webmaster@zuanmou.com
  DocumentRoot /web2
  ServerName [url]www.zuanmou.com[/url]
  ErrorLog logs/www.zuanmou.com-error_log
  CustomLog logs/www.zuanmou.com-access_log common
  </VirtualHost>
  3 基于主機頭的虛擬主機
  1 NameVirtualHost 192.168.0.12:80 放開
  2 <VirtualHost 192.168.0.12:80>
  ServerAdmin webmaster@yirehe.com
  DocumentRoot /web1
  ServerName [url]www.yirehe.com[/url]
  ErrorLog logs/www.yirehe.com-error_log
  CustomLog logs/www.yirehe.com-access_log common
  </VirtualHost>
  3 <VirtualHost 192.168.0.12:80>
  ServerAdmin webmaster@zuanmou.com
  DocumentRoot /web2
  ServerName [url]www.zuanmou.com[/url]
  ErrorLog logs/www.zuanmou.com-error_log
  CustomLog logs/www.zuanmou.com-access_log common
  </VirtualHost>
  4 做虛擬目錄的認證
  1找到 /Alias
  2 Alias /xinwe/ "/usr/web1"
  <Directory "/usr/web1">
  Options Indexes MultiViews
  AllowOverride None
  Order allow,deny
  Allow from all
  AuthName "huiyuan"
  AuthType Basic
  AuthUserFile /etc/pass
  require valid-user tom1 tom2
  </Directory>
  3 htpasswd -c /etc/pass tom1
  4 htpasswd -c /etc/pass tom2
  5 chown apache.apache /etc/pass
  6 service httpd reload
  另一種方式也可以實現做虛擬目錄的認證
  1 找到 /Alias
  2 Alias /xinwe/ "/usr/web1"
  <Directory "/usr/web1">
  AllowOverride AuthConfig
  </Directory>
  3 然后在/usr/web1文件夾下touch .htaccess 文本文件
  4 vi /usr/web1/.htaccess 在里面寫入
  Options Indexes MultiViews
  Order allow,deny
  Allow from all
  AuthName "huiyuan"
  AuthType Basic
  AuthUserFile /etc/pass
  require valid-user tom1 tom2
  5 chown apache.apache /etc/pass
  htpasswd -c /etc/pass tom1
  htpasswd -c /etc/pass tom2
  service httpd reload
  APACHE有代理局域網上網的功能 把前面的#去掉
  #<IfModule mod_proxy.c>
  #ProxyRequests On  (當等于ON的時候說明打開代理)
  #<Proxy *>
  #    Order deny,allow (把它改成Order allow,deny,)
  #    Deny from all  (把它改成Allow from all)
  #    Allow from .your-domain.com  (局域網網段比如:Allow from 192.168.0.0/24)
  #</Proxy>
  #ProxyVia On (讓代理支持http)
  #CacheRoot "/etc/httpd/proxy" (緩存的路徑)
  #CacheSize 5 (緩存的大。
  #CacheGcInterval 4
  #CacheMaxExpire 24 (緩存最大的過期時間)
  #CacheLastModifiedFactor 0.1
  #CacheDefaultExpire 1 (最短的過期時間)
  #NoCache a-domain.com another-domain.edu joes.garage-sale.com (不緩存那些域名)
  客戶端改IE 依次 工具--Internet選項--連接--局域網設置--勾上為LAN使用使用代理服務器--填寫APACHE主機的
  IP地址比如:192.168.0.20 端口:80
  到這里APACHE的配置講完了。 希望看完我的配置你可以配置網站的服務器!

億恩科技地址(ADD):鄭州市黃河路129號天一大廈608室 郵編(ZIP):450008 傳真(FAX):0371-60123888
   聯系:億恩小凡
   QQ:89317007
   電話:0371-63322206


本文出自:億恩科技【www.laynepeng.cn】

服務器租用/服務器托管中國五強!虛擬主機域名注冊頂級提供商!15年品質保障!--億恩科技[ENKJ.COM]

  • 您可能在找
  • 億恩北京公司:
  • 經營性ICP/ISP證:京B2-20150015
  • 億恩鄭州公司:
  • 經營性ICP/ISP/IDC證:豫B1.B2-20060070
  • 億恩南昌公司:
  • 經營性ICP/ISP證:贛B2-20080012
  • 服務器/云主機 24小時售后服務電話:0371-60135900
  • 虛擬主機/智能建站 24小時售后服務電話:0371-60135900
  • 專注服務器托管17年
    掃掃關注-微信公眾號
    0371-60135900
    Copyright© 1999-2019 ENKJ All Rights Reserved 億恩科技 版權所有  地址:鄭州市高新區翠竹街1號總部企業基地億恩大廈  法律顧問:河南亞太人律師事務所郝建鋒、杜慧月律師   京公網安備41019702002023號
      1
     
     
     
     

    0371-60135900
    7*24小時客服服務熱線