Deploy Rails App on AWS Server howto by redminelab_h5if6c - October 21, 2021October 21, 20210 This post is very quick guide about how to deploy ruby on rails application on AWS cloud running apache2 webserver. Deploying application means putting it on a Web server so that it can be used either through the Internet or an intranet. This Web server might be local UNIX system, while you develop and debug your application to check its working or a AWS cloud server. Contents1 System Pre-requisites 2 Steps To Deploy Rails App on AWS Server3 Troubleshooting Ruby App deployment errors 3.1 Apache not working properly due to syntax error in apache2.conf3.2 Passenger Mod not working properly System Pre-requisites Server (VM or physical) accessible and ssh setup for deployment You need app which ready to go server ( Normal app ,Docker, Container )Web app server just like (apache, nginx) also you need your passenger mod for assistRuby, rail, gems installed Last your required database which you want to use (MySQL, SQLite etc.) Steps To Deploy Rails App on AWS Server Login to server where you want to deploy your app using SSH. After login into server use “ ls “ command to check your app is present or not if no then Copy app to directory of server with read and write permission. Database installation .(in our case we already configured database) Run command “bundle install” this fetch all latest gems on server Try to run app using puma or webrick using “rails s” command Next step is installation of apache – if apache is not installed before $ sudo apt update $ sudo apt install apache2 libapache2-mod-passenger Apache configuration and setting up virtual host, file located at /etc/apache2/sites-enabled/000-default.conf $ sudo vim /etc/apache2/sites-enabled/000-default.conf Apache configuration for ruby on rails application Enable passenger Mod using below command $ sudo a2enmod passenger Passenger mod working with RoR application Default site disable and enable new site. (If you have used virtual host in default then don’t disable it ) $ sudo a2dissite 000-default.conf $ sudo a2ensite new_site.conf Test the site from public IP / hostname or localhost Troubleshooting Ruby App deployment errors Apache not working properly due to syntax error in apache2.conf Fix syntax errors and restart apache Passenger Mod not working properly uninstall passenger mod and re-install it and configure passenger.conf file $ sudo apt purge libapache2-mod-passenger $ sudo apt install libapache2-mod-passenger Hope you have enjoyed reading this quick guide on How to Deploy Rails App on AWS Server running apache with passenger.