1

I'm running a Bitnami LAMP stack on an AWS Lightsail instance and trying to set up Virtual Hosts so that two domains point to different directories within htdocs. Specifically, I want:

domain1.fr to point to /opt/bitnami/apache/htdocs/domain1 domain2.fr to point to /opt/bitnami/apache/htdocs/domain2

First, I configured Route53 to add DNS Routes. I also used bitnami/bncert-tool to enable HTTPS on both domain

Then, following tutorials, I created a configuration file /opt/bitnami/conf/vhost/myapp-vhosts.conf that now looks like this :

<VirtualHost *:80>
   ServerName domaine1.fr
   DocumentRoot "/opt/bitnami/apache/htdocs/domain1"
   <Directory "/opt/bitnami/apache/htdocs/domain1">
      AllowOverride All
      Require all granted
   </Directory>
</VirtualHost>

<VirtualHost *:80>
   ServerName domaine2.fr
   DocumentRoot "/opt/bitnami/apache/htdocs/domain2"
   <Directory "/opt/bitnami/apache/htdocs/domain2">
      AllowOverride All
      Require all granted
   </Directory>
</VirtualHost>

I also updated this file /opt/bitnami/conf/httpd.conf :

<Directory />
    AllowOverride all
    Require all denied
</Directory>
<Directory "/opt/bitnami/apache/htdocs">
    Options Indexes FollowSymLinks
    AllowOverride all
    Require all granted
</Directory>

Both AllowOverride were changed from none to all

I also added the following line Include "/opt/bitnami/apache/conf/vhosts/myapp-vhosts.conf"

Finaly, I restarted apache sudo /opt/bitnami/ctlscript.sh restart apache

Result is that nothing changed. When I reach https://domain1.fr, the default index page appears (/opt/bitnami/apache/htdocs/index.php)

Do you have any idea on how to fix my issue ?

Thanks :)

1
  • Should the paths /opt/bitnami/conf/vhost/myapp-vhosts.conf and /opt/bitnami/conf/httpd.conf include "apache" and be changed to /opt/bitnami/apache/conf/vhost/myapp-vhosts.conf and /opt/bitnami/apache/conf/httpd.conf respectivley? Commented Oct 3, 2024 at 13:51

1 Answer 1

1

Ok I find how to do it. I'm sharing it for anyone in need :

In the /opt/bitnami/conf/httpd.conf, no need for include

Include should be added at the end of the following file /opt/bitnami/apache/conf/bitnami/bitnami.conf

For https redirection, I created a other vhost configuration file : myapp-https-vhosts.conf with the SSL Certificate ans de 443 port as explained here : https://docs.bitnami.com/general/infrastructure/lamp/configuration/configure-custom-application/

This file should also be included in bitnami.conf

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.