this post was submitted on 23 Feb 2024
23 points (100.0% liked)

ProleWiki

842 readers
1 users here now

ProleWiki

A community related to the ProleWiki project.

Post in this community to request articles, provide suggestions and discuss ways to develop our project

founded 4 years ago
MODERATORS
 

We can no longer ignore there are Matrix users among our editorship, who prefer it over Discord for various reasons, some being they had to use VPN, they prefer Matrix for privacy and security, or simply because they hate Discord for some reason

There's also the problem our organization is currently intrinsically tied with Discord. So if we ever "found" to "break the rules" of the "community guidelines," which is always a bullshit excuse for censorship, we will face a major setback in our organization before we re-organize ourselves more autonomously.

Having a Matrix server and channels neatly organized can be a safe backup from such a setback, but the major reason we (and by this I mean mostly myself) are currently researching into implementing a Matrix server, is to host a bridge which would allow seamless communication between our Matrix and Discord members

Comrade @[email protected] from GenZedong has generously offered support in implementing the server, but neither of us knew how to configure the Apache webserver, which is the stack used by ProleWiki, and I'm currently stuck figuring this out. She has also set up a Matrix-Discord bridge herself for us to use, but it's safer for us to host one ourselves, to avoid leaving the server dependent on other servers.

Instead of requesting for a single person, anyone willing to help, please do so in the comments, and I'll answer you. I will share some information about our server configuration in the process, and since any conversation here is public, try not to ask any sensitive information.

I think this way more people can chime in and help us out, I've been having headaches with this πŸ₯²

top 10 comments
sorted by: hot top controversial new old
[–] [email protected] 3 points 8 months ago* (last edited 8 months ago) (1 children)

I don't know the entirety of your stack and constraints but I run my own matrix instance with this https://github.com/spantaleev/matrix-docker-ansible-deploy

I run it on a separate VM from anything else so that might be easier than what you are currently doing.

I'm more of on nginx user but happy to take a look at your Apache config if need be

[–] [email protected] 2 points 8 months ago

The only reason we use Apache is because there is more documentation for MediaWiki running on Apache webservers, but I'm considering transferring our stuff to nginx, not sure if that will be easy

[–] [email protected] 5 points 8 months ago (3 children)

Based on suggestions by Elara, I'm currently trying to deploy Dendrite.

I've installed it, managed to make it run, and currently is operating at matrix.prolewiki.org:8008. But I probably didn't set up Apache correctly because matrix.prolewiki.org doesn't redirect to it. Federation Tester shows we're not correctly configured

[–] [email protected] 1 points 8 months ago* (last edited 8 months ago) (1 children)

This is the Apache config @[email protected] @[email protected] @[email protected] :

<VirtualHost *:80>
	ServerName matrix.prolewiki.org
	ServerAdmin webmaster@localhost

	ErrorLog ${APACHE_LOG_DIR}/matrix.log
	CustomLog ${APACHE_LOG_DIR}/matrix_access.log combined

	RewriteEngine on
	RewriteCond %{SERVER_NAME} =matrix.prolewiki.org
	RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

<IfModule mod_ssl.c>
<VirtualHost *:443 *:8448>
	SSLEngine on
	ServerName matrix.prolewiki.org

	ErrorLog ${APACHE_LOG_DIR}/matrix.log
	CustomLog ${APACHE_LOG_DIR}/matrix_access.log combined

	Include /etc/letsencrypt/options-ssl-apache.conf

	RequestHeader set "X-Forwarded-Proto"expr=%{REQUEST_SCHEME}
	ProxyPreserveHost On
	ProxyPass "/_matrix/identity" "http://localhost:8090/_matrix/identity"
	ProxyPass "/_matrix" "http://localhost:8008/_matrix"nocanon

	<Location /.well-known/matrix/server>
		ErrorDocument 200 '{"m.server": "matrix.prolewiki.org"}'
		Redirect 200 /
		Header always set Content-Type application/json
		Header always set Access-Control-Allow-Origin *
	</Location>
	<Location /.well-known/matrix/client>
		ErrorDocument 200 '{"m.homeserver": {"base_url": "https://matrix.prolewiki.org" } }'
		Redirect 200 /
		Header always set Content-Type application/json
		Header always set Access-Control-Allow-Origin *
	</Location>
	SSLCertificateFile /etc/letsencrypt/live/prolewiki.org/fullchain.pem
	SSLCertificateKeyFile /etc/letsencrypt/live/prolewiki.org/privkey.pem
</VirtualHost>
</IfModule>
[–] [email protected] 2 points 8 months ago (1 children)

So far as I can tell, there isn't anything that looks wrong. I copied the RequestHeader, ProxyPreserveHost and ProxyPass "_matrix" parts to local and it worked fine. The rest either doesn't matter when it comes to /_matrix or don't look wrong. You have an error log I can see, can you provide them (removing anything that shouldn't be public)

[–] [email protected] 1 points 8 months ago (1 children)

I found a recurring message in the error log:

[Sat Feb 24 02:21:57.081476 2024] [proxy:warn] [pid 614188] [client 213.32.242.176:47708] AH01144: No protocol handler was valid for the URL /_matrix (scheme 'http'). If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.
[Sat Feb 24 02:29:39.507804 2024] [proxy:warn] [pid 615347] [client 213.32.242.176:2635] AH01144: No protocol handler was valid for the URL /_matrix/static/ (scheme 'http'). If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.

etc.

[–] [email protected] 3 points 8 months ago* (last edited 8 months ago) (1 children)

I FUCKING KNEW IT!

I was JUST thinking that was the problem. Uncomment #LoadModule proxy_http_module mod_proxy_http.so

[–] [email protected] 3 points 8 months ago

I think you are right, comrade. The installation now works πŸ‘

But I had to load the modules with a2enmod proxy and a2enmod proxy_http

[–] [email protected] 6 points 8 months ago

Need help with the Apache config? I can chat with you on matrix to figure out the problem. You are supposed to set up a reverse proxy and not a redirect. I only have experience with nginx and caddy but could Google how to do it on Apache.

[–] [email protected] 4 points 8 months ago

But I probably didn’t set up Apache correctly because matrix.prolewiki.org doesn’t redirect to it.

Redirect to it? It isn't supposed to redirect (i.e. 301), it's supposed to respond at /_matrix and proxy it to 8008