文章关键字 ‘Nginx’

Nginx自动安装脚本 For cPanel (兼容.htaccess)

2010年02月24日,星期三

为cPanel主机添加nginx服务器软件,让nginx跑前端处理静态文件,两者相比较来说,加装nginx后的资源消耗比单纯跑apache 少很多.最近对nginx自动安装脚本进行很多修改,我仔细的测试了几次.觉得可以应用于生产环境,就在自己的机器上安装了.所以这篇就详细为大家说明是 怎样做到的.

这里引用cPanel Forums上的帖子.作者blargman写了一个专门为 cPanel打造的nginx自动安装脚本.

Evidently I don't know hot to post in the right forum.

This is an automated nginx installer for cpanel. Integrates so that domain adding/removal is all done automatically.
Some people had asked for cpanel support. In lieu of that, this does pretty much everything I can think of that they would do. It creates a vhost for each domain/addon/subdomain and serves up static content.

Let me know if you have any thoughts/questions or better yet suggestions.
http://blargman.com/public.tar

以上是作者原文,原文地址:点 击这里.安装方法很简单(建议做好备份),如下:

cd /usr/local/src
wget http://blargman.com/public.tar
tar xf public.tar
cd publicnginx
./nginxinstaller install

安装好之后,重启nginx,执行命令:/etc/init.d/nginx restart.Nginx的配 置文件均在/etc/nginx当中,各用户绑定的域名(附加域,子域等)均在/etc/nginx/vhosts

卸载:

以上下载步骤不变.将最后一步./nginxinstaller install改为./nginxinstaller uninstall执行即可.

--------------------------------------------------------------------------------------------------

移步:iCodex

为nginx虚拟主机配置startssl免费https证书

2010年01月7日,星期四

StartSSL是一个免费颁发SSL证书的机构,被多数有Linux 背景的软件支持(以Mozilla的Firefox和Thunderbird为首).以前IE是没有StartSSL的根证书的,以至于一段时间IE都会将使用StartSSL证书的网站列为不受信任的网站.

但是现在情况有所改观了,今年9月份,StartCom公司出现在Windows根证书认证程序厂商更新当中,因此StartSSL证书在IE平台上已经 可以正常使用的.另外Chrome,苹果Safari浏览器都可以正常识别StartSSL颁发的证书.但是Opera浏览器仍然不能支持.--By XmlChina

为nginx虚拟主机配置startssl证书

前提条件:独立IP.一台Linux机器.Startssl账户申请这里就不说明了.申请很简单,验证域名所有权也很简单.这里就做证书的配置.

我们先为域名生成证书请求文件和密钥.需要生成2048位加密的证书请求.以icodex.org为例,执行命令:

openssl req -new -newkey rsa:2048 -nodes -out icodex.csr -keyout icodex.key

(全文...)

[原创]Nginx在支持php多网站多用户下安全问题思考

2009年12月25日,星期五

nginx为多用户多域名提供虚拟主机一直都是个问题.在php的执行上是采用fastcgi的方式运行的.php在fastcgi模式下虽然效率 有很多提升,但是也暴露出一个问题,就是安全性问题.php以fastcgi方式运行一般是采用tcp或者socket方式,这两种方式本质上是一样的. 都是以同一个用户权限执行,这样在多用户多域名多网站的情况下就变得很糟糕,很容易形成跨站.被黑客利用的话,他就可以遍历整台服务器中php执行权限能 访问的地方,也就是多个网站的目录.原因就是因为fastcgi方式执行的php对每个目录指定的open_basedir是一样的.

一般有三种解决方案 (全文...)

Typecho 的永久链接设置

2009年12月24日,星期四

这篇日志主要由两个部分组成,一个是nginx上使用path_info.然后是给typecho加入了永久链接设置.我是为了方便以后的维护而进行的修改.

直接上一段我的Typecho的nginx虚拟主机配置:

server {
listen       80;
server_name  icodex.org;
root   /home/icodex/public_html;
index index.html index.php;

access_log  /var/log/nginx/icodex.org-access.log  access;
error_log  /var/log/nginx/icodex.org-error.log;

include error_page.conf;
include cache.conf;
include php.conf;
include php-path_info.conf;
include typecho.conf;
}

引用的几个文件中,关键的是php.conf和php-path_info.conf以及typecho.conf.他们的内容分别是: (全文...)

[2010.1.11]nginx完美解决同一服务上的站点WebShell访问限制问题

2009年11月27日,星期五

以前曾发过一个解决的思路:
http://www.daigou.in/viewthread.php?tid=1862

当时用phpspy2008测试权限,浏览等,都没有什么问题,但是没有在接近实际的环境中测试过,后来网友们反映还是经常有出现No input file specified.
后我本人又重新测试了一下,发现web服务器刚启动时正常,过了几分钟以后随机性的会出现 No input file specified. 或者返回404。

心情很是郁闷,加上近几天自己的网站也准备加强一下安全措施,于是干脆着手修改php的源代码解决,经过几个小时的研究,终于完美解决了这个问题,而且由于本办法是修改php来实现的,故使用范围应该不限于nginx,也可以应用到其他的web服务器上。 (全文...)

Nginx 0.8.27 发布

2009年11月19日,星期四

该版本就只是修正了一个在 0.8.25 版本中出现的漏洞,涉及到正则表达式无法在nginx(包括Windows平台)上工作的问题,

Changes with nginx 0.8.27                                        17 Nov 2009

    *) Bugfix: regular expressions did not work in nginx/Windows; the bug
       had appeared in 0.8.25.

下载地址:

nginx-0.8.27, nginx/Windows-0.8.27

Nginx 0.7.64 发布

2009年11月17日,星期二

该版本修复漏洞比较多.详细看一下官方升级细则

Changes with nginx 0.7.64                                        16 Nov 2009

    *) Security: now SSL/TLS renegotiation is disabled.
       Thanks to Maxim Dounin.

    *) Bugfix: nginx sent gzipped responses to clients those do not support
       gzip, if "gzip_static on" and "gzip_vary off"; the bug had appeared
       in 0.7.63.

    *) Bugfix: if names .domain.tld, .sub.domain.tld, and .domain-some.tld
       were defined, then the name .sub.domain.tld was matched by
       .domain.tld.

    *) Bugfix: segmentation fault and infinite looping in resolver.

    *) Bugfix: in resolver.
       Thanks to Artem Bokhan.

    *) Bugfix: resolver cache poisoning.
       Thanks to Matthew Dempsky.

    *) Bugfix: memory leak in resolver.
       Thanks to Matthew Dempsky.

下载:nginx-0.7.64, nginx/Windows-0.7.64, the change log.

Nginx 0.8.26 发布

2009年11月17日,星期二

Nginx 0.8.25 增加了很多新特性,也存在着很多bug,因此马上又发布了一个 0.8.26 版本。看来 0.8.25 版本发布得太仓促了。 (全文...)

[原创]Nginx第三方模块ETags的两个参数

2009年11月13日,星期五

刚刚发了一篇关于Etag的主题,发现还蛮多人讨论的...再说一个....

模块作者演示的.是直接在/根目录使用Etag,而我们要为一些静态元素添加Etag,所以我们要将这些文件后缀添加进来.用: (全文...)

Nginx 0.8.24 发布

2009年11月11日,星期三

该版本修复了4个漏洞.涉及gzip,debug,real ip和resolving.

Changes with nginx 0.8.24                                        11 Nov 2009

    *) Bugfix: nginx always added "Content-Encoding: gzip" response header
       line in 304 responses sent by ngx_http_gzip_static_module.

    *) Bugfix: nginx could not be built without the --with-debug option;
       the bug had appeared in 0.8.23.

    *) Bugfix: the "unix:" parameter of the "set_real_ip_from" directive
       inherited incorrectly from previous level.

    *) Bugfix: in resolving empty name.

nginx-0.8.24, nginx/Windows-0.8.24, the change log.