SOLVED - Configuring Apache HTTP Reverse-Proxy

OpenKM has many interesting features, but requires some configuration process to show its full potential.
Forum rules
Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
Post Reply
maniachhz
Junior Boarder
Junior Boarder
Posts: 26
Joined: Wed Mar 08, 2017 4:30 pm

SOLVED - Configuring Apache HTTP Reverse-Proxy

Post by maniachhz » Fri Dec 08, 2017 9:51 am

Hi guys,

I read the manual: https://docs.openkm.com/kcenter/view/ok ... proxy.html

then done:
step-1. changed the port to 8181

Code: Select all

huanghanzhen@function:~$ cat /etc/apache2/ports.conf
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf

#Listen 80
Listen 8181

<IfModule ssl_module>
	Listen 443
</IfModule>

<IfModule mod_gnutls.c>
	Listen 443
</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
huanghanzhen@function:~$ 
step-2. added the redmine_openkm.conf, and enable the site

Code: Select all

huanghanzhen@function:~$ cat /etc/apache2/sites-available/redmine_openkm.conf
<VirtualHost *:8181>
    #SSLEngine On
    #SSLCertificateFile /etc/ssl/certs/redmine_openkm.crt
    #SSLCertificateKeyFile /etc/ssl/private/redmine_openkm.key

    ServerAdmin hanzhenhuang@function-g.com
    Servername localhost
    DocumentRoot /var/www/html/
    redirectMatch ^/openkm.* /OpenKM
    redirectMatch ^/$ /redmine/

     <Location /redmine>
         RailsEnv production
         RackBaseURI /redmine
         Options -MultiViews
    </Location>

    <Location /OpenKM>
        #ProxyRequests Off
        #ProxyPreserveHost On
        ProxyPass ajp://127.0.0.1:8009/OpenKM keepalive=On
        ProxyPassReverse http://localhost:8181/OpenKM
        
    </Location>

     ErrorLog /var/log/apache2/openkm-error.log
     CustomLog /var/log/apache2/openkm-access.log combined


</VirtualHost>
step-3. changed the OpenKM default port to:8181

Code: Select all

    <Connector port="8181" address="0.0.0.0" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
step-4.

Code: Select all

$ sudo /etc/init.d/apache2 start
$ sudo /opt/openkm/tomcat/bin/catalina.sh start 
Finishing above steps, the OpenKM works when i visit: http://xxxx:8181/OpenKM

My questions:
1. do i need add the port to

Code: Select all

 ProxyPassReverse http://localhost:8181/OpenKM 
on step-2 ?

2. do i need change the openkm to 8181? if i don't update 8080 to 8181, the OpenKM does not work.

In a word, is there a mistake in my operation above?

Thanks.
Last edited by maniachhz on Fri Dec 08, 2017 10:41 am, edited 1 time in total.

maniachhz
Junior Boarder
Junior Boarder
Posts: 26
Joined: Wed Mar 08, 2017 4:30 pm

Re: Configuring Apache HTTP Reverse-Proxy

Post by maniachhz » Fri Dec 08, 2017 10:40 am

Never mind.

comment <Connector ... item on the step-3, the OpenKM works.
step-3. changed the OpenKM default port to:8181
<Connector port="8181" address="0.0.0.0" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />

jllort
Moderator
Moderator
Posts: 10078
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: SOLVED - Configuring Apache HTTP Reverse-Proxy

Post by jllort » Fri Dec 08, 2017 7:37 pm

If you comment the 8080 ( or in your case 8180 ) server.xml line, then everything goes across the ajp.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests