Cannot get virtual hosts to work

Keywords: LAMP/MAMP/WAMP - AWS - How to - Other
Description:
Having followed the steps on the Bitnami docs page and restarted apache I cannot get my virtual host to point to the correct directory.

Here’s the suggested code, and already I don’t really understand:

Filename:
APPNAME-vhosts.conf

Code:

<VirtualHost 127.0.0.1:80 _default_:80>
    ServerAlias *
    DocumentRoot /opt/bitnami/APPNAME
    <Directory "/opt/bitnami/APPNAME">
      Options -Indexes +FollowSymLinks -MultiViews
      AllowOverride All
      Require all granted
    </Directory>
  </VirtualHost>

How is apache supposed to recognise MYAPP1.com vs MYAPP1.org if we’re not entering the ServerName parameter? To be fair to Bitnami, these instructions appear to relate only to subdomains, but then where are the instructions for virtual hosts for different domains? I really need to solve this, because currently, hosting these sites is costing me money I don’t have.

Hi @vurtual,

Thanks for using Bitnami. Can you try to set your domain name instead of ServerAlias * with ServerName yourdomain.com? Remember to restart Apache after that.

sudo /opt/bitnami/ctlscript.sh restart apache

Also, we have a Support Tool that will gather relevant information for us to analyze your configuration and logs. Could you please execute it on the machine where the stack is running by following the steps described in the guide below?

Please note that you need to paste the code ID that is shown at the end.

No luck. I visit website a, I get the intended document, I visit website b and I get website a.

Here’s the support code:
83a95f87-aa9e-0c36-0485-691fb7897a9d

Hi @vurtual,

Thanks for the code. According to the bnsupport bundle, I don’t see any issue with the configuration. And I was able to visit your two different domains (4go***e.co.uk and vu***l.co.uk). However, I’m getting a forbidden error for accessing the second one, but not website 4go.... Can you check if you reproduce the same behavior in an incognito window?

If you do, can you share with us the output of running the next comand?

ls -lart /opt/bitnami

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