您正在查看 "web(iis,apache&squid-cache)" 分类下的文章
2008-01-08 14:19
如果页面没有用到iframe的话,可以这样:
在css里面或者js里面写一个
<style type="text/css">
iframe{v:expression(this.src='about:blank',this.outerHTML='');}
</style> |
2007-11-10 13:51
来自yahoo建议。
- Make Fewer HTTP Requests 更少的http请求
- Use a Content Delivery Network 使用CDN(内容分发网络)
- Add an Expires Header 指定过期时间
- Gzip Components 压缩结构
- Put Stylesheets at the Top 样式表文件在顶部
- Put Scripts at the Bottom 脚本在底部
- Avoid CSS Expressions 不在css中使用表达式
- Make JavaScript and CSS External 将javascript和css文件分离到单独的文件
|
2007-10-30 17:11
由于页面问题或web服务器临时不可用,会导致squid缓存一个错误信息(400,500等错误),正好是首页出错并被老板发现了。。。。
如何不缓存这些错误页面呢?
要想不缓存错误页面据说可以设成negative_ttl 1 second
# TAG: negative_ttl time-units
# Time-to-Live (TTL) for failed requests. Certain types of
# failures (such as "connection refused" and |
2007-10-22 10:13
把PHP解压缩.到C:\php
修改目录里面的php.ini-dist为php.ini,
然后用记事本打开,查询extension=php_mysql.dll ,还有php_gd2等,把前面的;去掉.保存退出.这样,PHP5就支持MYSQL了.再搜索
extension_dir
修改为
extension_dir = "C:\php\ext"
把php.ini复制到C:\windows目录
接下来,在IIS的站点属性里面的ISAPI筛选器里面,添加一个
筛选器名称 PHP
可执行文件 C:\php\php5isapi.dll
然后在"主目录"的"配置"里面"映射 |
2007-09-29 16:00
最近网站改版,原来的频道、栏目页的文件都在/index/目录下
新版直接从根目录开始,要求把原来的频道、栏目页访问跳转至新的页面。
还好,目录结构除了少个index外,其余的都是一样的
察看了一下mod_alias的文档:
RedirectMatch permanent ^/index/(.*)/$ /$1/
RedirectMatch permanent ^/index/(.*)/list.shtml$ /$1/index.shtml |
2007-07-02 13:39
先安装mysql,apache2,把php5解压到c:\php5目录。
编辑httpd.conf文件:
LoadModule php5_module "c:\php5\php5apache2.dll"
PHPIniDir "C:\php5\php.ini"
DirectoryIndex index.html index.php index.htm
把php.ini-dist改为php.ini
extension_dir = "C:/php5/ext"
测试phpinfo信息,检查是否正确。
要安装pear的话,直接运行go-pear.bat即可 |
2007-06-06 18:22
#cd /usr/ports/www/apache22
#make install clean
安装好后,启动apache
# apachectl start
httpd: apr_sockaddr_info_get() failed for
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[Wed Jun 06 18:13:13 2007] [warn] (2)No such file or directory: Failed to enable
需要修改httpd.conf文件,ServerName=www.example.com
察看error日志:
[Wed Jun 06 18:18:56 2007] [alert] (EAI 8)hostname nor servname p |
2007-05-12 23:28
httpd.conf配置
LoadModule include_module libexec/apache2/mod_include.so
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
必须在httpd.conf或.htaccess文件中有如下配置:
Options +Includes
include测试:
<!--#include virtual="/layouts/copy.html" --> |
2007-04-06 10:46
SQUID之refresh_pattern使用方法
refresh_pattern 大概是 squid 最有意思但最不好懂的配置参数了,经过看书,大概明白如何使用,写出来贡献。
记住refresh_pattern 只对后端没设置Expires过期时间的页面起作用,比如论坛页面;而对类似apache mod_expires 设置过的页面不起作用。
说明之前,先将个概念LM,LM就是页面Header里时间(Date)和Last-Modified时间的差。Date一般是Squid从后面取页面的时间,Last-Modified 一般是页面生成时间。
refresh_pattern 的语法是
|
2007-03-27 14:02
#cd /usr/port/www/squid
#make install clean
#vi /usr/local/etc/squid/squid.conf 需要修改几个参数,根据实际情况确定
http_port 80 accel vhost vport
cache_peer www.xxxx.com parent 80 0 no-query originserver
cache_mem 256 MB
maximum_object_size_in_memory 80 KB
cache_dir ufs /usr/local/squid/cache 1000 16 256
logformat combined %>a %ui %un [%tl] "%rm %ru HTTP/%rv" %Hs %<st "%{Referer}>h" "%{User-Agent}>h" %Ss:%Sh
acc |
2007-03-19 09:45
修改httpd.conf,添加类似如下内容:
<VirtualHost *:80>
ServerName "www.win3c.com"
ServerAdmin win3c@gmail.com
DocumentRoot "/opt/www/myweb"
</VirtualHost>
<VirtualHost *:80>
ServerName "www.w |
2007-03-15 18:50
2007-03-15 15:44
Description: The Error means The connection with the server has been terminated.
问题描述:这个错误是由于服务器连接被中断导致的。
If you check out the C:\Windows\system32\LogFiles\HTTPERR\httperr*.log files on the distribution server, you'll likely see either Timer_MinBytesPerSecond errors or Timer_ConnectionIdle errors. These are caused by IIS' default settings, contained within its metabase, which define the minimum traffic flow rate for a connection to be kept alive and the ma |
2007-02-28 19:25
apache的泛域名解析:
而如果没有所对应的二级域名时,比如 xxx.265.com 时,系统就会自动跳转到 www.265.com 这个主页面上来
做apache 范域名解析
DNS中设定*.265.com 到某IP
然后在 httpd.conf 里
<VirtualHost *>
ServerName u.265.com
# ... ...有用的子域名
</VirtualHost>
<VirtualHost *>
ServerAlias *.265.com
Redirect 301 / http://www.265.co |
2007-02-08 17:02
单个用户认证:
如果你打算使用 .htaccess文件,则必须设置服务器以允许在这些文件中使用认证指令,即用 AllowOverride指令指定哪些指令在针对单个目录的配置文件中有效:
AllowOverride AuthConfig
Apache在其安装目录的bin子目录中提供了htpassw |
|
| |