codestates / codestates/Cityrunner

[AWS] Node.js 80포트 에러 해결방법

Open
#28 0 comments 0 reactions 0 assignees View on GitHub
Error
Dominant language
JavaScript
Stars
2
Forks
1
PR merge metrics
No merged PRs in 30d

Description

> > ### 어떤 에러인가요?
>> ![image](https://user-images.githubusercontent.com/53087860/132818914-6a165439-cbd3-4887-a284-da18d47f5ca0.png)
>>
> > ### 에러 메시지
> > ```shell
> >Error: listen EACCES: permission denied 0.0.0.0:80
> > ```
> >
> >
> >
> >
> > ### 에러 핸들링 방법
> > AWS ec2 - ubuntu - Node.js를 사용하여 서버를 실행했을때 발생
> > * 80 포트를 사용하지 않고 8080포트 등 다른 포트를 사용하여 80 포트로 리디렉션
> >
> > ```shell
> > sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
> > ```
> >
> > ```shell
> > 추가 : [root@localhost~]# iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
> >
> > 삭제 : [root@localhost~]# iptables -D PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
> > ```

> > ```shell
> > iptables 저장 : [root@localhost~]# service iptables save
> >
> > iptables 확인 : [root@localhost~]# iptables -t nat -L
> >```

> >
> >
> >

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.