[SOLVED] mod_rewrite in cgi-folder

Discussion in 'Installation/Configuration' started by Chris18, Jul 6, 2016.

  1. Chris18

    Chris18 New Member

    Hi all
    I bought a Withings scale and created my own data backend. I re-routed the traffic of the withings.net domain on my router to my ISP Config installation and my scale tries to communicate now with my own server. The scale tries to connect to various files within the cgi-bin folder. On my old webserver (not ISPconfig) I just created the following .htaccess file in the root folder and everything worked well:
    Code:
    RewriteEngine On
    RewriteRule ^cgi-bin/once$ withings.php?s=once
    RewriteRule ^cgi-bin/session$ withings.php?s=session
    RewriteRule ^cgi-bin/maint$ withings.php?s=maint
    RewriteRule ^cgi-bin/measure$ withings.php?s=measure
    On my new ISPconfig installation I created a new domain (withings.net) and deactivated cgi-bin and added the .htaccess files as outlined above. But I always get a 404 error message. A test with another folder than cgi-bin (i.e. ^test/once$ withings?s=once) is working well.

    There are no hints in the log files except the 404 error message.

    Your help would be very much appreciated.
    Chris
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Check your global apache config, maybe there is a global alias for cgi-bin somewhere.
     
  3. Chris18

    Chris18 New Member

    Hi Till
    Thanks a lot for you reply - I checked all config files and the only cgi-bin reference I found is in the following file:
    etc/apache2/conf-enabled/serve-cgi-bin.conf
    with the following cgi related config:
    Code:
    <IfModule mod_alias.c>
            <IfModule mod_cgi.c>
                    Define ENABLE_USR_LIB_CGI_BIN
            </IfModule>
    
            <IfModule mod_cgid.c>
                    Define ENABLE_USR_LIB_CGI_BIN
            </IfModule>
    
            <IfDefine ENABLE_USR_LIB_CGI_BIN>
                    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
                    <Directory "/usr/lib/cgi-bin">
                            AllowOverride None
                            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                            Require all granted
                    </Directory>
            </IfDefine>
    </IfModule>
    I assume I cannot just disable the above mentioned apache config file as it affects all other vhost that still need the cgi-bin folder. Or can I?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    You can disable that file, ispconfig does not use it.
     
  5. Chris18

    Chris18 New Member

    Hi Till
    Thanks a lot - I disabled the config filed and everything is now working as expected.
     

Share This Page