meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
digital:server:matrixsynapse [2020/06/17 19:33]
natrius [Step 2 - Install Synapse] - spelling error in example url
digital:server:matrixsynapse [2020/07/20 21:36]
natrius Changed example.com to homeserver.example according to RFC 2606 https://tools.ietf.org/html/rfc2606#section-2
Line 52: Line 52:
     sudo apt install matrix-synapse-py3     sudo apt install matrix-synapse-py3
  
-During the installation, it will ask you about the matrix server name - type in your domain ''example.com''. (We will not use ''matrix.example.com'', because we also don't use ''mail.example.com'' for our E-Mails. This will work with well.known, SRV-records and nginx.+During the installation, it will ask you about the matrix server name - type in your domain ''homeserver.example''. (We will not use ''matrix.homeserver.example'', because we also don't use ''mail.homeserver.example'' for our E-Mails. This will work with well.known, SRV-records and nginx.
  
 **Don't leave the hostname blank during setup.** **Don't leave the hostname blank during setup.**
Line 73: Line 73:
 <code> <code>
 { {
-    "m.server": "synapse.example.com:443"+    "m.server": "synapse.homeserver.example:443"
 } }
 </code> </code>
  
-Where ''/'' is the root of your webserver. So if you navigate to ''https://example.com/.well-known/matrix/server'' it may try to download the ''server'' file or show it directly.+Where ''/'' is the root of your webserver. So if you navigate to ''https://homeserver.example/.well-known/matrix/server'' it may try to download the ''server'' file or show it directly.
  
 ### Step 3 - Configure Synapse ### Step 3 - Configure Synapse
Line 140: Line 140:
     sudo apt-get install certbot python-certbot-nginx     sudo apt-get install certbot python-certbot-nginx
  
-Generate the SSL certificate files for the matrix domain name ''example.com'' using the certbot command as shown below.+Generate the SSL certificate files for the matrix domain name ''homeserver.example'' using the certbot command as shown below.
  
     sudo certbot --nginx     sudo certbot --nginx
  
-The Letsencrypt tool will generate SSL certificate files by running the 'standalone' temporary web server for verification. When it's complete, you will get the information that its done and where the certificates are stored. Usally the SSL certificate files for the Synapse domain name ''example.com'' are generated inside the ''/etc/letsencrypt/live/'' directory.+The Letsencrypt tool will generate SSL certificate files by running the 'standalone' temporary web server for verification. When it's complete, you will get the information that its done and where the certificates are stored. Usally the SSL certificate files for the Synapse domain name ''homeserver.example'' are generated inside the ''/etc/letsencrypt/live/'' directory.
  
 <code> <code>
Line 151: Line 151:
 Obtaining a new certificate Obtaining a new certificate
 Performing the following challenges: Performing the following challenges:
-http-01 challenge for example.com+http-01 challenge for homeserver.example
 Waiting for verification... Waiting for verification...
 Cleaning up challenges Cleaning up challenges
Line 157: Line 157:
 IMPORTANT NOTES: IMPORTANT NOTES:
  - Congratulations! Your certificate and chain have been saved at:  - Congratulations! Your certificate and chain have been saved at:
-   /etc/letsencrypt/live/example.com/fullchain.pem+   /etc/letsencrypt/live/homeserver.example/fullchain.pem
    Your key file has been saved at:    Your key file has been saved at:
-   /etc/letsencrypt/live/example.com/privkey.pem+   /etc/letsencrypt/live/homeserver.example/privkey.pem
    Your cert will expire on 2019-03-03. To obtain a new or tweaked    Your cert will expire on 2019-03-03. To obtain a new or tweaked
    version of this certificate in the future, simply run certbot    version of this certificate in the future, simply run certbot
Line 190: Line 190:
     sudo systemctl enable nginx.service     sudo systemctl enable nginx.service
  
-Next, we will create a new virtual host configuration for the domain name ''example.com''. Go to the '/etc/nginx' configuration directory and create a new virtual host file 'matrix'.+Next, we will create a new virtual host configuration for the domain name ''homeserver.example''. Go to the '/etc/nginx' configuration directory and create a new virtual host file 'matrix'.
  
 <code>sudoedit /etc/nginx/sites-available/matrix</code> <code>sudoedit /etc/nginx/sites-available/matrix</code>
  
-Paste the following configuration there, changing the domain ''example.com'' to your own:+Paste the following configuration there, changing the domain ''homeserver.example'' to your own:
  
 <code> <code>
 server { server {
        listen 80;        listen 80;
-       server_name example.com;+       server_name homeserver.example;
        return 301 https://$server_name$request_uri;        return 301 https://$server_name$request_uri;
 } }
Line 206: Line 206:
     listen 443 ssl;     listen 443 ssl;
     listen [::]:443 ssl;     listen [::]:443 ssl;
-    server_name example.com;+    server_name homeserver.example;
  
-    ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; +    ssl_certificate /etc/letsencrypt/live/homeserver.example/fullchain.pem; 
-    ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;+    ssl_certificate_key /etc/letsencrypt/live/homeserver.example/privkey.pem;
  
     # If you don't wanna serve a site, comment this out     # If you don't wanna serve a site, comment this out
Line 220: Line 220:
     }     }
     location /.well-known/matrix/server {     location /.well-known/matrix/server {
-      return 200 '{"m.server": "example.com:443"}';+      return 200 '{"m.server": "homeserver.example:443"}';
       add_header Content-Type application/json;       add_header Content-Type application/json;
     }     }
     location /.well-known/matrix/client {     location /.well-known/matrix/client {
-      return 200 '{"m.homeserver": {"base_url": "https://example.com"},"m.identity_server": {"base_url": "https://vector.im"}}';+      return 200 '{"m.homeserver": {"base_url": "https://homeserver.example"},"m.identity_server": {"base_url": "https://vector.im"}}';
       add_header Content-Type application/json;       add_header Content-Type application/json;
       add_header "Access-Control-Allow-Origin" *;       add_header "Access-Control-Allow-Origin" *;
Line 328: Line 328:
 ### Step 9 - Testing ### Step 9 - Testing
  
-If you have used Riot with the desktop application before you may not want to log out, so it is better to go to [[https://riot.im/app/]] and press "Launch now". If you have used the web client before, download the Riot desktop application, install it and open the Riot software. With both you will get the Matrix login page now. Type the matrix username and password, then choose the 'Custom server' option and type the domain name from your server ''example.com'' in. Click the ''Sign In'' button and you will get to the Riot Dashboard.+If you have used Riot with the desktop application before you may not want to log out, so it is better to go to [[https://riot.im/app/]] and press "Launch now". If you have used the web client before, download the Riot desktop application, install it and open the Riot software. With both you will get the Matrix login page now. Type the matrix username and password, then choose the 'Custom server' option and type the domain name from your server ''homeserver.example'' in. Click the ''Sign In'' button and you will get to the Riot Dashboard.
  
 The Synapse homeserver is up and running under the Nginx reverse proxy HTTPS connection, and the user is now logged in to the Synapse homeserver using the Riot application. The Synapse homeserver is up and running under the Nginx reverse proxy HTTPS connection, and the user is now logged in to the Synapse homeserver using the Riot application.
Line 334: Line 334:
 If you need two instances of riot instead, you can start it with argument, refer to [[digital:software:riotim|Riot.im]]. If you need two instances of riot instead, you can start it with argument, refer to [[digital:software:riotim|Riot.im]].
  
-For another way to test it, go to ''https://example.com/_matrix/static/'' and you will be presented with a ''**It works! Synapse is running**'' screen or go to ''https://example.com/_matrix/client/versions'' and the output should look like the following:+For another way to test it, go to ''https://homeserver.example/_matrix/static/'' and you will be presented with a ''**It works! Synapse is running**'' screen or go to ''https://homeserver.example/_matrix/client/versions'' and the output should look like the following:
  
 <code xml> <code xml>
Line 413: Line 413:
 ### Whats my version ### Whats my version
  
-  * https://example.com/_matrix/federation/v1/version+  * https://homeserver.example/_matrix/federation/v1/version
  
 ### Location of logs ### Location of logs