执行 make install 命令时,出现的 cp: ‘conf/koi-win‘ and ‘opt/soft/build/nginx/conf/koi-win‘ are the same file
事件还原:
nginx-1.19.6.tar.gz解压目录:/opt/soft/build/nginx
[root@AlexWong nginx]# ll
total 808
drwxr-xr-x 6 1001 1001 4096 Jan 22 11:07 auto
-rw-r--r-- 1 1001 1001 308054 Dec 15 22:41 CHANGES
-rw-r--r-- 1 1001 1001 470256 Dec 15 22:41 CHANGES.ru
drwxr-xr-x 2 1001 1001 4096 Jan 22 11:07 conf
-rwxr-xr-x 1 1001 1001 2590 Dec 15 22:41 configure
drwxr-xr-x 4 1001 1001 4096 Jan 22 11:07 contrib
drwxr-xr-x 2 1001 1001 4096 Jan 22 11:07 html
-rw-r--r-- 1 1001 1001 1397 Dec 15 22:41 LICENSE
-rw-r--r-- 1 root root 352 Jan 22 11:07 Makefile
drwxr-xr-x 2 1001 1001 4096 Jan 22 11:07 man
drwxr-xr-x 3 root root 4096 Jan 22 11:08 objs
-rw-r--r-- 1 1001 1001 49 Dec 15 22:41 README
drwxr-xr-x 9 1001 1001 4096 Jan 22 11:07 src
# 执行
root@AlexWong nginx]# ./configure "--prefix=/opt/soft/build/nginx"
然后 make && make install 报错
后查询资料发现,nginx不允许解压目录和安装目录为同一个,所以执行 make install 命令时,出现的 cp: ‘conf/koi-win‘ and ‘opt/soft/build/nginx/conf/koi-win‘ are the same file
后改为
[root@AlexWong nginx]# ./configure "--prefix=/opt/nginx"
[root@AlexWong nginx]# ll /opt/nginx
total 16
drwxr-xr-x 2 root root 4096 Jan 22 10:34 conf
drwxr-xr-x 2 root root 4096 Jan 22 10:34 html
drwxr-xr-x 2 root root 4096 Jan 22 10:34 logs
drwxr-xr-x 2 root root 4096 Jan 22 11:08 sbin
安装成功
[root@AlexWong nginx]# /opt/nginx/sbin/nginx -v
nginx version: nginx/1.19.6