1. nginx apache 포트 체크 및 에러
netstat -tnlp
2. nginx 서비스 중 apache 서비스 시작 오류
* nginx apache 2개 서비스는 기본적으로 80포트를 이용하기 때문에 충돌이 발생하면서 오류 발생
root@bigju:~# systemctl start apache
Failed to start apache.service: Unit apache.service not found.
root@bigju:~# /etc/init.d/ap
apache2 apache-htcacheclean apparmor apport
root@bigju:~# /etc/init.d/apache2 start
Starting apache2 (via systemctl): apache2.serviceJob for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xeu apache2.service" for details.
failed!
root@bigju:~# systemctl status apache2
× apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2023-08-23 05:11:42 UTC; 31s ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 4519 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
CPU: 20ms
Aug 23 05:11:42 bigju apachectl[4522]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this m>
Aug 23 05:11:42 bigju apachectl[4522]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
Aug 23 05:11:42 bigju apachectl[4522]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
Aug 23 05:11:42 bigju apachectl[4522]: no listening sockets available, shutting down
Aug 23 05:11:42 bigju apachectl[4522]: AH00015: Unable to open logs
Aug 23 05:11:42 bigju apachectl[4519]: Action 'start' failed.
Aug 23 05:11:42 bigju apachectl[4519]: The Apache error log may have more information.
Aug 23 05:11:42 bigju systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Aug 23 05:11:42 bigju systemd[1]: apache2.service: Failed with result 'exit-code'.
Aug 23 05:11:42 bigju systemd[1]: Failed to start The Apache HTTP Server.
<해결>
3. nginx 포트 변경
<3-1 포트 변경>
vi /etc/nginx/sites-enabled/default
server {
listen 80 default_server;
listen [::]:80 default_server;
-> 80번 포트를 3000으로 변경
server {
listen 3000 default_server;
listen [::]:3000 default_server;
4. nginx 재시작
systemctl restart nginx //nginx 재시작
netstat -tnlp // 포트체크
nginx가 80포트에 3000포트로 변경 확인
5. apache 재시작
systemctl restart apache2
6. 최종확인
nginx apache 두 서비스 실행 중 확인
netstat -tnlp // 포트 확인
tcp 0 0 0.0.0.0:3000 0.0.0.0:* LISTEN 4756/nginx: master
tcp6 0 0 :::3000 :::* LISTEN 4756/nginx: master
tcp6 0 0 :::80 :::* LISTEN 4779/apache2
*nginx 3000포트
*apache 80포트
Big Ju
'SW > Apache' 카테고리의 다른 글
Centos 센토스 Apache node.js 도메인 프록시 (proxy) 설정 및 확인 (0) | 2023.08.31 |
---|---|
사이트 트래픽 제한 - Aapche (0) | 2021.10.23 |
사이트 트래픽 제한 (0) | 2021.10.19 |
게시판에 파일용량 100MB크기 업로드 가능하게 설정(centos 6) (0) | 2021.10.18 |
VirtualHost 설정 하기 (0) | 2021.10.12 |
댓글