googlemean

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 /opt/bitnami/apps/myapp/ directory:

  • Run the following commands to create the directories:

    $ sudo mkdir /opt/bitnami/apps/myapp
    $ sudo mkdir /opt/bitnami/apps/myapp/htdocs/
    $ sudo mkdir /opt/bitnami/apps/myapp/conf
    
  • Create and edit the /opt/bitnami/apps/myapp/conf/httpd-prefix.conf file and add the lines below to it:

    Alias /myapp/ "/opt/bitnami/apps/myapp/htdocs/"
    Alias /myapp "/opt/bitnami/apps/myapp/htdocs/"
    Include "/opt/bitnami/apps/myapp/conf/httpd-app.conf"
    
  • Create and edit the /opt/bitnami/apps/myapp/conf/httpd-app.conf file and add the lines below to it. This is the main configuration file for your application, so modify it further depending on your application’s requirements.

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

    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 /opt/bitnami/apache2/conf/bitnami/bitnami-apps-prefix.conf, as shown below:

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

    $ sudo /opt/bitnami/ctlscript.sh restart apache
    

You should now be able to access the application at http://SERVER-IP/myapp.

Last modification December 10, 2018