postal icon indicating copy to clipboard operation
postal copied to clipboard

nginx broke after sudo cp /opt/postal ...

Open JaiBansal24 opened this issue 7 years ago • 6 comments

1st of all, Postal is a great sw ! So thanks for your efforts !

I am pro in Windows servers and 1/10 in Linux. The one line command helped me setup postal servers on DO. Several VPS running great with 4 GB RAM @ about 60 mails/min.

Issue is that I need to setup POSTAL on VPSs on Amazon Lightsail. The 1 line command doesn't work there. Keeps giving chmod errors. Using "sudo curl... " Is there any alternate command for that ? Using 18.04 in both cases.

I tried the lengthy alternative (https://github.com/atech/postal/wiki/Installation) and followed all steps.

After most part worked, Web Page showed nginx welcome page > then after this command, it broke. (error log below) sudo cp /opt/postal/app/resource/nginx.cfg /etc/nginx/sites-available/default I tried #17 but failed :(

Is there any easy way out ?? I am too stressed out :( Don't want to do endless research. Need it to work.

  • Thanks !

ubuntu@ip-172-26-10-109:~$ systemctl status nginx.service● nginx.service - A high performance web server and a reverse proxy server Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Fri 2019-07-05 20:44:29 UTC; 3min 1s ago Docs: man:nginx(8) Process: 4489 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (codJul 05 20:44:29 ip-172-26-10-109 systemd[1]: Starting A high performance web server and Jul 05 20:44:29 ip-172-26-10-109 nginx[4489]: nginx: [emerg] BIO_new_file("/etc/nginx/ssJul 05 20:44:29 ip-172-26-10-109 nginx[4489]: nginx: configuration file /etc/nginx/nginxJul 05 20:44:29 ip-172-26-10-109 systemd[1]: nginx.service: Control process exited, codeJul 05 20:44:29 ip-172-26-10-109 systemd[1]: nginx.service: Failed with result 'exit-codJul 05 20:44:29 ip-172-26-10-109 systemd[1]: Failed to start A high performance web servlines 1-12/12 (END)

JaiBansal24 avatar Jul 05 '19 21:07 JaiBansal24

if you run sudo nginx -t this should list any errors with the nginx config files.

I'd also be interested to know what specific error(s) you get when trying to run the automated installer.

catphish avatar Jul 08 '19 15:07 catphish

Thanks for taking interest in assisting me ! It would be great if the auto installer could work on Amazon Lightsail also.

Running sudo nginx -t : ubuntu@ip-172-26-10-109:/etc/nginx$ sudo nginx -tnginx: [emerg] BIO_new_file("/etc/nginx/ssl/postal.cert") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/nginx/ssl/postal.cert','r') error:2006D080:BIO routines:BIO_new_file:no such file)nginx: configuration file /etc/nginx/nginx.conf test failed

Looks like some SSL error, maybe. I don't need SSL coz server will be firewalled and open only to my other servers.

Running Auto installer :

ubuntu@ip-172-26-10-109:~$ sudo curl https://raw.githubusercontent.com/atech/postal/master/script/install/ubuntu1604.sh | sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed100 2847 100 2847 0 0 83735 0 --:--:-- --:--:-- --:--:-- 83735Reading package lists... DoneE: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)E: Unable to lock directory /var/lib/apt/lists/W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)

Rgds, Jaii

JaiBansal24 avatar Jul 08 '19 16:07 JaiBansal24

BTW, the above error on auto installer came on a VPS which already has all MANUAL install steps completed. On fresh server, it was giving mainly chmod permission errors.

JaiBansal24 avatar Jul 08 '19 16:07 JaiBansal24

The automated installation is failing because it needs to be run as root. The documentation says to log in as root, but if you don't want to do so, you can probably run it with sudo like this:

wget https://raw.githubusercontent.com/atech/postal/master/script/install/ubuntu1604.sh
sudo bash ubuntu1604.sh

catphish avatar Jul 08 '19 19:07 catphish

With regard to nginx, the documentation shows you how to generate a self-signed certificate, but if you really don't want SSL, then you'll need to modify the nginx config file manually to remove the SSL.

catphish avatar Jul 08 '19 19:07 catphish

The automated installation is failing because it needs to be run as root. The documentation says to log in as root, but if you don't want to do so, you can probably run it with sudo like this:

wget https://raw.githubusercontent.com/atech/postal/master/script/install/ubuntu1604.sh
sudo bash ubuntu1604.sh

It worked !!! :) Thanks bro ! Ran it on a new fresh VPS.

Rgds, Jaii

JaiBansal24 avatar Jul 08 '19 21:07 JaiBansal24