Nginx ("engine x") 是一个高性能的 HTTP 和 反向代理 服务器,也是一个 IMAP/POP3/SMTP 代理服务器。 Nginx 是由 Igor Sysoev 为俄罗斯访问量第二的 Rambler.ru 站点开发的,第一个公开版本0.1.0发布于2004年10月4日。其将源代码以类BSD许可证的形式发布,因它的稳定性、丰富的功能集、示例配置文件和低系统资源的消耗而闻名。
安装工具包 add-apt-repository
apt-get install python-software-properties
添加GPG Key, 安装时需要用到
gpg --keyserver keyserver.ubuntu.com --recv-key ABF5BD827BD9BF62
gpg -a --export ABF5BD827BD9BF62 | apt-key add -
结果
root@shell:~# gpg --keyserver keyserver.ubuntu.com --recv-key ABF5BD827BD9BF62
gpg: requesting key 7BD9BF62 from hkp server keyserver.ubuntu.com
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key 7BD9BF62: public key "nginx signing key <signing-key@nginx.com>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
root@shell:~# gpg -a --export ABF5BD827BD9BF62 | apt-key add -
OK
gpg: requesting key 7BD9BF62 from hkp server keyserver.ubuntu.com
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key 7BD9BF62: public key "nginx signing key <signing-key@nginx.com>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
root@shell:~# gpg -a --export ABF5BD827BD9BF62 | apt-key add -
OK
写道
apt-get update
编辑sources.list
vi /etc/apt/sources.list
在文件末尾加入
deb http://nginx.org/packages/ubuntu/ lucid nginx
deb-src http://nginx.org/packages/ubuntu/ lucid nginx
deb-src http://nginx.org/packages/ubuntu/ lucid nginx
apt-get update
apt-get install nginx
这样最新版的nginx就安装好了
以下适用于PHP环境
我们可以通过PHP-FPM (PHP-FPM (FastCGI Process Manager)使nginx在PHP的环境工作,
PHP-FPM是另一种PHP FastCGI的实现方式。
apt-get install php5-fpm
安装MYSQL模块
sudo apt-get install php5-mysql
安装php5-gd模块
apt-get install php5-gd