Search code examples
amazon-ec2parse-platformdnsparse-serverbitnami

How to point domain to specific folder on Bitnami Parse Server?


I am a newbie to deploying on servers and it's my first time using Parse Server. I need to have my domain.com pointing to an html page on an aws Bitnami Parse Server at /home/bitnami/htdocs/site and my domain.com/backend pointing to my application's dashboard. My app is at opt/bitnami/apps/myapp, also whatever I enter it always redirects to domain.com/login e.g. domain.com or domain.com/backend or domain.com/hello all redirect to the same thing.

I have tried this but it didn't work:

<VirtualHost *:80>
ServerName domain.com
ServerAlias www.domain.com
DocumentRoot "/opt/bitnami/apps/myapp/htdocs"
Alias /subfolder /var/www/subfolder
<Directory /var/www/subfolder>
Order allow,deny
allow from all
</Directory>
Include "/opt/bitnami/apps/myapp/conf/httpd-app.conf"
</VirtualHost>

I also tried:

<VirtualHost domain.com/backend:80>
ServerName domain.com/backend
DocumentRoot "/opt/bitnami/apps/myapp/htdocs"
Include "/opt/bitnami/apps/myapp/conf/httpd-app.conf"
</VirtualHost>
<VirtualHost domain.com:80>
ServerName domain.com
DocumentRoot "/opt/bitnami/apps/myapp/htdocs"
Include "/opt/bitnami/apps/myapp/conf/httpd-app.conf"
</VirtualHost>

Solution

  • Well its nearly solved through editing /opt/bitnami/apps/myapp/conf/httpd-app.conf and changing these lines:

    ProxyPass / http://localhost:4040/
    ProxyPassReverse / http://localhost:4040/
    

    to:

    ProxyPass /backend http://localhost:4040/backend
    ProxyPassReverse /backend http://localhost:4040/backend
    

    and updating the /opt/bitnami/apps/myapp/htdocs/server.js file:

    // make the Parse Dashboard available at /
    dashApp.use('/', dashboard);
    

    to:

    // make the Parse Dashboard available at /backend
    dashApp.use('/backend', dashboard);
    

    and restart the server with this command sudo /opt/bitnami/ctlscript.sh restart then you can add your html page to /home/bitnami/htdocs (still working on adding it in a separate folder (site)). but this just works fine so far now you can browse domain.com and u will find the page you made and domain.com/backend is your dashboard hope this helps!