最近Nginx 服务器比较流行,自己也想玩玩,所以把好的东西贴出来,给大家分享。
-----Window system
http://nginx.org/en/download.html
下载相关的version,直接安装就 可以了。
-----Linux
To enable automatic updates of Linux packages set up the yum repository for the RHEL/CentOS distributions, or the apt repository for the Debian/Ubuntu distributions.
To set up the yum repository for RHEL/CentOS, choose the corresponding nginx-release
package from the list:
The package contains the yum configuration file and the public PGP key necessary to authenticate signed RPMs. Download and install it, then run the command:
yum install nginx
Alternatively, a repository configuration can be added manually without installing the nginx-release
package. Create the file named/etc/yum.repos.d/nginx.repo
with the following contents:
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/OS/OSRELEASE/$basearch/
gpgcheck=0
enabled=1
Replace “OS
” with “rhel
” or “centos
”, depending on the distribution used, and “OSRELEASE
” with “5
” or “6
”, for 5.x or 6.x versions, respectively.
For Debian 6 append the following to the end of the /etc/apt/sources.list
file:
deb http://nginx.org/packages/debian/ squeeze nginx
deb-src http://nginx.org/packages/debian/ squeeze nginx
Then run the commands:
apt-get update
apt-get install nginx
For Ubuntu 10.04 append the following to the end of the /etc/apt/sources.list
file:
deb http://nginx.org/packages/ubuntu/ lucid nginx
deb-src http://nginx.org/packages/ubuntu/ lucid nginx
Then run the commands:
apt-get update
apt-get install nginx