ispCP - Board - Support
RewriteEngine not allowed here - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Support Area (/forum-30.html)
+--- Forum: System Setup & Installation (/forum-32.html)
+--- Thread: RewriteEngine not allowed here (/thread-9366.html)

Pages: 1 2


RewriteEngine not allowed here - NIIcK - 01-25-2010 11:06 PM

Hello,

I have a web site that needs RewriteEngine on in cgi-bin and I can't find where in the config files can I enable it.

The error is: /var/www/virtual/***.com/cgi-bin/.htaccess: RewriteEngine not allowed here.

Please help!

Thank you,

Nick


RE: RewriteEngine not allowed here - kilburn - 01-25-2010 11:32 PM

Edit /etc/apache2/ispcp/domain.tld.conf, and add:
Quote: <Directory /var/www/virtual/domain.tld/cgi-bin>
AllowOverride AuthConfig FileInfo
</Directory>

Done.


RE: RewriteEngine not allowed here - NIIcK - 01-26-2010 12:59 AM

(01-25-2010 11:32 PM)kilburn Wrote:  Edit /etc/apache2/ispcp/domain.tld.conf, and add:
Quote: <Directory /var/www/virtual/domain.tld/cgi-bin>
AllowOverride AuthConfig FileInfo
</Directory>

Done.

Thank you for your quick reply!

There is no RewriteEngine error after I've added the suggested lines but I still get an internal server error (500) and I have a different error in suexec.log:

Code:
[2010-01-25 16:58:41]: uid: (2005/vu2005) gid: (2005/vu2005) cmd: index.cgi
[2010-01-25 16:58:41]: target uid/gid (2005/2005) mismatch with directory (2005/2005) or program (0/0)

The content of the .htaccess in htdocs folder is:

Code:
RewriteEngine on
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule ^(.*) - [E=HTTP_CGI_AUTHORIZATION:%1]

RewriteRule    ^$                        /cgi-bin/index.cgi [L]
RewriteRule    ([0-9A-Za-z]{12})-del-([0-9A-Za-z]+)/.+$        /cgi-bin/index.cgi?del=$1-$2 [L]

RewriteCond    %{REQUEST_FILENAME} !-f
#RewriteRule    ^([0-9A-Za-z\-_]*)/?([0-9A-Za-z]{12})(\.html?|$)$        /cgi-bin/index.cgi?op=download1&usr_login=$1&id=$2 [L]
#RewriteRule    ^([0-9A-Za-z\-_]*)/?([0-9A-Za-z]{12})/([^\/]*)(\.html?|$)$    /cgi-bin/index.cgi?op=download1&usr_login=$1&id=$2&fname=$3 [L]
RewriteRule    ^([0-9A-Za-z\-_]*)/?([0-9A-Za-z]{12})(/[^\/]*|$)(\.html?|$)$    /cgi-bin/index.cgi?op=download1&usr_login=$1&id=$2&fname=$3 [L]

RewriteRule    ^checkfiles\.html$                    /cgi-bin/index.cgi?op=checkfiles [L]
RewriteRule    ^contact\.html$                        /cgi-bin/index.cgi?op=contact [L]
RewriteRule    ^premium\.html$                        /cgi-bin/index.cgi?op=payments [L]
RewriteRule    ^login\.html$                        /cgi-bin/index.cgi?op=login [L]
RewriteRule    ^catalogue(.*)\.html$                    /cgi-bin/index.cgi?op=catalogue&date=$1 [L]
RewriteRule    ^news(\d*)\.html$                    /cgi-bin/index.cgi?op=news&page=$1 [L]
RewriteRule    ^n(\d+)-.*\.html$                    /cgi-bin/index.cgi?op=news_details&news_id=$1 [L]

RewriteCond    %{REQUEST_FILENAME} !-f
RewriteCond    %{REQUEST_FILENAME} !-d
RewriteRule    ^([0-9A-Za-z\-_]{4,64})(/[^\/]*/?|$)$        /cgi-bin/index.cgi?op=user_public&usr_login=$1&fld=$2 [L,NC]

RewriteCond    %{REQUEST_FILENAME} !-f
RewriteRule    ^([a-z0-9\-\_]+).html(.*)            /cgi-bin/index.cgi?op=page&tmpl=$1$2 [L]

ErrorDocument 404 /404.html

#AddDefaultCharset UTF-8
#AddType 'text/xml; charset=UTF-8' rss
#AddCharset UTF-8 .rss

and redirects all traffic to the cgi-bin folder where I have a different .htaccess file:

Code:
RewriteEngine on
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule ^(.*) - [E=HTTP_CGI_AUTHORIZATION:%1]

#LimitRequestBody 10000000000000

<IfModule mod_security.c>
    SecFilterEngine Off
    SecFilterScanPOST Off
    SetEnvIfNoCase Content-Type "^multipart/form-data;" "MODSEC_NOPOSTBUFFERING=Do not buffer file uploads"
</IfModule>

<IfModule mod_gzip.c>
    mod_gzip_on No
</IfModule>

<IfModule mod_deflate.c>
    SetEnvIfNoCase Request_URI testenv.cgi no-gzip dont-vary
    SetEnvIfNoCase Request_URI upload_status.cgi no-gzip dont-vary
    SetEnvIfNoCase Request_URI upload.cgi no-gzip dont-vary
</IfModule>

Thank you,

Nick


RE: RewriteEngine not allowed here - kilburn - 01-26-2010 01:05 AM

Code:
[2010-01-25 16:58:41]: target uid/gid (2005/2005) mismatch with directory (2005/2005) or program (0/0)

This is, your "index.cgi" file is owned by root:root. This website's user is vu2005:vu2005, and therefore suexec refuses to run your index.cgi file because of owner and group mismatch.

In short: "chown -R vu2005:vu2005 /var/www/domaint.tld/cgi-bin" will solve your issue.


RE: RewriteEngine not allowed here - NIIcK - 01-26-2010 01:12 AM

(01-26-2010 01:05 AM)kilburn Wrote:  
Code:
[2010-01-25 16:58:41]: target uid/gid (2005/2005) mismatch with directory (2005/2005) or program (0/0)

This is, your "index.cgi" file is owned by root:root. This website's user is vu2005:vu2005, and therefore suexec refuses to run your index.cgi file because of owner and group mismatch.

In short: "chown -R vu2005:vu2005 /var/www/domaint.tld/cgi-bin" will solve your issue.

Indeed it solved it. Thank you very much!

If I may, I have noticed that the password for the stats/ section (awstats) of each site differs from the password set up for that particular username. How can I tell what password the respective username should use to access the stats/ section?

Regards,

Nick


RE: RewriteEngine not allowed here - kilburn - 01-26-2010 01:14 AM

You can change it in the web tools -> protected areas section of the domain's control panel Smile


RE: RewriteEngine not allowed here - NIIcK - 01-26-2010 01:20 AM

(01-26-2010 01:14 AM)kilburn Wrote:  You can change it in the web tools -> protected areas section of the domain's control panel Smile

Great! Smile Thank you for your time and patience.

By the way. I am more than willing to offer my help in creating a Romanian language pack should you consider such a pack as appropriate.

Tho whom should I talk to?

Cheers,

Nick


RE: RewriteEngine not allowed here - kilburn - 01-26-2010 01:29 AM

The romanian translation is not very far from being complete, see the translations page on how to finish it Smile Obviously, you can also obtain the current translation and install it in your panel Smile


RE: RewriteEngine not allowed here - NIIcK - 01-26-2010 01:45 AM

(01-26-2010 01:29 AM)kilburn Wrote:  The romanian translation is not very far from being complete, see the translations page on how to finish it Smile Obviously, you can also obtain the current translation and install it in your panel Smile

I've downloaded the ro_RO.po file, got into the admin panel, clicked install and I get this error: Uploaded file is not a valid language file!

Nick

***Later edit***

I've found the .po converter and installed the language pack successfully.


RE: RewriteEngine not allowed here - kilburn - 01-26-2010 01:50 AM

(01-26-2010 01:45 AM)NIIcK Wrote:  
(01-26-2010 01:29 AM)kilburn Wrote:  The romanian translation is not very far from being complete, see the translations page on how to finish it Smile Obviously, you can also obtain the current translation and install it in your panel Smile

I've downloaded the ro_RO.po file, got into the admin panel, clicked install and I get this error: Uploaded file is not a valid language file!

Nick

The .po file is to help translating. You need the "language file" to install it (click on the language name to download it, not in the .po file link).