日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

linux搭建乐网服务器,教你linux搭建web服务器

發布時間:2023/12/10 linux 39 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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服务器的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。