CentOS 5.4下配置Apache服务器(2)
来源:未知 责任编辑:责任编辑 发表时间:2013-11-15 19:50 点击:次
全局配置的相关参数,全局的参数一般不用改哦
ServerType
选择系统激活服务器的方式。可以是inetd或standalone
默认应该是独立的stationalone
ServerRoot
设定Apache 安装的绝对路径
#
ServerRoot "/etc/httpd"
TimeOut
设定 服务器接收至完成的最长等待时间
#
Timeout 120
KeepAlive
设定服务器是否开启连续请求功能,真实服务器一般都要开启
#
KeepAlive Off
MaxKeepAliveRequests
设定服务器所能接受的最大连续请求量
#
MaxKeepAliveRequests 100
#
KeepAliveTimeout 15 \\使用者‘连续’请求的等待时间上限数
##
## Server-Pool Size Regulation (MPM specific)
##
# 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 \\设定激活时所需建立的子进程数
MinSpareServers 5 \\设定最小闲置子进程数
MaxSpareServers 20 \\设定最大闲置子进程数
ServerLimit 256
MaxClients 256 \\设定同时能够提供使用者的最大服务请求数
MaxRequestsPerChild 4000
</IfModule>
Port
设定http服务的默认端口。
User/Group
设定 服务器程序的执行者与属组
#
User apache
Group apache
我们说过,网页文件默认是放在/var/www/html中的,我们现在就自己去写个网页,简单的,来测试下
[root@host ~]# ll /var/www/html/
总计 0
[root@host ~]# echo hello,this is my home,welcome! > /var/www/html/index.html
[root@host ~]# ll /var/www/html/
总计 8
-rw-r--r-- 1 root root 48 02-19 10:50 index.html
[root@host ~]# cat /var/www/html/index.html
hello,this is my home,welcomell!
然后重新访问你的服务器,看看有什么变化

在主配置文件(/etc/httpd/conf/httpd.conf)中,看见DirectoryIndex了么,这个位置就是定义主页文件的名字的,自己可以随意修改,但是一般网页开发都写成了index.html,index.htm default.html 等等
相关新闻>>
- 发表评论
-
- 最新评论 进入详细评论页>>