Actions

Install/2-3/Apache: Difference between revisions

From Convention Master Documentation

(Created page with "<div style="float:right;"> Next: 2.4 - Install the Ioncube Loader >> </div> << Previously: 2.2 - Configure Networking = Con...")
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 6: Line 6:
= Configure Apache Webserver =
= Configure Apache Webserver =


By default on Ubuntu 18.04, the Apache 2 document root is found at /var/www/html. For our basic setup, we're going to ditch the /var/www/html folder and run straight from /var/www. If you already have a site running at this location, remember to configure the virtual host's path to your preferred location in the steps that follow.
By default on Ubuntu 22.04, the Apache 2 document root is found at /var/www/html. For our basic setup, we're going to ditch the /var/www/html folder and run straight from /var/www. If you already have a site running at this location, remember to configure the virtual host's path to your preferred location in the steps that follow.


Disable the default site.
Disable the default site.


sudo a2dissite 000-default
<syntaxhighlight lang="bash">
    sudo a2dissite 000-default
</syntaxhighlight>




Create the convention_master Apache configuration file, and copy in the configuration in the box below.
Enable mod-rewrite (used by our kiosk system)


sudo joe /etc/apache2/sites-available/convention_master.conf
<syntaxhighlight lang="bash">
    sudo a2enmod rewrite
</syntaxhighlight>




Create the convention_master Apache configuration file, and copy in the configuration in the box below. (You should customise this later with an SSL certificate, but those instructions are implementation-specific and beyond the scope of this tutorial. '''Do not run Convention Master without SSL protection!''')
<syntaxhighlight lang="bash">
    sudo joe /etc/apache2/sites-available/convention_master.conf
</syntaxhighlight>
File contents:
<syntaxhighlight lang="apacheconf">
     <VirtualHost *:80>
     <VirtualHost *:80>
       ServerAdmin NameOfSomeone
       ServerAdmin NameOfSomeone
Line 26: Line 40:
       LogLevel warn
       LogLevel warn
       CustomLog /var/log/apache2/cm_access.log combined
       CustomLog /var/log/apache2/cm_access.log combined
      # Needed for .htaccess functionality
      <Directory /var/www>
        AllowOverride All
        Require all granted
      </Directory>
     </VirtualHost>
     </VirtualHost>
</syntaxhighlight>




Enable the site.
Enable the site.


sudo a2ensite convention_master
<syntaxhighlight lang="bash">
    sudo a2ensite convention_master
</syntaxhighlight>




Load the configuration into the Apache server.
Restart the Apache server to enable config and modules


sudo systemctl reload apache2.service
<syntaxhighlight lang="bash">
    sudo systemctl restart apache2.service
</syntaxhighlight>





Latest revision as of 01:33, 16 December 2022

<< Previously: 2.2 - Configure Networking

Configure Apache Webserver

By default on Ubuntu 22.04, the Apache 2 document root is found at /var/www/html. For our basic setup, we're going to ditch the /var/www/html folder and run straight from /var/www. If you already have a site running at this location, remember to configure the virtual host's path to your preferred location in the steps that follow.

Disable the default site.

    sudo a2dissite 000-default


Enable mod-rewrite (used by our kiosk system)

    sudo a2enmod rewrite


Create the convention_master Apache configuration file, and copy in the configuration in the box below. (You should customise this later with an SSL certificate, but those instructions are implementation-specific and beyond the scope of this tutorial. Do not run Convention Master without SSL protection!)

    sudo joe /etc/apache2/sites-available/convention_master.conf


File contents:

    <VirtualHost *:80>
      ServerAdmin NameOfSomeone
      DocumentRoot /var/www
      ErrorLog /var/log/apache2/cm_error.log
      # Possible values include: debug, info, notice, warn, error, crit,
      # alert, emerg.
      LogLevel warn
      CustomLog /var/log/apache2/cm_access.log combined
      # Needed for .htaccess functionality
      <Directory /var/www>
        AllowOverride All
        Require all granted
      </Directory>
    </VirtualHost>


Enable the site.

    sudo a2ensite convention_master


Restart the Apache server to enable config and modules

    sudo systemctl restart apache2.service


Test your Apache server to see if you have succeeded, by navigating to your IP address as configured in step 3.2. (Example: http://10.10.2.10/)

Web-root.png

Seeing a “index of” or “It works!” or even a “Forbidden” message is good.