title: Webmin login keeps looping to session_login.cgi
body: <p>I've had a working webmin setup on a VPS, however after trying to force it to connect via HTTPS I've done goof somewhere and now whenever I try to login the login page doesn't display correctly (no blue rectange background) and trying to login via <code>https://server1.domain.me:10000</code> keeps redirecting me to <code>https://server1.domain.me:10000/webmin/session_login.cgi</code>, which is again a login page.</p>
  
  <p>Before it began malfunctioning, I had the following file in <code>/etc/apache2/sites-available</code></p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
          ServerAdmin webmaster@domain.me
          ServerName domain.me
          ServerAlias www.domain.me
  
          DocumentRoot /var/www/domain.me/
          &lt;Directory /&gt;
                  RedirectMatch temp ^/$ /public_html
                  Options FollowSymLinks
                  AllowOverride None
          &lt;/Directory&gt;
  
          &lt;Directory /var/www/domain.me&gt;
                  Options Indexes FollowSymLinks MultiViews
                  AllowOverride None
                  Order allow,deny
                  allow from all
          &lt;/Directory&gt;
  
          &lt;Directory /var/www/domain.me/redmine&gt;
                  AllowOverride None
                  order allow,deny
                  allow from all
                  RailsBaseURI /redmine
                  PassengerResolveSymlinksInDocumentRoot on
          &lt;/Directory&gt;
  
         ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
          &lt;Directory "/usr/lib/cgi-bin"&gt;
                  AllowOverride None
                  Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                  Order allow,deny
                  Allow from all
          &lt;/Directory&gt;
  
          ErrorLog ${APACHE_LOG_DIR}/error.log
  
          # Possible values include: debug, info, notice, warn, error, crit,
          # alert, emerg.
          LogLevel warn
  
          CustomLog ${APACHE_LOG_DIR}/access.log combined
          ServerSignature On
  
          RailsEnv production
          RailsBaseURI /redmine 
  
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>When I tried to force webmin (and owncloud if that matters) to use HTTPS I created a new Virtualhost for port 443 using my SSL keys and updated Virtualhost for port 80 to proxy all <code>http://domain.me/webmin</code> to <code>https://server1.domain.me:10000</code> (I kept commented-out configs for you to see what I've tried):</p>
  
  <pre><code>&lt;VirtualHost *:443&gt;
          ServerAdmin webmaster@domain.me
          ServerName server1.domain.me
          alias /owncloud /var/www/domain.me/owncloud
  
          DocumentRoot /var/www/domain.me/
  
          SSLEngine On
          SSLProxyEngine On
          SSLCertificateFile /etc/ssl/ssl.crt/server1_domain_me.crt
          SSLCertificateKeyFile /etc/ssl/ssl.crt/server1.key
          SSLCACertificateFile /etc/ssl/ssl.crt/COMODORSADomainValidationSecureServerCA.crt
  
          ProxyRequests Off
  
          &lt;Proxy *&gt;
                  Order deny,allow
                  Allow from all
          &lt;/Proxy&gt;
  
  #       &lt;Location /webmin&gt;
  #               RewriteEngine On
  #               #RewriteRule (.*) https://server1.domain.me:10000/$1 [R,L]
  #               ProxyPass https://server1.domain.me:10000/
  #               ProxyPassReverse https://server1.domain.me:10000/
  #       &lt;/Location&gt;
  
          &lt;Directory /var/www/domain.me/owncloud&gt;
                  Options Indexes FollowSymLinks MultiViews
                  AllowOverride All
                  Order allow,deny
                  Allow from all
  
                  Satisfy Any
  
                  &lt;IfModule mod_rewrite.c&gt;
                          RewriteEngine on
                          &lt;IfModule mod_ssl.c&gt;
                                  RewriteEngine On
                                  RewriteRule ^/?(.*)$ https://%{HTTP_HOST}/owncloud$
                          &lt;/IfModule&gt;
                  &lt;/IfModule&gt;
          &lt;/Directory&gt;
  
  
  #       ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
  #        &lt;Directory "/usr/lib/cgi-bin"&gt;
  #                AllowOverride None
  #                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
  #                Order allow,deny
  #                Allow from all
  #        &lt;/Directory&gt;
  
  
          ErrorLog ${APACHE_LOG_DIR}/error.log
  
          # Possible values include: debug, info, notice, warn, error, crit,
          # alert, emerg.
          LogLevel warn
  
          CustomLog ${APACHE_LOG_DIR}/access.log combined
          ServerSignature On
  
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>and updated my domain.me virtualhost file to:</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
          ServerAdmin webmaster@domain.me
          ServerName domain.me
          ServerAlias www.domain.me
  
          #SSLEngine On
          SSLProxyEngine On
          SSLProxyCheckPeerCN off
          SSLProxyCheckPeerExpire off
  
          &lt;Proxy *&gt;
                  Order allow,deny
                  Allow from all
          &lt;/Proxy&gt;
  
          DocumentRoot /var/www/domain.me/
          &lt;Directory /&gt;
                  RedirectMatch temp ^/$ /public_html
                  Options FollowSymLinks
                  AllowOverride None
          &lt;/Directory&gt;
  
          &lt;Directory /var/www/domain.me&gt;
                  Options Indexes FollowSymLinks MultiViews
                  AllowOverride None
                  Order allow,deny
                  allow from all
          &lt;/Directory&gt;
  
          &lt;Directory /var/www/domain.me/redmine&gt;
                  AllowOverride None
                  order allow,deny
                  allow from all
                  RailsBaseURI /redmine
                  PassengerResolveSymlinksInDocumentRoot on
          &lt;/Directory&gt;
  
          &lt;Location /owncloud&gt;
                  ProxyPass https://server1.domain.me/owncloud/
          &lt;/Location&gt;
  
          &lt;Location /server1&gt;
                  ProxyPass https://server1.domain.me/webmin/
          &lt;/Location&gt;
  
         ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
          &lt;Directory "/usr/lib/cgi-bin"&gt;
                  AllowOverride None
                  Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                  Order allow,deny
                  Allow from all
          &lt;/Directory&gt;
  
          ErrorLog ${APACHE_LOG_DIR}/error.log
  
          # Possible values include: debug, info, notice, warn, error, crit,
          # alert, emerg.
          LogLevel warn
  
          CustomLog ${APACHE_LOG_DIR}/access.log combined
          ServerSignature On
  
          RailsEnv production
          RailsBaseURI /redmine
  
  
          #ProxyPassReverse /owncloud https://server1.domain.me/owncloud/
          #ProxyPassReverse /webmin https://server1.domain.me:10000/
  
  
  
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>I also added the lines <code>webprefix=/webmin</code>, <code>webprefixnoredir=1</code> and <code>referer=domain.me</code> to <code>/etc/webmin/config</code></p>
  
  <p>However, something is clearly wrong here because I cannot login to webmin at all. I've been searching the web for an answer for the past 5 hours, tried a lot of thing and still no luck.</p>
  
  <p>Any ideas?</p>