# 在此設定檔內所有設定的相對路徑,會在這個絕對路徑之下,記得後面不要加/

# ex: PidFile run/httpd.pid => /etc/httpd/run/httpd.pid

# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.

#
# Do NOT add a slash at the end of the directory path.
#
ServerRoot "/etc/httpd"

# 等待時間超過120秒將會中斷連線
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 120
 

# On代表允許一次連線可進行多個檔案的傳送
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On
 

# 每個使用者每次連線可傳送的資料數量,0表示無限制
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 500
 

# Apache針對使用者的不同需求,提供兩種預設的模組,供管理者切換

# profork佔用較大的記憶體,而且可以在平台上面進行debug

# worker佔用的記憶體較小,流量較大
# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# ServerLimit: maximum value for MaxClients for the lifetime of the server
# MaxClients: maximum number of server processes allowed to start

# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule prefork.c>
StartServers 8

# StartServers代表啟動Apache時,啟動的process數量
MinSpareServers 5
MaxSpareServers 20

ServerLimit 256
MaxClients 256

# MaxClients代表同時可連上sever的人數限制
MaxRequestsPerChild 4000
</IfModule>

 

# worker MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule worker.c>
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>
 

# /usr/sbin/httpd        => prefork

# /usr/sbin/httpd.worker => worker

#

# /etc/sysconfig/httpd 可以去這裡進行修改、切換兩種不同的模式

# HTTPD=/usr/sbin/httpd.worker 此檔案下的某一行訊息,表示目前90使用worker模組

 

 

# 所有放置到 /etc/httpd/conf.d/*.conf 的設定都會被讀取(延伸的設定檔)
# Load config files from the config directory "/etc/httpd/conf.d".
#
Include conf.d/*.conf


# 當網站出現問題時,顯示的聯絡信箱
# ServerAdmin: Your address, where problems with the server should be
# e-mailed. This address appears on some server-generated pages, such
# as error documents. e.g. admin@your-domain.com
#
ServerAdmin root@localhost
 

# 資料編碼:UTF-8(萬國碼),Big5(繁體中文編碼)
# Specify a default charset for all content served; this enables
# interpretation of all content as UTF-8 by default. To use the
# default browser choice (ISO-8859-1), or to allow the META tags
# in HTML content to override this choice, comment out this
# directive:
#
AddDefaultCharset Big5
 

# 預設放置網頁的目錄

# /var/www/html/ => htttp://www.chem.ccu.edu.tw/
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/var/www/html"
 

# 使每個使用者都能擁有自己控管的網頁
# UserDir is disabled by default since it can confirm the presence
# of a username on the system (depending on home directory
# permissions).
#
#UserDir disabled
 

# ex: 使用者名稱為 lab409,該使用者則會以 /home/lab409/WWW/ 為放置網頁的目錄

# /home/lab409/WWW/ => http://www.chem.ccu.edu.tw/~lab409/

# (實驗室主機 IP:lab409.chem.ccu.edu.tw,則是以 /home/lab409/public_html/ 為放置網頁的目錄)

#

# 所有新增的使用者,會依照 /etc/skel/ 下的資料夾預設目錄

# ex: /etc/skel/ 下新增資料夾 WWW,新增的使用者 /home/lab409/ 則會出現 WWW 資料夾

#

# To enable requests to /~user/ to serve the user's public_html
# directory, remove the "UserDir disabled" line above, and uncomment
# the following line instead:
#
UserDir WWW
 

# 首頁的檔名和格式
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
# The index.html.var file (a type-map) is used to deliver content-
# negotiated documents. The MultiViews Option can be used for the
# same purpose, but it is much slower.
#
DirectoryIndex index.htm index.html index.html.var
 

# 和網頁的保護有關,受保護的目錄可以使用.htaccess的檔案格式
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives. See also the AllowOverride
# directive.
#
AccessFileName .htaccess

#
和網頁的保護有關,詳情可見進階設定的部份
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>
 

# 連結 /icons/ 目錄和 /var/www/icons/ 目錄

# /icons/ => /var/www/html/icons/ => /var/www/icons/
# Aliases: Add here as many aliases as you need (with no limit). The format is
# Alias fakename realname
#
# Note that if you include a trailing / on fakename then the server will
# require it to be present in the URL. So "/icons" isn't aliased in this
# example, only "/icons/". If the fakename is slash-terminated, then the
# realname must also be slash terminated, and if the fakename omits the
# trailing slash, the realname must also omit it.
#
# We include the /icons/ alias for FancyIndexed directory listings. If you
# do not use FancyIndexing, you may comment this out.
#
Alias /icons/ "/var/www/icons/"