apache中对域名全局禁用etag之类的东西

etag不比last-modified强。且etag容易引入问题,如果你后台有多个服务器。我只有一台服务器,但也不想用etag。因为last-modified足够了。多一个etag,等于白白消耗web server处理能力。于是我决定在apache中全局禁用etag。

  <IfModule mod_expires.c>
    # Enable expirations.
    ExpiresActive On
    # Cache all files for 2 weeks after access (A).
    #  ExpiresDefault A360000000000
    # Do not cache dynamically generated pages.
    ExpiresByType text/html A1
  # 在这里我让本virtualhost中默认就不使用etag
  Header unset Pragma
  FileETag None
  Header unset ETag
  # 这里是我开始只针对某些文件unset掉etag
  # 现在可以不用了

drupal网站动态内容和静态内容分离

我现在直接使用nginx就可以做到

nginx的conf中写好了,静态文件包括boost cache直接给nginx处理。php相关的给后台的php-cgi。

lightttpd的例子,使用两个域名!

下面是挺早的一个例子了。有参考价值。现在大部分情况不需要这么搞了吧。

http://www.lullabot.com/articles/using-lighttpd-static-file-...
Simpler approach
I use a much simpler approach.
(1) Set up a fast http server on a different port or different server (I wrote my own).
(2) Redirect requests to static files (like files in the /files folder or images) via mod_rewrite to this server.
But anyway, think it's a very useful idea to have different servers here!

在bash中查看phpInfo的信息

 echo "<?php phpinfo(); ?>" | php > phpinfo.txt

这个命令把phpinfo出来的信息存放到phpinfo.txt中了。这个命令还可以使用grep。比如寻找所有含有soap的行
echo "" | php |grep soap
非常好用。

快速查看各种上传大小限制:
echo "" | php |grep soap
post_max_size => 8M => 8M
realpath_cache_size => 16K => 16K
upload_max_filesize => 2M => 2M

mysql的超时让我们的模块无法正常工作

有一个程序,是导入pdf并转换成swf,运行在drupal上。production上导导就断了。testing上一开始导好几个小时都没事。

我们从模块检查,php超时检查,php错误检查,apache超时检查,怎么都不行。最后我偶然想到是Mysql超时的问题。

正解!:)

production

mysql> show global variables like 'wait_timeout';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout | 60 |

因为程序牵扯到往mysql中写数据,而60秒就超时太短了。因为程序会先告诉drupal我要导入一本书,写入书的题目,此时mysql链接就打开了。然后程序会去转换pdf,转换完了,再把生成文件的地址写入node的字段。如果转换超过60秒,就超时了。就停了。就是这个原因。

testing

Variable_name | Value |
+---------------+-------+
| wait_timeout | 28800 |
+---------------+-------+