Apache

admin on 六月 21st, 2011

正确使用Expires标识处理,可以使得页面更加有效被缓冲,节约带宽资源。 apache配置: <IfModule mod_expires.c>     ExpiresActive On     ExpiresByType image/gif A2592000     ExpiresByType image/jpeg A2592000     ExpiresByType image/png A2592000     ExpiresByType image/x-icon A2592000     ExpiresByType application/x-javascript A604800     ExpiresByType text/css A604800 </IfModule> 或者 <ifmodule mod_expires.c>         <filesmatch "\.(jpg|gif|png|css|js)$">                 ExpiresActive on                 ExpiresDefault "access plus 600 minutes"         </filesmatch> </ifmodule> 可以选用的时间参数有years    months    weeks    days    hours    [...]

Continue reading about Apache/Nginx 配置 Cache Last-Modified、Expires

974 views

Apache是世界使用排名第一的Web服务器软件。同时也是最稳定、安全的服务器之一。 yum install zlib zlib-devel -y yum install opensll openssl-devel -y groupadd -g 1000 vgroup useradd -u 1000 -g vgroup -d /dev/null -s /bin/false vuser wget http://labs.xiaonei.com/apache-mirror/httpd/httpd-2.2.17.tar.bz2 tar xfj httpd-2.2.17.tar.bz2 -C /usr/local/src/ cd /usr/local/src/httpd-2.2.17 make clean CHOST="x86_64-pc-linux-gnu" CFLAGS="-march=native -O2 -pipe -fomit-frame-pointer" CXXFLAGS="${CFLAGS}" ./configure –prefix=/usr/local/httpd \ –with-mpm=worker \ –enable-expires –enable-headers –enable-rewrite  –enable-deflate –enable-vhost-alias \ –enable-so \ [...]

Continue reading about centos 5.5 x86_64 编译安装httpd-2.2.17、php-5.3.4、memcache扩展

3,757 views

  cpu速度越来越快也更便宜,IDC机房带宽很昂贵,所以用cpu来换取带宽。 apche启用mod_deflate压缩: <ifmodule mod_deflate.c>         DeflateCompressionLevel 9         SetOutputFilter DEFLATE         SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary         SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary         SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary         BrowserMatch ^Mozilla/4 gzip-only-text/html         BrowserMatch ^Mozilla/4\.0[678] no-gzip         BrowserMatch \bMSIE !no-gzip !gzip-only-text/html </ifmodule> nginx 启用gzip压缩: http {    gzip  on;    gzip_min_length  1000;    gzip_buffers     [...]

Continue reading about web服务器使用mod_deflate(apache)gzip(nginx)压缩节约带宽及测试方法

1,215 views
admin on 八月 3rd, 2010

模板下载: http://forums.cacti.net/about9861.html 安装脚本 wget http://forums.cacti.net/download.php?id=9907 gzip -d ws_apachestats.pl.gz cp apache.apache ws_apachestats.pl <path_cacti>/scripts/ chmod 0755 <path_cacti>/scripts/apache.apache ws_apachestats.pl 下载 xml 文件 http://forums.cacti.net/download.php?id=12524 在cacti控制台把 cacti087b_host_template_webserver__apache_444.xml 导入 cacti 客户机配置 <IfModule mod_status.c> <location /server-status>         SetHandler server-status         Order Deny,Allow         Deny from all         Allow from 127.0.0.1         Allow from 192.168.8.8 </location> 监控服务器(192.168.8.8)测试: ./ws_apachestats.pl clint_ip apache_busy_workers:33 apache_idle_workers:42 thread_O:949 threadC:2 [...]

Continue reading about cacti 监控 apache 服务器

1,071 views
admin on 三月 19th, 2010

环境:CentOS 5,Apache/2.2 apache运行正常,重启后不能启动,没有任何错误提示。 排错过程: 检查硬盘分区,空闲容量还很多; 检查错误日志,没有新的内容; 怀疑有人修改配置文件,注释部分内容; 最终找到了原因,原来是apache的error_log达到了2147483647 byte,清空error_log,正常启动。 同样,access_log文件超过2G也会导致不能启动。 当时没有注意2147483647这个数字就是2G-1,其实,从启动是日志中没有任何内容也可以推理问题和日志文件有关。

Continue reading about apache无法启动没有错误提示的可能原因

1,019 views
admin on 十一月 24th, 2009

  多年不用tomcat,应一朋友要求,搭建一个java环境的虚拟主机,经过多次测试,现在把可以正常运行的配置记录下来。 安装jdk cd /usr/local sh /mnt/mysql/jdk-6u14-linux-i586.bin ln -s jdk1.6.0_14/ jdk echo "export JAVA_HOME=/usr/local/jdk export PATH=$JAVA_HOME/bin:$PATH export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib" >> /etc/profile.d/java.sh chmod +x /etc/profile.d/java.sh 安装tomcat wget http://apache.freelamp.com/tomcat/tomcat-6/v6.0.20/bin/apache-tomcat-6.0.20.tar.gz tar xzf apache-tomcat-6.0.20.tar.gz -C /usr/local/ cd /usr/local/ ln -s apache-tomcat-6.0.20/ tomcat vi ~/.bash_profile TOMCAT_HOME=/usr/local/tomcat export PATH TOMCAT_HOME source ~/.bash_profile 安装jk connector wget http://labs.xiaonei.com/apache-mirror/tomcat/tomcat-connectors/jk/source/jk-1.2.28/tomcat-connectors-1.2.28-src.tar.gz tar xfz tomcat-connectors-1.2.28-src.tar.gz -C /usr/local/src/ cd [...]

Continue reading about linux系统apache tomcat虚拟主机安装配置

1,007 views