1

I'm failing and would like some help.

I've installed Wiki.js at wiki.mydomain.com, and I've been able to access it via HTTP on the port I designated to it, port 8080. But when I started trying to enable SSL, I kept breaking it. And so when I try to reverse proxy that SSL to 8080, I get "502 proxy error".

  • Already installed the certificate via certbot to wiki.mydomain.com

I'd appreciate any and all input, even if it's regarding some other aspect of the configuration.


WIKI.MYDOMAIN.COM.CONF

 <VirtualHost *:80>

 ProxyPreserveHost On
 ProxyPass / http://1.2.3.4:8080/
 ProxyPassReverse / http://1.2.3.4:8080/

 ServerName wiki.mydomain.com
 DocumentRoot /var/www/wiki.mydomain.com/

 RewriteEngine on
 RewriteCond %{SERVER_NAME} =wiki.mydomain.com
 RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

 </VirtualHost>

WIKI.MYDOMAIN.COM-LE-SSL.CONF

 #Listen 443
 #NameVirtualHost *:443

 <IfModule mod_ssl.c>
 <VirtualHost *:443>

 ProxyPass / http://1.2.3.4:8080/ retry=1 acquire=3000 Keepalive=On
 ProxyPassReverse / http://1.2.3.4:8080/

 ServerName wiki.mydomain.com
 DocumentRoot /var/www/wiki.mydomain.com/

 #MANUALEDITING

 #Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"

 #/MANUALEDITING

 SSLEngine On
 SSLCertificateFile /etc/letsencrypt/live/wiki.mydomain.com/fullchain.pem
 SSLCertificateKeyFile /etc/letsencrypt/live/wiki.mydomain.com/privkey.pem
 Include /etc/letsencrypt/options-ssl-apache.conf

 </VirtualHost>
 </IfModule>

/VAR/WWW/WIKI.MYDOMAIN.COM/CONFIG.YML

 ...
 host: 'https://wiki.mydomain.com'
 port: 8080
 ...

/ETC/MONGODB.CONF

 ...
 bind_ip = 127.0.0.1,1.2.3.4
 port = 27017
 ...
 # SSL options
 # Enable SSL on normal ports
 #sslOnNormalPorts = true
 # SSL Key file and password
 #sslPEMKeyFile = /etc/letsencrypt/live/wiki.mydomain.com/fullchain.pem
 #sslPEMKeyPassword =  /etc/letsencrypt/live/wiki.mydomain.com/keyfile.pem

(Whenever I've tried to uncomment / enable that SSL section there, it causes mongodb.service to fail to load.)


DNS

wiki.mydomain.com TXT = "replicaSet=mySet&authSource=authDB" @ 86400
_mongodb._tcp.server.my.domain.com SRV = "wiki.mydomain.com" @ 86400 on port 8080

Pretty sure I'm not matching something up properly here...

Stennie
  • 1,270
  • 7
  • 13
Steven
  • 26
  • 1
  • 6
  • 1
    What's in the Apache error log? – Michael Hampton Feb 19 '19 at 02:09
  • @MichaelHampton: After searching /var/log/apache2/error.log with Ctrl+W for "wiki", "8080", and "MongoDB", nothing shows up there. But I just reloaded the site while watching the network traffic and saw the error message "no-referrer-when-downgrade". – Steven Feb 19 '19 at 03:04
  • The MongoDB config should be the same in either http or https mode, since your end users are connecting via Apache / Wiki.js. I'm not familiar with Wiki,js, but expect its documentation would have more information on configuration. – Stennie Feb 19 '19 at 04:30
  • Are you sure nothing is logged after you receive a 502 error? Did you actually look at the end of the log, instead of just searching for keywords you thought might have been there? – Michael Hampton Feb 19 '19 at 05:05
  • Hi guys, thanks, but it doesn't matter anymore. I just stopped trying and installed Plesk, which makes all that stuff seamless. Set up MediaWiki with it, and no more problems. – Steven Mar 04 '19 at 10:37

0 Answers0