I am trying to deploy a react app using aws lightsail. I have read the documentation on https://docs.bitnami.com/general/infrastructure/nodejs/get-started/get-started/ but i stil cant get it to work. The commands that i use are the following:
sudo mkdir /opt/bitnami/projects // making the project directory
sudo chown $USER /opt/bitnami/projects // allowing permsions
git clone https://github.com/username/myapp.git
cd /opt/bitnami/projects/myapp
npm install
After installation of the project i configure the vhost files like so:
/opt/bitnami/apache/conf/vhosts/sample-vhost.conf.disabled
/opt/bitnami/apache/conf/vhosts/sample-https-vhost.conf.disabled
change to
/opt/bitnami/apache/conf/vhosts/myapp-vhost.conf
/opt/bitnami/apache/conf/vhosts/myapp-https-vhost.conf
the context of both files are change to:
<VirtualHost 127.0.0.1:443 _default_:443>
ServerAlias *
SSLEngine on
SSLCertificateFile "/opt/bitnami/apache/conf/bitnami/certs/server.crt"
SSLCertificateKeyFile "/opt/bitnami/apache/conf/bitnami/certs/server.key"
DocumentRoot /opt/bitnami/projects/myapp // from sample
<Directory "/opt/bitnami/projects/myapp"> // from sample
Options -Indexes +FollowSymLinks -MultiViews
AllowOverride All
Require all granted
</Directory>
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
</VirtualHost>
same is done with the other file. Then i try to install pm2 and run the project but i cant get it to work. I get a 503 service unavailable error from the server.