>make
>make install
安装openssl结束。
安装zlib,步骤同上
>cd ../nginx-1.0.10
> ./configure --prefix=/usr/local/nginx --with-openssl=../openssl-1.0.0e --with-http_ssl_module
更多的安装配置
./configure --prefix=/usr/local/nginx
--with-openssl=/usr/include (启用ssl)
--with-pcre=/usr/include/pcre/ (启用正规表达式)
--with-http_stub_status_module (安装可以查看nginx状态的程序)
--with-http_memcached_module (启用memcache缓存)
--with-http_rewrite_module (启用支持url重写)
2)安装nginx:
>make
>make install
安装完成。
第三步:查看安装版本及测试配置文件
将/usr/local/nginx/sbin加入到path环境变量,以root用户执行命令:
>nginx -V
nginx: nginx version: nginx/1.0.10
nginx: built by gcc 3.4.3 20050227 (Red Hat 3.4.3-22.1)
nginx: TLS SNI support enabled
nginx: configure arguments: --prefix=/usr/local/nginx --with-openssl=../openssl-1.0.0e --with-http_ssl_module
测试配置文件:
>nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
启动nginx:
>nginx
查看/usr/local/nginx/logs/nginx.pid内容,即为nginx主进程id。
可以用ps -ef | grep 24424(进程id)查看进程信息:
root 24424 1 0 02:58 ? 00:00:00 nginx: master process nginx