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@yourVmIpChange 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.htmlChange to your site directory:
cd /var/www/html/yourSiteNameModify 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 assetsEnable the sample "htaccess" file by removing the sample prefix:
mv sample.htaccess .htaccessEnable url rewriting:
sudo a2enmod rewriteRestart Apache:
systemctl restart apache2