-1

I have a lightsailt LAMP instance. It uses bitnami and I changed the /opt/bitnami/apache/conf/httpd-vhosts.conf to add a new subdomain.

<VirtualHost *:80>
    ServerName newsubdomain.domain.com
    ServerAlias newsubdomain.domain.com
    DocumentRoot /home/bitnami/test
        <Directory /home/bitnami/test/>
                Options -Indexes
                AllowOverride All
                Require all granted
        </Directory>
    ErrorLog "logs/test-error_log"
    CustomLog "logs/test-access_log" common
</VirtualHost>
<VirtualHost *:80>
    ServerName oldsubdomain.domain.com
    ServerAlias oldsubdomain.domain.com
    DocumentRoot "/opt/bitnami/apache/htdocs"
        <Directory /opt/bitnami/apache/htdocs>
                Options -Indexes
                AllowOverride All
                Require all granted
        </Directory>
    ErrorLog "logs/old.com-error_log"
    CustomLog "logs/old.com-access_log" common
</VirtualHost>
<VirtualHost *:80>
    ServerName SERVER IP
    ServerAlias SERVER IP
    DocumentRoot /home/bitnami/test
        <Directory /home/bitnami/test/>
                Options -Indexes
                AllowOverride All
                Require all granted
        </Directory>
    ErrorLog "logs/ip-error_log"
    CustomLog "logs/ip-access_log" common
</VirtualHost>

I also added a new file inside /opt/bitnami/apache/conf/vhosts/ name test-vhost.conf:

  <VirtualHost 127.0.0.1:80 _default_:80>
    ServerAlias newsubdomain.domain.com
    DocumentRoot /home/bitnami/test
    <Directory "/home/bitnami/test">
      Options -Indexes +FollowSymLinks -MultiViews
      AllowOverride All
      Require all granted
    </Directory>
  </VirtualHost>

When I go to the server ip i get the test index.html but when i go to the new subdomain i get redirected to the old subdomain page.

I restarted apache using the bitnami script, restarted the bitnami daemon completely but going into the new subdomain I can't get the test page, I only get redirected to the old subdomain page.

1 Answer 1

0

Let's Encrypt was rerouting HTTPS request to oldsubdomain. If I go specifically to http://newsubdomain.domain.com I get the test file.

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.