virtualMachinelapp

Create a virtual host for a custom application

Understand virtual host configuration files

Bitnami installations that use system packages contain virtual host configuration files for applications in the /opt/bitnami/apache/conf/vhosts directory.

  • The APPNAME-vhosts.conf file contains the default configuration for the HTTP virtual host. This configuration applies to applications accessed through an HTTP URL, such as http://myapp.example.com.

    NOTE: Replace the APPNAME placeholder with the identifier of the Bitnami application name, i.e. wordpress.

      <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>
    
  • The APPNAME-https-vhosts.conf file contains the default configuration for the HTTPS virtual host. This configuration applies to applications accessed through an HTTPS URL, such as https://myapp.example.com.

      <VirtualHost 127.0.0.1:443 _default_:443>
        ServerAlias *
        DocumentRoot /opt/bitnami/APPNAME
        SSLEngine on
        SSLCertificateFile "/opt/bitnami/apache/conf/bitnami/certs/server.crt"
        SSLCertificateKeyFile "/opt/bitnami/apache/conf/bitnami/certs/server.key"
        <Directory "/opt/bitnami/APPNAME">
          Options -Indexes +FollowSymLinks -MultiViews
          AllowOverride All
          Require all granted
        </Directory>
      </VirtualHost>
    

Define virtual host configuration

Bitnami installations enable virtual hosts by default.

Last modification February 9, 2023