Description
The titlesearch action fails if using wsgi with ssl. The page is found, but the URL is wrong. The prefix the engine creates is http and not https, which it should be.
Steps to reproduce
Our wiki is secured with SSL. Without WSGI everything is fine.
When switching to WSGI, the wiki performs well, but the titlesearch does not give URL with https, only http. Other functions are OK.
Please see our apache config below. If we comment the WSGIScriptAlias and uncomment the ScriptAlias everything is as expected.
Apache Configuration
NameVirtualHost *:443 <VirtualHost *:443> ServerName ilz.tremel-computer.de ... # MoinMoin 01.10.2008 # this is for icons, css, js (and must match url_prefix from wiki config): Alias /moin_static172 "/usr/share/moin/htdocs/" # this is the URL http://servername/mywiki/ you will use later to invoke moin: # ScriptAlias /adminwiki "/var/lib/moin/adminwiki/cgi-bin/moin.cgi" WSGIScriptAlias /adminwiki "/var/lib/moin/adminwiki/cgi-bin/moin.wsgi" # create some wsgi daemons WSGIDaemonProcess moin user=www-data group=www-data home=/home/www-data processes=2 threads=10 maximum-requests=1000 umask=0007 display-name=wsgi-moin # use the daemons we defined above to process requests! WSGIProcessGroup moin <Directory /usr/share/moin/htdocs/> Options +FollowSymLinks AllowOverride All order allow,deny allow from all </Directory> <Directory /var/lib/moin/adminwiki/> AuthType Basic AuthName "Tremel Wiki ist nur mit Passwort zugänglich" AuthUserFile /var/lib/....... # AuthGroupFile /www/passwords/group.file Require valid-user </Directory> ...
Example
- if it is a single hit, we get redirected to http: url
- if there are multiple hits in the search results, the target URLs are correct
Component selection
- http redirect to single search result
Details
MoinMoin Version |
1.7.2 |
OS and Version |
Debian etch/amd64 |
Python Version |
2.4.4-2 |
Server Setup |
Apache 2.2.3-4+etch5 |
Server Details |
libapache2-mod-wsgi Version 2.3-1~bpo40+1 |
Language you are using the wiki in (set in the browser/UserPreferences) |
german |
Workaround
Add the missing s to the URL e.g. https://ilz.tremel-computer.de/adminwiki/HelpOnActions instead of http://ilz.tremel-computer.de/adminwiki/HelpOnActions
Discussion
I tried it here on moinmo.in and all URLs in the search results just start with /PageName... - they do not include any protocol or server specification. This is moin 1.8.0rc, though.
- Yes, in a search result with more than one hit the links are similar in my wiki. Is it a problem with my apache configuration?
I am using some farmwikis with http and https and have no problem with the search (well using xapian). here my example apache ssl configuration apache2-moinmoin.conf. My system is Debian Linux with Apache 2, MoinMoin 1.7.1!, Python 2.4 and Xapian 1.0.5. Maybe something because of your apache authentication stuff... don't know - other ideas would be to rebuilding the xapain index.... well! -- MarcelHäfner 2008-10-08 11:01:24
Thank you for your answer. I did a lot of restructuring and reconfiguration in my apache configs. I learned a lot, most important that NameVirtualHost ist not possible for SSL (see http://httpd.apache.org/docs/2.0/ssl/ssl_faq.html#vhosts). Unfortunately all of this does not solve the problem. I looked in fullsearch.py an found the redirect statement, but I am not a python freak, so I can't step through this code. Just a feeling: since with the old Alias without wsgi everything works fine, i think it is a problem around mod_wsgi or moinmoin, but I can't explain better. Thank You.
ok, sorry I can't help. Only know that I'm using a Debian Server and running a farm moinmoin with http and https (and for every ssl I use different ip adresses). a few other ideas:
Another possibility is to running two separated apache web server. The first one will have https and http and proxy back everything to the second "localhost" apache (with mod_wsgi). On the first Apache you can rewrite the urls for the static file... so the second is kind of "application server".. well this is how my provider let me run my "own" mod_wsgi. This configuration works with 1.8 and http/https gives me no problem with searches (don't forget to add proxies_trusted = ['127.0.0.1', ] }} to the {{{ request/__init__.py file , that's all). bye
Another Idea...I do not think that you need to change the fullsearch stuff; the html code of the search form should look like this <form id="searchform" action="/Index" method="get"> . If there is standing http://yourwebsite/Index (https!) then I think your apache config is wrong; maybe check every module witch is loaded and if you can not disable them (I only use mod_wsgi, mod_alias, mod_rewrite and mod_log_config). Also maybe recheck your url rewrite and alias stuff.
I tested the fixes http://hg.moinmo.in/moin/1.7/rev/3e019f6ae381 plus http://hg.moinmo.in/moin/1.7/rev/bf543d0796c8 and they worked for me. Thank you for this wonderful example of good open source support! -- DieterTremel
Plan
- Priority:
- Assigned to:
Status: fixed in 1.7 by http://hg.moinmo.in/moin/1.7/rev/3e019f6ae381 plus http://hg.moinmo.in/moin/1.7/rev/bf543d0796c8 -- please test this!