1.下载Nginx
curl -O http://nginx.org/download/nginx-1.7.3.tar.gz -o /home/tango
2.安装Nginx
解压
tar -zxvf /home/tango/nginx-1.7.3.tar.gz /home/tango/nginx-1.7.3-setup
准备依赖
yum install pcre-devel yum install openssl-devel
编译,进入/home/tango/nginx-1.7.3-setup目录
./configure --prefix=/usr/local/server/nginx-1.7.3 --conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/nginx/nginx.pid --error-log-path=/var/log/nginx/error.log
等待编译完成...完成后安装
make && make install
3.启动nginx
/usr/local/server/nginx-1.7.3/sbin/nginx
访问nginx(默认为80端口,如有需要,在/etc/nginx/nginx.conf文件里修改)
server { listen 8080; server_name localhost;
本文完
Redhat下Nginx安装配置,布布扣,bubuko.com
时间: 2024-12-29 11:59:49