Help directing my domains to specific custom PHP applications in one Lightsail instance

@gongomgra – Thank you for your reply. I made the change you suggested (I’ve never touched that file but perhaps it was modified by a script?) and restarted Apache, but the behaviour doesn’t change at all.

photosensitive.ca still points to the content at /opt/bitnami/apache2/htdocs rather than apps/photosensitive/htdocs

Hi @JoeQ,

That message is not part of our default configuration nor any message added by our tools, that’s why I thought you modified the file. Can you run the bnsupport tool again?

# This part should force everything to https
  DocumentRoot "/opt/bitnami/apache2/htdocs"
  RewriteEngine On
  RewriteCond %{HTTPS} !=on
  RewriteCond %{HTTP_HOST} !^(localhost|127.0.0.1)
  RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L]

@gongomgra

The new bnsupport code is f749de90-db5b-4c38-04b0-6ed637f81708

Hi @JoeQ,

I’m afraid I was not able to reproduce your issue. I launched a fresh new WordPress machine (which Apache’ structure is the same as yours) and I added three new apps following our linked guide without any issue.

  • app1, app2: virtualhosts
  • app3: prefix

For app1 and app2, the httpd-vhosts.conf file is (replacing app1 with app2)

<VirtualHost *:80>
  ServerName app1.example.com
  DocumentRoot "/opt/bitnami/apps/app1/htdocs"
  Include "/opt/bitnami/apps/app1/conf/httpd-app.conf"
</VirtualHost>

<VirtualHost *:443>
  ServerName app1.example.com
  DocumentRoot "/opt/bitnami/apps/app1/htdocs"
  SSLEngine on
  SSLCertificateFile "/opt/bitnami/apache2/conf/server.crt"
  SSLCertificateKeyFile "/opt/bitnami/apache2/conf/server.key"
  Include "/opt/bitnami/apps/app1/conf/httpd-app.conf"
</VirtualHost>

and for app3, the httpd-prefix.conf is

Alias /app3/ "/opt/bitnami/apps/app3/htdocs/"
Alias /app3 "/opt/bitnami/apps/app3/htdocs"

Include "/opt/bitnami/apps/app3/conf/httpd-app.conf"

You can see the screenshots for every app

  • Root URL: WordPress

image

image

  • IP_ADDRESS/app3

image

It is working for me even after enabling the HTTP to HTTPS redirection. Can you start a new server and follow the guide again? Maybe you did a mistake in any config file and we are missing it.

@gongomgra -

My issue really is with the separate domain photosensitive.ca not redirecting properly. It goes to the root htdocs rather than the app folder htdocs I am trying to send it to. I don’t know why.

As you can see, my subdomain sci.orbito.me works fine.

I appreciate your help. I’ll tinker and see what happens.

Hi @JoeQ,

Yes, I think there is a wrong configuration anywhere that we are missing. As our docs seem to be working, I think starting with a fresh new server is a good option here.

Regards,
Gonzalo

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.