From d270e8fb42906c0da8344485c209c81f7476f2e8 Mon Sep 17 00:00:00 2001 From: Mat_ <190149+agenceKanvas@users.noreply.github.com> Date: Wed, 3 Jul 2024 00:59:04 +0200 Subject: [PATCH] Create run-with-apache.md (#1394) I've created a page as simple as I could. Feel free to tell me if you want me to change anything. --------- Co-authored-by: Yuri Astrakhan --- docs/src/SUMMARY.md | 1 + docs/src/run-with-apache.md | 68 +++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 docs/src/run-with-apache.md diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index 62b84d8f8..d7e9e525f 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -12,6 +12,7 @@ - [Running with Docker](run-with-docker.md) - [Running with Docker Compose](run-with-docker-compose.md) - [Running with NGINX](run-with-nginx.md) + - [Running with Apache](run-with-apache.md) - [Running in AWS Lambda](run-with-lambda.md) - [Troubleshooting](troubleshooting.md) - [Configuration File](config-file.md) diff --git a/docs/src/run-with-apache.md b/docs/src/run-with-apache.md new file mode 100644 index 000000000..e387bf947 --- /dev/null +++ b/docs/src/run-with-apache.md @@ -0,0 +1,68 @@ +## Using with Apache + +You can run Martin behind Apache "kind of" proxy, so you can use HTTPs with it. Here is an example of the configuration file that runs Martin with Apache. + +First you have to setup a virtual host that is working on the port 443. + +### Enable necessary modules + +Ensure the required modules are enabled: + +```bash + +sudo a2enmod proxy +sudo a2enmod proxy_http +sudo a2enmod headers +sudo a2enmod rewrite + +``` + +### Modify your VHOST configuration + +Open your VHOST configuration file for the domaine you're using, mydomain.tld : + +```bash + +sudo nano /etc/apache2/sites-available/mydomain.tld.conf + +``` + +### Update the configuration + +```apache + + + ServerName mydomain.tld + ServerAdmin webmaster@localhost + DocumentRoot /var/www/mydomain + ProxyPreserveHost On + + RewriteEngine on + RewriteCond %{REQUEST_URI} ^/tiles/(.*)$ + RewriteRule ^/tiles/(.*)$ http://localhost:3000/tiles/$1 [P,L] + + + RequestHeader set X-Forwarded-Proto "https" + + + ProxyPass / http://localhost:3000/ + ProxyPassReverse / http://localhost:3000/ + + +``` + +### Check Configuration: Verify the Apache configuration for syntax errors + +```bash + +sudo apache2ctl configtest + +``` + +### Restart Apache: If the configuration is correct, restart Apache to apply the changes + +```bash + +sudo systemctl restart apache2 + +```