最近在学习drupal,发现这个程序比xoops、joomla都灵活,对应的学习曲线也高。反正安装后,根本不知道真没设置。呵呵

下面先在nginx上配置了rewrite规则,让drupal支持简洁的URL

复制内容到剪贴板
  1. server
  2. {
  3. listen 80;
  4. server_name drupal.xinlogs.com;
  5. index index.html index.htm index.php;
  6. root /data0/htdocs/drupal;
  7.  
  8. #limit_conn crawler 20;
  9. location = / {
  10. index index.php;
  11. }
  12.  
  13. location / {
  14. index index.php index.html;
  15.  
  16. if (!-f $request_filename) {
  17. rewrite ^(.*)$ /index.php?q=$1 last;
  18. break;
  19. }
  20.  
  21. if (!-d $request_filename) {
  22. rewrite ^(.*)$ /index.php?q=$1 last;
  23. break;
  24. }
  25. }
  26.  
  27. location ~ .*.(php|php5)?$
  28. {
  29. fastcgi_pass unix:/tmp/php-cgi.sock;
  30. #fastcgi_pass 127.0.0.1:9000;
  31. fastcgi_index index.php;
  32. include fcgi.conf;
  33. }
  34.  
  35. location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$
  36. {
  37. expires 30d;
  38. }
  39.  
  40. location ~ .*.(js|css)?$
  41. {
  42. expires 1h;
  43. }
  44.  
  45. log_format drupal_access '$remote_addr - $remote_user [$time_local] "$request" '
  46. '$status $body_bytes_sent "$http_referer" '
  47. '"$http_user_agent" $http_x_forwarded_for';
  48. access_log /data1/logs/drupal_access.log drupal_access;
  49. }