Skip to content

Commit

Permalink
updating the content of outreach.conf for apache
Browse files Browse the repository at this point in the history
  • Loading branch information
Thibault authored and GitHub committed Jun 20, 2025
1 parent ce0062c commit f059634
Showing 1 changed file with 42 additions and 26 deletions.
68 changes: 42 additions & 26 deletions docs/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,37 +106,53 @@ Assuming there is an exisiting apache server running on the server, we need to a

```apache
<VirtualHost hypso.space:80>
ServerName hypso.space
DocumentRoot /var/www/html/outreach
ServerName hypso.space
DocumentRoot /var/www/html/hypso
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/
RewriteRule ^/(.*)$ https://hypso.space/$1 [L,R=301]
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/
RewriteRule ^/(.*)$ https://hypso.space/$1 [L,R=301]
<Directory "/var/www/html/hypso/dataportal_v2">
Header always set Access-Control-Allow-Origin "https://hypso.space/dataportal"
Header always set Access-Control-Allow-Methods "GET, HEAD"
Header always set Access-Control-Allow-Headers "Origin, Authorization, X-Requested-With, Content-Type, Accept"
Header always set Access-Control-Allow-Credentials "true"
</Directory>
</VirtualHost>
<IfModule ssl_module>
<VirtualHost hypso.space:443>
ServerName hypso.space
SSLEngine on
ProxyRequests off
ProxyPreserveHost On
SSLCertificateFile "/etc/letsencrypt/live/hypso.space/fullchain.pem"
SSLCertificateKeyFile "/etc/letsencrypt/live/hypso.space/privkey.pem"
<Location />
ProxyPass http://127.0.0.1:3000/
ProxyPassReverse http://127.0.0.1:3000/
</Location>
<Location /strapi>
ProxyPass http://127.0.0.1:1337
ProxyPassReverse http://127.0.0.1:1337
ProxyPreserveHost On
</Location>
Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains"
</VirtualHost>
ServerName hypso.space
SSLEngine on
ProxyRequests off
ProxyPreserveHost On
SSLCertificateFile "/etc/letsencrypt/live/hypso.space/fullchain.pem"
SSLCertificateKeyFile "/etc/letsencrypt/live/hypso.space/privkey.pem"
<Location />
ProxyPass http://127.0.0.1:3000/
ProxyPassReverse http://127.0.0.1:3000/
ProxyPreserveHost On
</Location>
<Location /dataportal>
ProxyPass http://127.0.0.1:1334/dataportal
ProxyPassReverse http://127.0.0.1:1334/dataportal
ProxyPreserveHost On
</Location>
<Location /strapi>
ProxyPass http://127.0.0.1:1337
ProxyPassReverse http://127.0.0.1:1337
ProxyPreserveHost On
</Location>
Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains"
</VirtualHost>
</IfModule>
```
This will redirect all traffic to the https version of the website and proxy the traffic to the correct ports as well as supporting SSL renewal on port 80
Expand Down Expand Up @@ -182,4 +198,4 @@ To set up the certificate, follow the instructions on [certbot](https://certbot.

1. Follow the guide [here](https://www.ntnu.no/wiki/display/ntnuitubuntu/Semi-managed+Linux+servers) to install the nessecary software packages. These should include `certbot`, `python3-certbot-apache` or `python3-certbot-nginx` depending on the server setup.
2. Run `sudo certbot certonly --apache` to generate the certificate.
3. Make sure the certificate is set up correctly in the apache configuration file.
3. Make sure the certificate is set up correctly in the apache configuration file.

0 comments on commit f059634

Please sign in to comment.