I am really new to server configuration. I have a rails application locally and I have access to an amazon EC2 server instance. I am required to use nginx for web server and puma for application server. Can someone kindly explain to me in detail (file creation, directory, command etc) how I can make that application up and running for public access via the domain?
My rails app directories are:
$~ server/user/home/apps/myapp/shared/...
$~ server/user/home/apps/myapp/current/...
I have tried capistrano. But no matter which ever tutorial I follow, I always end up having .../shared/tmp/sockets/puma.myapp.sock failed (2: No such file or directory) while connecting to upstream...
error.
2
Answers
here are the steps that worked for me:
Install Nginx
sudo apt install nginx
sudo ufw app list
sudo ufw allow 'Nginx HTTP'
Setup Server
sudo nano /etc/nginx/sites-available/appname
.appname
with the name of your app:sudo ln -s /etc/nginx/sites-available/repuestosgonnet /etc/nginx/sites-enabled/
sudo nano /etc/nginx/nginx.conf
server_names_hash_bucket_size 64;
server_tokens off;
sudo nginx -t
sudo systemctl restart nginx
I hope that works for you!
Let me know if you have any questions.
You need to create 2 systemd service files so that it launches puma for you:
appname.service:
appname.socket:
Then you can relaunch systemd loader
And enable the files
And finally: