Skip to main content

Virtual Host

Now we need to create the virtual host file to show Ticaga to the world.

Let's create the ticaga configuration file, in our example we're installing on https://ubuntu.ticaga.com for testing:

sudo nano /etc/apache2/sites-available/ubuntu.ticaga.com.conf

Paste and edit the following for your needs:

<VirtualHost *:80>
     ServerName ubuntu.ticaga.com
     DocumentRoot /var/www/ticaga/public
     <Directory /var/www/ticaga/public>
          Options FollowSymlinks
          AllowOverride All
          Require all granted
          <Files .env>
                Order allow,deny
                Deny from all
          </Files>
     </Directory>
     ErrorLog ${APACHE_LOG_DIR}/ubuntu.ticaga.com_error.log
     CustomLog ${APACHE_LOG_DIR}/ubuntu.ticaga.com.log combined
</VirtualHost>

You need to keep the /public folder because if you don't you'll expose all the Laravel files in the Ticaga installation.

Now we need to activate our new config:

sudo a2ensite ubuntu.ticaga.com.conf

And disable the default one:

sudo a2dissite 000-default.conf

Now restart Apache:

systemctl reload apache2