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 等等

发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
用户名: 验证码:点击我更换图片
最新评论 更多>>

推荐热点

  • /etc/fstab 详解
  • nginx主主集群
  •  LVS-NAT和LVS-DR模式的实现详解
  •  RHCE考试之磁盘配额
  • 学习笔记:ACL详解
  • suse linux双网卡双网关配置
  •  LVM逻辑卷管理器
  •  Nginx主主负载均衡架构
  • ubuntu学习Mysql

快速直达

操作系统导航

LinuxWindows虚拟机
网站首页 - 友情链接 - 网站地图 - TAG标签 - RSS订阅 - 内容搜索
Copyright © 2008-2015 计算机技术学习交流网. 版权所有

豫ICP备11007008号-1