Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create run-with-apache.md #1394

Merged
merged 5 commits into from
Jul 2, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Create run-with-apache.md
agenceKanvas authored Jul 1, 2024
commit 25949efa780141106a9c387739ab60fed16b1d09
58 changes: 58 additions & 0 deletions docs/src/run-with-apache.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@

## 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

Check failure on line 8 in docs/src/run-with-apache.md

GitHub Actions / Build Docs

Headings should be surrounded by blank lines

docs/src/run-with-apache.md:8 MD022/blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### Enable necessary modules"] https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md022.md
Ensure the required modules are enabled:
```bash

Check failure on line 10 in docs/src/run-with-apache.md

GitHub Actions / Build Docs

Fenced code blocks should be surrounded by blank lines

docs/src/run-with-apache.md:10 MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```bash"] https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md031.md
sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2enmod headers
sudo a2enmod rewrite
```

### Modify your VHOST configuration:

Check failure on line 17 in docs/src/run-with-apache.md

GitHub Actions / Build Docs

Headings should be surrounded by blank lines

docs/src/run-with-apache.md:17 MD022/blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### Modify your VHOST configuration:"] https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md022.md

Check failure on line 17 in docs/src/run-with-apache.md

GitHub Actions / Build Docs

Trailing punctuation in heading

docs/src/run-with-apache.md:17:36 MD026/no-trailing-punctuation Trailing punctuation in heading [Punctuation: ':'] https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md026.md
Open your VHOST configuration file for the domaine you're using, mydomain.tld :
```bash

Check failure on line 19 in docs/src/run-with-apache.md

GitHub Actions / Build Docs

Fenced code blocks should be surrounded by blank lines

docs/src/run-with-apache.md:19 MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```bash"] https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md031.md
sudo nano /etc/apache2/sites-available/mydomain.tld.conf
```

### Update the configuration

Check failure on line 23 in docs/src/run-with-apache.md

GitHub Actions / Build Docs

Headings should be surrounded by blank lines

docs/src/run-with-apache.md:23 MD022/blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### Update the configuration"] https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md022.md
```apache

Check failure on line 24 in docs/src/run-with-apache.md

GitHub Actions / Build Docs

Fenced code blocks should be surrounded by blank lines

docs/src/run-with-apache.md:24 MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```apache"] https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md031.md
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName mydomain.tld
ServerAdmin webmaster@localhost
DocumentRoot /var/www/mydomain
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ProxyPreserveHost On

RewriteEngine on
RewriteCond %{REQUEST_URI} ^/tiles/(.*)$
RewriteRule ^/tiles/(.*)$ http://localhost:3000/tiles/$1 [P,L]

<IfModule mod_headers.c>
RequestHeader set X-Forwarded-Proto "https"
</IfModule>

ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/

SSLCertificateFile /etc/letsencrypt/live/mydomain.tld/fullchain.pem

Check failure on line 45 in docs/src/run-with-apache.md

GitHub Actions / Build Docs

Hard tabs

docs/src/run-with-apache.md:45:1 MD010/no-hard-tabs Hard tabs [Column: 1] https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md010.md
SSLCertificateKeyFile /etc/letsencrypt/live/mydomain.tld/privkey.pem

Check failure on line 46 in docs/src/run-with-apache.md

GitHub Actions / Build Docs

Hard tabs

docs/src/run-with-apache.md:46:1 MD010/no-hard-tabs Hard tabs [Column: 1] https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md010.md
Include /etc/letsencrypt/options-ssl-apache.conf

Check failure on line 47 in docs/src/run-with-apache.md

GitHub Actions / Build Docs

Hard tabs

docs/src/run-with-apache.md:47:1 MD010/no-hard-tabs Hard tabs [Column: 1] https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md010.md
</VirtualHost>
```

### 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
```