国产宅男网站在线|亚洲A级性爱免费视频|亚洲中精品级在线|午夜福利AA毛

  • <dd id="gf5jf"><th id="gf5jf"></th></dd>

    <cite id="gf5jf"><label id="gf5jf"></label></cite>
  • <div id="gf5jf"><listing id="gf5jf"></listing></div>
    學習啦>學習電腦>操作系統(tǒng)>Linux教程>

    Linux怎么搭建Web服務(wù)器

    時間: 春健736 分享

      Web服務(wù)器一般指網(wǎng)站服務(wù)器,是指駐留于因特網(wǎng)上某種類型計算機的程序,可以向瀏覽器等Web客戶端提供文檔,[1] 也可以放置網(wǎng)站文件,讓全世界瀏覽;可以放置數(shù)據(jù)文件,讓全世界下載。那么Linux怎么搭建Web服務(wù)器?下面跟著學習啦小編一起來了解一下吧。

      Linux怎么搭建Web服務(wù)器

      1,基于apache的web服務(wù)器基礎(chǔ)搭建:

      (1)實驗環(huán)境:一臺ip為192.168.10.10的rhel5.9主機作為web服務(wù)器,一臺ip為192.168.10.15的win7主機作為測試機

      (2)查看服務(wù)主機軟件是否安裝

      [root@ser1 ~]# rpm -q httpd httpd-manual httpd-devel

      package httpd is not installed

      package httpd-manual is not installed

      package httpd-devel is not installed

      (3)安裝軟件包

      [root@ser1 ~]# yum install -y httpd httpd-manual httpd-devel

      (4)啟動服務(wù)

      [root@ser1 ~]# service httpd start

      啟動httpd: [確定]

      [root@ser1 ~]# chkconfig httpd on

      (5)在win7上測試,無網(wǎng)頁缺省下顯示紅帽測試頁

      <報錯頁面存放位置/var/www/error/noindex.html>

      (6)打開配置文件

      [root@ser1 ~]# vim /etc/httpd/conf/httpd.conf

      可獲得以下重要字段:

      目錄設(shè)置:

      <Directory 目錄> .. .. </Directory>

      訪問位置設(shè)置:

      <LocationURL> .. .. </Location>

      虛擬主機設(shè)置:

      <VirtualHost 監(jiān)聽地址> .. .. </VirtualHost>

      常用的全局設(shè)置參數(shù):

      ServerName本站點的FQDN名稱

      DocumentRoot網(wǎng)頁文檔的根目錄:缺省/var/www/html/

      DirectoryIndex默認索引頁/首頁文件:一般設(shè)為index.html index.php

      ErrorLog錯誤日志文件的位置

      CustomLog 訪問日志文件的位置

      Listen 監(jiān)聽服務(wù)的IP地址、端口號

      ServerRoot 服務(wù)目錄:/etc/httpd/

      Timeout網(wǎng)絡(luò)連接超時,默認 300 秒

      KeepAlive是否保持連接,可選On或Off

      MaxKeepAliveRequests每次連接最多處理的請求數(shù)

      KeepAliveTimeout保持連接的超時時限

      Include 可包含其他子配置文件: /etc/httpd/conf.d/

      (7)創(chuàng)建測試網(wǎng)頁

      [root@ser1 ~]# vim /var/www/html/index.html

      <h1>

      This is a test page !!!

      </h1>

      ~

      (8)win7下測試,主頁變?yōu)闇y試網(wǎng)頁

      2,基于apache的web服務(wù)器的訪問控制:

      (1)web服務(wù)的地址限制

      I,rder 配置項,定義控制順序

      allow,deny 先允許后拒絕,缺省拒絕所有;沖突時,拒絕生效;allow不設(shè)置,拒絕所有

      deny,allow 先拒絕后允許,缺省允許所有;沖突時,允許生效;deny不設(shè)置,允許所有

      II,Allow/Deny from 配置項,設(shè)置權(quán)限

      Allow from 地址1 地址2 .. ..

      Deny from 地址1 地址2 .. ..

      配置如下:

      [root@ser1 ~]# vim /etc/httpd/conf/httpd.conf

      331 #

      332 Orderallow,deny

      333 Allowfrom 192.168.20.0/24

      334

      335 </Directory>

      [root@ser1 ~]# service httpd restart……重啟服務(wù)

      停止httpd: [確定]

      啟動httpd: [確定]

      在win7上測試,測試完成并還原配置文件:

      看過“ Linux怎么搭建Web服務(wù)器 ”的人還看了:

    1.win7如何搭建Web服務(wù)器

    2.基于WebRTC的瀏覽器端Web服務(wù)器的研究論文

    3.LINUX下配置管理APACHE服務(wù)器的方法

    4.如何安全設(shè)置Apache Web服務(wù)器

    5.全國網(wǎng)絡(luò)技術(shù)水平考試二級實踐指導書

    648961