Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: consider port in use when setting up Nginx #1

Open
borsti67 opened this issue Dec 1, 2020 · 2 comments
Open

FR: consider port in use when setting up Nginx #1

borsti67 opened this issue Dec 1, 2020 · 2 comments

Comments

@borsti67
Copy link

borsti67 commented Dec 1, 2020

As per today, "configure_web_server.sh" just copies a fresh nginx,conf over the original.
This is ok as long as Nginx and CloundStation are the only purpose of that system (It will be a huge problem if there is another Nginx already running).

In my case there is an Apache2 already listening on port 80 so Nginx refuses to start.
I added listen 81 below the server_name statement and use http://servername:81 to launch CloudStation.

It would be good it the installer checks if port 80 is already in use and either stops or asks for an alternate port.

@lyuyangh
Copy link
Member

lyuyangh commented Dec 2, 2020

Thanks for creating the first-ever CloudStation FR! This is definitely a valid concern. Could you guys evaluate this issue and see if you could update the script to handle it better? @ch-zha @lindzgarcia2 @hjayyang94

I would suggest the first approach (give a warning and abort the deployment process if port 80 is occupied). In a production environment, it usually means there's an issue in the system if port 80 is occupied when we try to start the service. It could be that the previous version of the service hasn't been killed properly or something else. If these scripts depend on user input to specify another port, these won't work in a CD pipeline.

@borsti67
Copy link
Author

borsti67 commented Dec 2, 2020

an abort should be quite simple:

if $(nc -z localhost 80)
then
echo "HTTP port in use, aborting!"
fi

May be a config file would be useful to store the MapBox-Token as well as an optional alternate port?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants