linux搭建乐网服务器,教你linux搭建web服务器
在我本機配置時間不長,不過花了好長的時間寫了份配置文檔,和大家分享一下,希望對大家有用
LINUX發行版本:Fedora 14 , Apache .2.2
安裝就不說了!依然采用rpm包安裝方式 ,下面進入正題:
httpd.conf配置文件介紹
1、與Apache網絡和系統相關的選項
#使用ServerRoot參數設置Apache安裝目錄
# ServerRoot: The top of the directory tree under which the server's
# configuraTIon, error, and log files are kept.
# you will save yourself a lot of trouble.
# Do NOT add a slash at the end of the directory path.
#
ServerRoot "/etc/httpd"
#使用Listen參數設置Apache監聽端口,Apache默認是80
Listen 80
#使用User參數設置Apache進程的執行者
User apache
#使用Group參數設置Apache進程執行者所屬的用戶組
Group apache
#使用ServerAdmin參數設置網站管理員的郵箱地址
2、與Apache文件和目錄權限相關選項
#使用DocumentRoot參數設置網站根目錄
# 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"
#使用Directory段設置根目錄權限
OpTIons FollowSymLinks
AllowOverride None
#使用Directory段設置/var/www/html目錄權限
OpTIons Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
#設置首頁為index.html
DirectoryIndex index.html index.html.var
#.ht后綴文件的訪問權限控制與上目錄的AllowOverride一起作用
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
Order allow,deny
Deny from all
Satisfy All
3、與Apache日志相關的選項如下
#使用ErrorLog參數設置錯誤日志的位置
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a
# container, that host's errors will be logged there and not here.
#
ErrorLog logs/error_log
#使用LogLevel參數設置錯誤日志的級別
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn
#使用LogFormat參數設置訪問日志的格式模板
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
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
#使用CustomLog參數設置訪問日志的格式模板
# For a single logfile with access, agent, and referer information
# (Combined Logfile Format), use the following directive:
#
CustomLog logs/access_log combined
總結
以上是生活随笔為你收集整理的linux搭建乐网服务器,教你linux搭建web服务器的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【UG NX MCD 机电一体化概念设计
- 下一篇: NuxtJS快速入门