安装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
页:
[1]