标签:sse oev 两种 俄罗斯 tom 服务器 class mis --
Nginx ("engine x") 是一个高性能的 HTTP 和 反向代理 服务器,也是一个 IMAP/POP3/SMTP 代理服务器。 Nginx 是由 Igor Sysoev 为俄罗斯访问量第二的 Rambler.ru 站点开发的,第一个公开版本0.1.0发布于2004年10月4日。其将源代码以类BSD许可证的形式发布,因它的稳定性、丰富的功能集、示例配置文件和低系统资源的消耗而闻名。
ubuntu平台可以使用如下命令。
|
1
2
|
apt-get install build-essentialapt-get install libtool |
centeros平台可以使用如下命令。
|
1
2
3
4
5
6
|
centos平台编译环境使用如下指令安装make:yum -y install gcc automake autoconf libtool make安装g++:yum install gcc gcc-c++ |
|
1
2
|
sudo apt-get updatesudo apt-get install libpcre3 libpcre3-dev |
|
1
|
apt-get install zlib1g-dev |
|
1
|
apt-get install openssl |
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#下载最新版本:wget http://nginx.org/download/nginx-1.11.3.tar.gz#解压:tar -zxvf nginx-1.11.3.tar.gz#进入解压目录:cd nginx-1.11.3#配置:./configure --prefix=/usr/local/nginx #编辑nginx:make注意:这里可能会报错,提示“pcre.h No such file or directory”,具体详见:http://stackoverflow.com/questions/22555561/error-building-fatal-error-pcre-h-no-such-file-or-directory需要安装 libpcre3-dev,命令为:sudo apt-get install libpcre3-dev#安装nginx:sudo make install#启动nginx:sudo /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf注意:-c 指定配置文件的路径,不加的话,nginx会自动加载默认路径的配置文件,可以通过 -h查看帮助命令。#查看nginx进程:ps -ef|grep nginx |
|
1
2
3
|
/usr/local/nginx/sbin/nginx./sbin/nginx |
|
1
2
3
|
./sbin/nginx -s stop./sbin/nginx -s quit |
|
1
|
./sbin/nginx -s reload |
|
1
|
./sbin/nginx -c /usr/local/nginx/conf/nginx.conf |
|
1
2
3
|
./sbin/nginx -vnginx: nginx version: nginx/1.0.0 |
|
1
2
3
4
5
|
poechant@ubuntu:/usr/local/nginx$ ./sbin/nginx -Vnginx: nginx version: nginx/1.0.0nginx: built by gcc 4.3.3 (Ubuntu 4.3.3-5ubuntu4)nginx: TLS SNI support enablednginx: configure arguments: --with-http_ssl_module --with-openssl=/home/luming/openssl-1.0.0d/ |
|
1
2
3
4
5
|
poechant@ubuntu:/usr/local/nginx$ ./sbin/nginx -tnginx: [alert] could not open error log file: open() "/usr/local/nginx/logs/error.log" failed (13: Permission denied)nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok2012/01/09 16:45:09 [emerg] 23898#0: open() "/usr/local/nginx/logs/nginx.pid" failed (13: Permission denied)nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed |
|
1
2
3
|
poerchant@ubuntu:/usr/local/nginx$ sudo ./sbin/nginx -tnginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is oknginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful |
|
1
|
poechant@ubuntu:/user/local/nginx$ ./sbin/nginx -h |
或者:
|
1
|
poechant@ubuntu:/user/local/nginx$ ./sbin/nginx -? |
标签:sse oev 两种 俄罗斯 tom 服务器 class mis --
原文地址:https://www.cnblogs.com/soleZ/p/9565268.html