nginx 安装

下载地址:

http://nginx.org/en/download.html

安装依赖

yum install -y gcc gcc-c++ zlib zlib-devel pcre-devel openssl openssl-devel

编译安装

./configure --prefix=/usr/local/nginx-1.12.2 --with-http_ssl_module --with-pcre

make

make instll

$ nginx -v

bash: nginx: command not found

添加环境变量

$ vim /etc/profile

export PATH=$PATH:/usr/local/nginx-1.12.2/sbin

配置生效

$ source /etc/profile

启动

$ /usr/local/nginx-1.12.2/sbin/nginx

猜你喜欢

转载自tzhennan.iteye.com/blog/2418694