Configure Apache
Statamic is capable of being served from many different web servers, most notably, Apache and NGINX. Debian includes a running Apache web server by default, so this document provides instructions for Apache only.
Perform the following steps to configure Apache on Debian to serve your Statamic site:
If you have not already done so, start an SSH session with your GCP VM:
ssh user@yourVmIp
Change to your webroot directory. The default webroot in Apache is
/var/www/html/
:cd /var/www/html/
Delete the default index page:
sudo rm -rf index.html
Change to your site directory:
cd /var/www/html/yourSiteName
Modify permissions, allowing the Apache "www-data" user to properly access and make changes to your website files:
sudo chown -R www-data:www-data site local statamic assets
Enable the sample "htaccess" file by removing the sample prefix:
mv sample.htaccess .htaccess
Enable url rewriting:
sudo a2enmod rewrite
Restart Apache:
systemctl restart apache2