Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Correct server settings when hosting after an url prefix

  • logiza
  • logiza's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 2 months ago #224233 by logiza
Please help us help you and fill where relevant:
Your LimeSurvey version: 3.27.33+220125
Own server or LimeSurvey hosting: Own server: containerized in kubernetes
Theme: Standard
==================
Situation
I have a fully functional LimeSurvey in kubernetes. Within the cluster all works fine and it is running on the following location:
container.namespace.svc.cluster.local/

I want to have this container used outside the cluster for the users. They use an Ingres gateway. I have managed to access the server from outside the cluster on this location: 
app.mykubernetes.com/namespace/container/

Problem
I'm unable to set the config.php and/or apache virtualserver settings correctly to use LimeSurvey server outside the cluster, on: app.mykubernetes.com/namespace/container/
Does anyone has a suggestion how to make the HTML links link properly from '/' to '/namespace/container'?

Observations:
Without changes, the homepage loads perfectly within the cluster: ://container.namespace.svc.cluster.local/
Outside the cluster, ://app.mykubernetes.com/namespace/container/, the homepage loads, but all HTML links, still link to '/' instead of '/namespace/container/' 
When i open ://app.mykubernetes.com/namespace/container/admin/ it redirect to the non existing ://app.mykubernetes.com/index.php/admin/authentication/sa/login (missing the server url prefix 'namespace/container')

Attempted actions
After reading I would expect I have to do two changes: 
  1. Update the 'hostInfo' in config.php: 
    Code:
    'hostInfo'=>'http://app.mykubernetes.com/namespace/container'
  2. Add a apache virtualserver as 000-default.conf to folder /etc/apache2/sites-enabled: 
Code:
 
<VirtualHost *:80>
    ServerName app.mykubernetes.com
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html
        Alias /namespace/container /var/www/html
 
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost> 

after updating the file, i reload apache by running the following code on the container: 
Code:
/etc/init.d/apache2 reload

Results
When I apply step 1 and 2:
  • UI HTML links still link to '/' 
  • ://app.mykubernetes.com/namespace/container/admin/ is now available outside the cluster
  • ://container.namespace.svc.cluster.local/admin now redirect to ://app.mykubernetes.com/namespace/container/admin (but this is not available within the cluster and there is no need to)
I also tried some virtualserver settings, but then the pages would load a Proxy error:
Code:
ProxyPass / http://app.mykubernetes.com/namespace/container/ nocanon
ProxyPassReverse / http://app.mykubernetes.com/namespace/container/

Also tried some actions with 'ServerAlias', without results. 

Does anyone has a suggestion how to make the HTML links link properly from '/' to '/namespace/container'?

Please Log in to join the conversation.

More
1 year 5 months ago - 1 year 5 months ago #232957 by jimmi4u
I didn't get the point why you are using the internal kubedns names, but you mentioned that your cluster is accessible through a ingressgateway, so I assume networking is ok.
To your question: Have you tried a rewrite in your apache conf? 
Last edit: 1 year 5 months ago by jimmi4u.

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose