精品丰满熟女一区二区三区_五月天亚洲欧美综合网_亚洲青青青在线观看_国产一区二区精选

  • <menu id="29e66"></menu>

    <bdo id="29e66"><mark id="29e66"><legend id="29e66"></legend></mark></bdo>

  • <pre id="29e66"><tt id="29e66"><rt id="29e66"></rt></tt></pre>

      <label id="29e66"></label><address id="29e66"><mark id="29e66"><strike id="29e66"></strike></mark></address>
      學(xué)習(xí)啦>學(xué)習(xí)電腦>操作系統(tǒng)>Linux教程>

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

      時(shí)間: 春健736 分享

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

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

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

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

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

        [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)頁缺省下顯示紅帽測試頁

        <報(bào)錯(cuò)頁面存放位置/var/www/error/noindex.html>

        (6)打開配置文件

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

        可獲得以下重要字段:

        目錄設(shè)置:

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

        訪問位置設(shè)置:

        <LocationURL> .. .. </Location>

        虛擬主機(jī)設(shè)置:

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

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

        ServerName本站點(diǎn)的FQDN名稱

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

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

        ErrorLog錯(cuò)誤日志文件的位置

        CustomLog 訪問日志文件的位置

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

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

        Timeout網(wǎng)絡(luò)連接超時(shí),默認(rèn) 300 秒

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

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

        KeepAliveTimeout保持連接的超時(shí)時(shí)限

        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 配置項(xiàng),定義控制順序

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

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

        II,Allow/Deny from 配置項(xiàng),設(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ù)水平考試二級實(shí)踐指導(dǎo)書

      648961