nginx安装
项目域名绑定的nginx机器,IP迁移至另外一台机器,今天在新机器上部署nginx,过程如下:
1、旧机器查看nginx版本
[root@Nginx_1 ~]# nginx -v nginx version: nginx/1.13.4
2、创建nginx目录
[root@ibk_187 ~]# cd /home
[root@ibk_187 home]# mkdir nginx
[root@ibk_187 home]# cd nginx
3、下载并解压安装包
//下载tar包
wget http://nginx.org/download/nginx-1.13.4.tar.gz tar -xvf nginx-1.13.4.tar.gz
4、安装nginx
[root@ibk_187 nginx-1.13.4]# cd /home/nginx/nginx-1.13.4/ [root@ibk_187 nginx-1.13.4]# ./configure --prefix=/home/nginx [root@ibk_187 nginx-1.13.4]# yum -y install gcc gcc-c++ autoconf automake make
报错:./configure: error: C compiler cc is not found
执行:yum -y install gcc gcc-c++ autoconf automake make
完成后继续尝试安装,报错
解决办法:yum -y install openssl openssl-devel
继续尝试安装:./configure --prefix=/home/nginx
//执行make命令 make
cd /home/nginx/sbin/
./nginx 启动
[root@ibk_187 sbin]# ./nginx -v
nginx version: nginx/1.13.4
显示了nginx版本,安装成功