Create a custom HTTP-only application

To create a custom HTTP-only application, such as an AngularJS application that only requires an HTML index page, a CSS file and a Javascript file, follow the steps below. These steps assume that your application will live in the installdir/apps/myapp/ directory:

  • Run the following commands to create the directories:

      $ sudo mkdir installdir/apps/myapp
      $ sudo mkdir installdir/apps/myapp/htdocs/
      $ sudo mkdir installdir/apps/myapp/conf
  • Create and edit the installdir/apps/myapp/conf/httpd-prefix.conf file and add the following lines:

      Alias /myapp/ "installdir/apps/myapp/htdocs/"
      Alias /myapp "installdir/apps/myapp/htdocs/"
      Include "installdir/apps/myapp/conf/httpd-app.conf"
  • Create and edit the installdir/apps/myapp/conf/httpd-app.conf file and add the following lines:

    IMPORTANT: This is the main configuration file for your application, so modify it further depending on your application’s requirements.

      <Directory installdir/apps/myapp/htdocs/>
          Options +FollowSymLinks
          AllowOverride None
          Require all granted

    NOTE: Bitnami uses the htaccess.conf file for security and performance purposes. This is the approach we recommend for custom applications too. However, if your application uses .htaccess files instead, you should change the AllowOverride None option to AllowOverride All and add an Include directive to include your custom .htaccess file after the above configuration block.

  • Once you have created the files and directories above, add the following line to the end of the main Apache configuration file at installdir/apache2/conf/bitnami/bitnami-apps-prefix.conf, as shown below:

      Include "installdir/apps/myapp/conf/httpd-prefix.conf"
  • Restart the Apache server:

      $ sudo installdir/ restart apache

    You should now be able to access the application at http://localhost/myapp.

Last modification April 22, 2020