瀏覽模式: 普通 | 列表

Apache 模組 mod_access 限制管理存取連線

只設定 Order Allow, Deny 即拒絕全部,如有其它規則 Allow from all、Deny from all 等,會以 Allow 優先處理
而只設定 Order Deny, Allow 就相反過來,允許全部,如有其它規則 Allow from all、Deny from all 等,會以 Deny 優先處理

只允許 10.1.1.1 連線可設定為

  1. Order Allow,Deny
  2. Allow from 10.1.1.1

不可以這樣設,這樣就全部允許了
  1. Order Deny,Allow
  2. Allow from 10.1.1.1

不過加一條 Deny 上去即可,它會先讀 Deny 再讀 Allow
  1. Order Deny,Allow
  2. Allow from 10.1.1.1
  3. Deny from all

比較四種情況

[閱讀全文]

Apache 模組: 頻寬限制 mod_cband

mod_cband 可以達到對 virtualhost 作頻寬、連線數限制,且總流量到了某階段可以重導至某個頁面作提示或者直接對速度作設限

1.) yum 安裝 mod_cband

2.) 設定狀態瀏覽,vi /etc/httpd/conf.d/mod_cband.conf

LoadModule cband_module         modules/mod_cband.so

<Location /cband-status>
SetHandler cband-status
Order allow,deny
Allow from 127.0.0.1/32 10.1.1.0/24
</Location>

<Location /cband-status-me>
SetHandler cband-status-me
Order allow,deny

[閱讀全文]

標籤: apache

Apache 模組 mod_watch - 畫每個網站的 mrtg 圖

環境
cross.tw 192.168.1.93
cross2.tw 192.168.1.93

1.) 下載 http://updates.interworx.info/iworx/legacy/sources/
2.) 安裝 mod_watch 給 Apache
   a.) 在編譯時讓程式知道 apxs 在那裡
      vi Makefile.dso

#
# The location of apxs utility.
#
APXS=/usr/sbin/apxs

   b.) 開始編譯

      make -f Makefile.dso install

[閱讀全文]

apache 模組 mod_log 記錄訊息

error_log記錄檔
   -記錄錯誤訊息
   -等級分[debug/info/notice/warm/error/crit/alert/emerg],,往右越簡單
   -由LogLevel參數來定義記錄等級,預設為warm

access_log記錄檔
   -記錄存取訊息
   -等級分[combined/common/referer/agent],往右越簡單,(看LogFormat 就可知)
   -由LogFormat來定義名稱及它的格式為何

# 名稱 combined 它的格式為 "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i""
LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" combined
LogFormat "%h %l %u %t "%r" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

變數解譯

[閱讀全文]

標籤: apache mod_log log

Web Server有那幾種

  • Apache
What IS the Apache HTTP Server Project? 
The Apache HTTP Server Project is a collaborative software development effort aimed at creating a robust, commercial-grade, featureful, and freely-available source code implementation of an HTTP (Web) server. The project is jointly managed by a group of volunteers located around the world, using the Internet and the Web to communicate, plan, and develop the server and its related documentation. This project is part of the Apache Software Foundation. In addition, hundreds of users have contributed ideas, code, and documentation to the project. This file is intended to briefly describe the history of the Apache HTTP Server and recognize the many contributors.
Flexible and Fast Web server
Cherokee is a very fast, flexible and easy to configure Web Server. It supports the widespread technologies nowadays: FastCGI, SCGI, PHP, CGI, TLS and SSL encrypted connections, Virtual hosts, Authentication, on the fly encoding, Apache compatible log files, and much more.
  • IIS
  • lighttpd
  • nginx

當 top時,發現某個http的負載很高,我要怎麼查出它是那一個domain在作怪,

apache的模組 mod_status 可以設定  /server-status (如下)

attachments/200706/2313535438.jpg


設定 httpd.conf

[閱讀全文]

apache+mod_ssl+openssl+php+mm+mysql重新編譯

apache_1.3.37 + mod_ssl-2.8.28-1.3.37 + openssl-0.9.8e + php-4.4.7 + mm-1.4.2 + mysql-4.1.22

Tarball Compiling

openssl-0.9.8e
sh config no-idea no-threads -fPIC && make && make test

mm-1.4.2
./configure --disable-shared && make

mod_ssl-2.8.28-1.3.37
./configure --with-apache=../apache_1.3.37 --with-ssl=../openssl-0.9.8e --with-mm=../mm-1.4.2 --prefix=/usr/local/apache/ && cd ../apache_1.3.37

apache_1.3.37

[1.] ./configure --prefix=/usr/local/apache --enable-module=most --enable-shared=max && make 
   
   [Q1:] apache_1.3.37]# make
gcc -c  -I../../os/unix -I../../include   -DLINUX=22 -DHAVE_SET_DUMPABLE -DNO_DBM_REWRITEMAP -DUSE_HSREGEX -DUSE_EXPAT -I../../lib/expat-lite `../../apaci` -fpic -DSHARED_MODULE mod_auth_dbm.c && mv mod_auth_dbm.o mod_auth_dbm.lo

[閱讀全文]