安装APACHE心得

从来没用过APACHE ,今天下了个,就扔到服务器上了。
因为网站是商务网站,所以产品图片的数量难以估计,一直用的是TOMCAT,但是TOMCAT处理图片下载和静态资源的能力,真的不敢恭维,搞的网站图片资源下载速度很慢。听说APACHE不错,就搞一个来看下。

下载的是 apache-httpd-2.0X.tar.gz 的压缩包。
然后在 LINUX下解压缩
tar -xzvf apache-httpd-2.0x.tar.gz
解压缩到一个 httpd 的目录
cd httpd
配制APACHE
./configure --prefix=/usr/local/httpd --enable-so --enable-mods-shared=all --enable-rewrite=shared --enable-speling=shared

make

make install
MAKE和 MAKE INSTALL大概要花些时间 ,请耐心等待

然后修改 $apache_path/conf/httpd.conf
listen 60.191.110.134:8080 因为80端口被TOMCAT占用,所以先用8080

设置图片存放路径的服务名

 

Alias /imagesave "/webservice/webdoc/web/csproject/imagesave"

<Directory "/webservice/webdoc/web/csproject/imagesave">
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride None

    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all

</Directory>

设置APACHE的优化配置

Timeout 23000
KeepAlive On
MaxKeepAliveRequests 0
KeepAliveTimeout 30
<ifModule prefork.c>
        StartServers 15
        MinSpareServers 15
        MaxSpareServers 20
        MaxClients 200
        MaxRequestsPerChild 0
</ifModule>
<IfModule worker.c>
StartServers 2
MaxClients 200
MinSpareThreads 50
MaxSpareThreads 100
ThreadsPerChild 30
MaxRequestsPerChild 0
</IfModule>
<IfModule perchild.c>
NumServers 5
StartThreads 5
MinSpareThreads 5
MaxSpareThreads 10
MaxThreadsPerChild 20
MaxRequestsPerChild 0
</IfModule>

启动APACHE
./apachel start

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值