日期:2014-05-17  浏览次数:20651 次

Debian中安装Apache
1、安装者#aptitude install apache2 apache2-utils    apache2-utils提供了我们在配置维护过程中非常有用的一些工具。
2、启停Apache 服务:    # /etc/init.d/apache2 start/stop
3、打开浏览器输入http://localhost/ 或http://127.0.0.1/ 来访问已经启动的Apache服务器,向浏览器返回一个Apache安装成功的页面.
4、配置文件说明 (/etc/apache2下)
    apache2.conf envvars    mods-available ports.conf       sites-enabled
conf.d          httpd.conf mods-enabled    sites-available
       1>   apache2.conf     主配置文件.
                1   ServerRoot "/etc/apache2" The top of the directory tree under which the server's   configuration, error, and log files are kept.ServerRoot指令设置了服务器所在的目录。
             2   LockFile /var/lock/apache2/accept.lock    The accept serialization lock file MUST BE STORED ON A LOCAL DISK. 指定httpd配置文件守护进程的加锁文件。如果ServerRoot为NFS文件系统(在文件加锁方面能力有限),便需要使用这个参数指定本地文件系统中的路径.
                3   PidFile ${APACHE_PID_FILE}   The file in which the server should record its process
identification number when it starts.指定记录httpd配置文件守护进程的进程号的文件。
                4   Timeout 300 The number of seconds before receives and sends time out.
             5   KeepAlive on|off    Whether or not to allow persistent connections 在某些情况下,这样的方式会对包含大量图片的HTML文档造成的延时起到50%的加速作用。
                6   MaxKeepAliveRequests 100   The maximum number of requests to allow during a persistent connection.
                7   KeepAliveTimeout 15   Number of seconds to wait for the next request from the
# same client on the same connection.
                8   <IfModule mpm_prefork_module>
                            StartServers          5 number of server processes to start
                            MinSp   areServers       5   minimum number of server processes which are kept spare
                            MaxSpareServers      10   maximum number of server processes which are kept spare
                          MaxClients          150   maximum number of server processes allowed to start
                            MaxRequestsPerChild   0   maximum number of requests a server process serves
        &nbs