[root@centos8 ~ ]# yum install -y httpd nginx
[root@centos8 ~ ]# systemctl start httpd
[root@centos8 ~ ]# systemctl start nginx
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.
[root@centos8 ~ ]# systemctl status nginx
● nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2021-08-27 15:37:12 CST; 17s ago
Process: 1184 ExecStart=/usr/sbin/nginx (code=exited, status=1/FAILURE)
Process: 1182 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
Process: 1181 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
Aug 27 15:37:11 centos8 nginx[1184]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Aug 27 15:37:11 centos8 nginx[1184]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Aug 27 15:37:11 centos8 nginx[1184]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Aug 27 15:37:11 centos8 nginx[1184]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Aug 27 15:37:12 centos8 nginx[1184]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Aug 27 15:37:12 centos8 nginx[1184]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Aug 27 15:37:12 centos8 nginx[1184]: nginx: [emerg] still could not bind()
Aug 27 15:37:12 centos8 systemd[1]: nginx.service: Control process exited, code=exited status=1
Aug 27 15:37:12 centos8 systemd[1]: nginx.service: Failed with result 'exit-code'.
Aug 27 15:37:12 centos8 systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#查看httpd服务运行的进程空间
[root@centos8 ~ ]# ps -ef | grep httpd
root 1178 1 0 15:37 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 1186 1178 0 15:37 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 1187 1178 0 15:37 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 1188 1178 0 15:37 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 1189 1178 0 15:37 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
root 1412 1153 0 15:42 pts/0 00:00:00 grep --color=auto httpd
[root@centos8 ~ ]# ll /proc/1178/ns/
lrwxrwxrwx 1 root root 0 Aug 27 15:42 cgroup -> 'cgroup:[4026531835]'
lrwxrwxrwx 1 root root 0 Aug 27 15:42 ipc -> 'ipc:[4026531839]'
lrwxrwxrwx 1 root root 0 Aug 27 15:42 mnt -> 'mnt:[4026532548]'
lrwxrwxrwx 1 root root 0 Aug 27 15:42 net -> 'net:[4026531992]'
lrwxrwxrwx 1 root root 0 Aug 27 15:42 pid -> 'pid:[4026531836]'
lrwxrwxrwx 1 root root 0 Aug 27 15:42 pid_for_children -> 'pid:[4026531836]'
lrwxrwxrwx 1 root root 0 Aug 27 15:42 user -> 'user:[4026531837]'
lrwxrwxrwx 1 root root 0 Aug 27 15:42 uts -> 'uts:[4026531838]'
#查看nginx服务运行的进程空间
[root@centos8 ~ ]# systemctl stop httpd
[root@centos8 ~ ]# systemctl start nginx
[root@centos8 ~ ]# ps -ef | grep nginx
root 1431 1 0 15:43 ? 00:00:00 nginx: master process /usr/sbin/nginx
nginx 1432 1431 0 15:43 ? 00:00:00 nginx: worker process
root 1434 1153 0 15:43 pts/0 00:00:00 grep --color=auto nginx
[root@centos8 ~ ]# ll /proc/1431/ns
lrwxrwxrwx 1 root root 0 Aug 27 15:43 cgroup -> 'cgroup:[4026531835]'
lrwxrwxrwx 1 root root 0 Aug 27 15:43 ipc -> 'ipc:[4026531839]'
lrwxrwxrwx 1 root root 0 Aug 27 15:43 mnt -> 'mnt:[4026532548]'
lrwxrwxrwx 1 root root 0 Aug 27 15:43 net -> 'net:[4026531992]'
lrwxrwxrwx 1 root root 0 Aug 27 15:43 pid -> 'pid:[4026531836]'
lrwxrwxrwx 1 root root 0 Aug 27 15:43 pid_for_children -> 'pid:[4026531836]'
lrwxrwxrwx 1 root root 0 Aug 27 15:43 user -> 'user:[4026531837]'
lrwxrwxrwx 1 root root 0 Aug 27 15:43 uts -> 'uts:[4026531838]'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34