ufcms:从windows/apache转到linux/nginx
来源:互联网 发布:淘宝客活动广场攻略 编辑:程序博客网 时间:2024/03/29 16:56
关联链接:
ufcms:yii based cms system programming notes
主要有两点:
1. 需要把apache vhost的配置改为nginx vhost的配置
2. 需要把.htaccess文件修改为符合nginx语法规则的文件
nginx vhost配置参考如下:
server { listen 80; server_name open.iefreer.org; index index.html index.htm index.php; access_log /var/log/nginx/td.access.log access; error_log /var/log/nginx/cms.error.log error; root /home/www/phpsite/cms; include /home/www/phpsite/cms/.htaccess; location ~ /(protected|framework|themes/\w+/views|docs\.php) { deny all; # for production internal; log_not_found off; access_log off; } location ~ \.php$ { fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } location ~ /(\.svn|\.git|\.DS) { } location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { expires 30d; log_not_found off; } }
cms/.htaccess在apache下是:
Options +FollowSymLinksIndexIgnore */*RewriteEngine onRewriteBase /#AdminRewriteRule ^admin$ index.php?r=Cms/admin/home#InstallRewriteRule ^install$ install.php?r=Install/default# if a directory or a file exists, use it directlyRewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteCond %{REQUEST_URI} !.(js|ico|gif|jpg|png|css)$# otherwise forward it to index.phpRewriteRule ^.*$ /index.php [L]
可通过在线工具进行Rewrite Rule转换:
http://www.anilcetin.com/convert-apache-htaccess-to-nginx/
nginx的规则很简洁, 结果如下:
rewrite ^/admin$ /index.php?r=Cms/admin/home;rewrite ^/install$ /install.php?r=Install/default;rewrite ^/.*$ /index.php last;
如果上述规则不配置好, 要不会出现nginx无法启动的错误, 要不会出现403.
iefreer
- ufcms:从windows/apache转到linux/nginx
- 从Windows转到Linux/Unix
- 从windows/linux转到mac os
- 抛弃windows xp转到linux
- 谈谈apache的htaccess伪静态规则转到nginx
- 从Windows转到DOS下开发的一些心得体会
- Windows下将硬盘分区格式从FAT32转到NTFS
- 我是如何从桌面维护转到Linux系统运维
- 我是如何从桌面维护转到Linux系统运维
- Windows 转到linux下C++编程的过程
- Windows转到linux中,文件乱码,文件编码转换
- Windows文件转到linux后,出现中文乱码问题
- 从thunderbird转到outlook
- 从iteye转到csdn
- 从editplus转到gvim
- apache,nginx.iis 从写规则转换
- WordPress从Apache迁移到Nginx过程
- 从windows转投linux
- Android动态加载jar/dex
- Ubuntu VMwareTools 的 rpm 包安装方法
- jquery.js+jquery.corner.js实现tooltip提示框
- topcoder插件安装
- Huffman编码树
- ufcms:从windows/apache转到linux/nginx
- java下载文件的几种方法
- 帕累托法则(Pareto Principle)、二八定律、帕累托定律、最省力法则、不平衡原则、犹太法则、马特莱法则
- 《纽约时报》今年订阅收入或首超广告收入
- 多字符串分割与拼接
- Linux下增加sqlplus上下键翻动功能
- 字符串分割
- /NOENTRY在VS里面的设置位置
- 解决CHM文件的乱码问题