easyengine icon indicating copy to clipboard operation
easyengine copied to clipboard

missing /etc/nginx/nginx.conf file after update to 3.2.0

Open MattyLB opened this issue 11 years ago • 19 comments

Sorry if this falls into another open or resolved issue - but I'm missing my etc/nginx/nginx.conf file after updating to 3.2.0 and it didn't become apparent until I needed to restart the stack today.

One thing I noticed during the update that may have led to this is that the GPG key server had an invalid site certificate and I don't believe my GPG keys are valid or even installed, which may have faulted the upgrade.

Please let me know if you're aware of this, or what details I can provide to help you determine the issue.

One last note, in my /etc/nginx folder I do have an "nginx.conf.old" that was created on the day I updated, but this config doesn't work. When I tried it, I get the message below, so I assume a few paths have changed and I don't want to do anymore damage without running this past you ...

root@ip-XXX-XX-17-21:/etc/nginx# cp nginx.conf.old nginx.conf root@ip-XXX-XX-17-21:/etc/nginx# nginx -t nginx: [emerg] unknown log format "rt_cache" in /etc/nginx/sites-enabled/22222:7 nginx: configuration file /etc/nginx/nginx.conf test failed

MattyLB avatar Jun 02 '15 16:06 MattyLB

update w/ error log info ... (Ubuntu 14.04 Trusty, btw)

root@ip-XXX-XX-17-21:/etc/nginx# tail /var/log/ee/ee.log php5-common php5-curl php5-fpm php5-gd php5-imap php5-mcrypt php5-mysql php5-readline 20 upgraded, 0 newly installed, 0 to remove and 63 not upgraded. Need to get 37.9 MB of archives. After this operation, 326 kB of additional disk space will be used. WARNING: The following packages cannot be authenticated! nginx-common nginx-custom E: There are problems and -y was used without --force-yes 2015-06-02 17:11:55,068 (INFO) ee : Oops Something went wrong!! 2015-06-02 17:11:55,068 (ERROR) ee : Check logs for reason tail /var/log/ee/ee.log & Try Again!!!

MattyLB avatar Jun 02 '15 18:06 MattyLB

Just to verify, I took another site that was on ee version 3.1.5 and did an ee update command and it's hanging at the same task:

Using /usr/local/lib/python3.4/dist-packages/cement-2.4.0-py3.4.egg Finished processing dependencies for ee==3.2.0 Updating Nginx configuration, please wait... gpg: requesting key D2AE6F03 from hkp server keys.gnupg.net

Could it have anything to do with needing a port to be opened on my AWS security group? NOTE: On my other server when I tried going to the keys.gnupg.net I got an SSL certificate error (approx 5/24). Today when I try to pull up that site it says it doesn't exist. Same with gnupg.net.

MattyLB avatar Jun 04 '15 01:06 MattyLB

Hello, Its hanging because on your firewall port 11371 is blocked. After unblocking port please use following commands to fix your server:

gpg --keyserver "hkp://keys.gnupg.net" --recv-keys '3050AC3CD2AE6F03'
gpg -a --export --armor '3050AC3CD2AE6F03' | apt-key add -
mv /etc/nginx/conf.d/ee-nginx.conf /etc/nginx/conf.d/ee-nginx.conf.old
mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.old
apt-get update
apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y install nginx-custom

In Next release of EasyEngine we are adding that port check so that GnuPG will not fail.

gau1991 avatar Jun 04 '15 07:06 gau1991

Thanks for the update.

I am concerned that I didn't see anything mentioned about opening certain ports in the EE install instructions on the site or on the GitHub page. Maybe I missed it? If not, can you please update the instructions to include all ports and protocols needed to fully utilize a basic install? Including port 22222, etc. Ideally I would look for this in the server requirements section.

By default, most AWS users are warned to limit our open ports so this information is fairly important to know in advance. Again, sorry if I missed it.

Thank you, Matt

On Thursday, June 4, 2015, Gaurav Ashtikar [email protected] wrote:

Hello, Its hanging because on your firewall port 11371 is blocked. After unblocking port please use following commands to fix your server:

gpg --keyserver "hkp://keys.gnupg.net" --recv-keys '3050AC3CD2AE6F03' gpg -a --export --armor '3050AC3CD2AE6F03' | apt-key add - mv /etc/nginx/conf.d/ee-nginx.conf /etc/nginx/conf.d/ee-nginx.conf.old mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.old apt-get update apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y install nginx-custom

In Next release of EasyEngine we are adding that port check so that GnuPG will not fail.

— Reply to this email directly or view it on GitHub https://github.com/rtCamp/easyengine/issues/560#issuecomment-108766195.

MattyLB avatar Jun 04 '15 14:06 MattyLB

Just a suggestion for readme.md ...

......

Servers Supported:

Ubuntu 12.04 & 14.04 Debian 7 & 8

Minimum / Recommended RAM & CPU:

1gig / 3gig RAM (or whatever you suggest) 1 / 3 CPU or virtual cpu (or whatever you suggest)

Port Requirements (in addition to :

11371 | TCP In/Out - gpg keyserver access. 22222 | TCP In/Out - diagnostic tools access. (or whatever you suggest)

......

Just trying to help you and save any headaches from others going forward. :)

MattyLB avatar Jun 04 '15 15:06 MattyLB

@MattyLB Totally agreed on this

I updated EE and had to roll back my server droplet as I couldn't find why the server just stopped serving. Seems this could be why.

I have all my ports except these TCP ports: 80 8080, 443 and 22222 closed for security as you probably have as well

shaneholloman avatar Jun 08 '15 11:06 shaneholloman

I have all my ports except these TCP ports: 80 8080, 443 and 22222 closed for security

That's very useful - I missed the part in best security practices where it says that ports 22222 and 8080 need to be open.

ghost avatar Jun 08 '15 11:06 ghost

@rippler ... sorry lost me there. can you explain? https://github.com/shaneholloman contact is here so as to not create noise here... I realised, maybe you were ribbing me, but if not, this is what I refer to: https://www.linode.com/docs/security/linux-security-basics#use-a-firewall-to-block-unwanted-traffic

shaneholloman avatar Jun 08 '15 11:06 shaneholloman

22222 isn't a required port unless you want access to the EE diag screen and you can always limit it to your own IP address. Even with port 11371, I only open it (has to be to all ips, in & out) during the upgrade or initial EE install process.

I don't use 8080 and have never had an issue. Should I have this port open?

On Monday, June 8, 2015, Shane Holloman [email protected] wrote:

@rippler https://github.com/rippler ... sorry lost me there. can you explain? https://github.com/shaneholloman contact is here so as to not create noise here

— Reply to this email directly or view it on GitHub https://github.com/rtCamp/easyengine/issues/560#issuecomment-109960044.

MattyLB avatar Jun 08 '15 11:06 MattyLB

Fellas - so not to lead anyone astray: @MattyLB like you, I would like to say I have almost all ports closed, except in my case a handful like 22, 80 8080, 443 and 22222 for different purposes. 8080 is not required to my knowledge by EE, Just making an example there.

@MattyLB however it's news to me EE needs port 11371 open, so your suggestion to list these EE required ports in the readme is very welcomed here, as (In my case) I have most ports closed based on this article: https://www.linode.com/docs/security/linux-security-basics#use-a-firewall-to-block-unwanted-traffic and many others like it

I hope this is clearer. My intention is to complement your suggestion

shaneholloman avatar Jun 08 '15 12:06 shaneholloman

@shaneholloman - no worries, we're on the same page. I meant to refer my last comment to @rippler. =)

On Monday, June 8, 2015, Shane Holloman [email protected] wrote:

Fellas - so not to lead anyone astray: @MattyLB https://github.com/MattyLB like you, I would like to say I have almost all ports closed, except in my case a handful like 22, 80 8080, 443 and 22222 for different purposes. 8080 is not required to my knowledge by EE, Just making an example there.

@MattyLB https://github.com/MattyLB however it's news to me EE needs port 11371 open, so your suggestion to list these EE required ports in the readme is very welcomed here, as (In my case) I have most ports closed based on this article: https://www.linode.com/docs/security/linux-security-basics#use-a-firewall-to-block-unwanted-traffic and many others like it

I hope this is clearer. My intention is to complement your suggestion

— Reply to this email directly or view it on GitHub https://github.com/rtCamp/easyengine/issues/560#issuecomment-109970164.

MattyLB avatar Jun 08 '15 12:06 MattyLB

@MattyLB - what Shane said - as far as I know, one needs to open only those ports that need to be open. Usually that means only 80, 443, maybe 22 or something else for OpenSSH (whatever port you're running it on). I don't know of any other documented requirements for EE.

ghost avatar Jun 08 '15 13:06 ghost

Guys - just to clarify - Gaurav specifically said port 11371 needs to be open to obtain GPG keys when updating or installing EE now. My points were only about THIS and wondering if 8080 is really needed. Before I opened 11371, I was NOT able to connect and obtain my GPG keys during upgrade, so it is a required port now, apparently.

From Gaurav Ashtikar

Hello, Its hanging because on your firewall port 11371 is blocked. After unblocking port please use following commands to fix your server:

gpg --keyserver "hkp://keys.gnupg.net" --recv-keys '3050AC3CD2AE6F03' gpg -a --export --armor '3050AC3CD2AE6F03' | apt-key add - mv /etc/nginx/conf.d/ee-nginx.conf /etc/nginx/conf.d/ee-nginx.conf.old mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.old apt-get update apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y install nginx-custom

In Next release of EasyEngine we are adding that port check so that GnuPG will not fail.

On Mon, Jun 8, 2015 at 8:02 AM, rippler [email protected] wrote:

@MattyLB https://github.com/MattyLB - what Shane said - as far as I know, one needs to open only those ports that need to be open. Usually that means only 80, 443, maybe 22 or something else for OpenSSH (wherever you're running it). I don't know of any other requirements for EE.

— Reply to this email directly or view it on GitHub https://github.com/rtCamp/easyengine/issues/560#issuecomment-109985407.

MattyLB avatar Jun 08 '15 13:06 MattyLB

Its hanging because on your firewall port 11371 is blocked.

But Gaurav didn't specifically state whether it needs to be open for incoming or outbound traffic. You interpreted it that it needs to be open for traffic both ways.

ghost avatar Jun 08 '15 14:06 ghost

@rippler - i tried it both ways, it has to be open for both.

On Monday, June 8, 2015, rippler [email protected] wrote:

Its hanging because on your firewall port 11371 is blocked.

But Gaurav didn't specifically state whether it needs to be open for incoming or outbound traffic. You interpreted it that it needs to be open for all traffic.

— Reply to this email directly or view it on GitHub https://github.com/rtCamp/easyengine/issues/560#issuecomment-110008676.

MattyLB avatar Jun 08 '15 14:06 MattyLB

EasyEngine requires Outbound 11371 port to connect to GPG Key server. We also updated readme with all required ports details.

gau1991 avatar Jun 09 '15 07:06 gau1991

Thank you sir! =)

On Tuesday, June 9, 2015, Gaurav Ashtikar [email protected] wrote:

EasyEngine requires Outbound 11371 port to connect to GPG Key server. We also updated readme with all required ports details.

— Reply to this email directly or view it on GitHub https://github.com/rtCamp/easyengine/issues/560#issuecomment-110263534.

MattyLB avatar Jun 09 '15 15:06 MattyLB

"In Next release of EasyEngine we are adding that port check so that GnuPG will not fail."

This is still happening in 3.3.1 and 3.3.2 - it's not checking to see if the port is open. I shut the port down after using the fix you provided because I do not like to leave ports open when not in use. Upon upgrading to 3.3.1, I forgot to open it, never received an error about GPG keys so I never thought there was an issue - yet my nginx conf test failed. It wasn't until I tried creating a site with redis on another server that I noticed my GPG keys did not install correctly and I was never warned about it when the upgrade completed.

This whole needing a port to be open to get GPG keys is a big issue for me. I don't like leaving ports open and I don't like having to remember to open ports each time I upgrade - it detracts from the whole "EASY" part of Easy Engine. Is there an alternate way to retrieve these keys other than through port 11371?

Final note - running same fix as mentioned below by Gaurav (minus line 3) fixed the issue, once I reopened port 11371 for outbound traffic.

Its hanging because on your firewall port 11371 is blocked. After unblocking port please use following commands to fix your server:

gpg --keyserver "hkp://keys.gnupg.net" --recv-keys '3050AC3CD2AE6F03' gpg -a --export --armor '3050AC3CD2AE6F03' | apt-key add - (i didn't have this file) mv /etc/nginx/conf.d/ee-nginx.conf /etc/nginx/conf.d/ee-nginx.conf.old mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.old apt-get update apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y install nginx-custom

Thanks for looking into this again.

On Thu, Jun 4, 2015 at 2:33 AM, Gaurav Ashtikar [email protected] wrote:

Hello, Its hanging because on your firewall port 11371 is blocked. After unblocking port please use following commands to fix your server:

gpg --keyserver "hkp://keys.gnupg.net" --recv-keys '3050AC3CD2AE6F03' gpg -a --export --armor '3050AC3CD2AE6F03' | apt-key add - mv /etc/nginx/conf.d/ee-nginx.conf /etc/nginx/conf.d/ee-nginx.conf.old mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.old apt-get update apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y install nginx-custom

In Next release of EasyEngine we are adding that port check so that GnuPG will not fail.

— Reply to this email directly or view it on GitHub https://github.com/rtCamp/easyengine/issues/560#issuecomment-108766195.

MattyLB avatar Jul 27 '15 22:07 MattyLB

closing this issue with reference to below comment.

https://github.com/rtCamp/easyengine/issues/593#issuecomment-125756134

harshadyeola avatar Jul 30 '15 12:07 harshadyeola