Current time: 11-18-2024, 01:51 PM Hello There, Guest! (LoginRegister)


Post Reply 
RewriteEngine not allowed here
Author Message
NIIcK Offline
Junior Member
*

Posts: 43
Joined: Jan 2010
Reputation: 0
Post: #1
RewriteEngine not allowed here
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
01-25-2010 11:06 PM
Visit this user's website Find all posts by this user Quote this message in a reply
kilburn Offline
Development Team
*****
Dev Team

Posts: 2,182
Joined: Feb 2007
Reputation: 34
Post: #2
RE: RewriteEngine not allowed here
Edit /etc/apache2/ispcp/domain.tld.conf, and add:
Quote: <Directory /var/www/virtual/domain.tld/cgi-bin>
AllowOverride AuthConfig FileInfo
</Directory>

Done.
01-25-2010 11:32 PM
Visit this user's website Find all posts by this user Quote this message in a reply
NIIcK Offline
Junior Member
*

Posts: 43
Joined: Jan 2010
Reputation: 0
Post: #3
RE: RewriteEngine not allowed here
(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
(This post was last modified: 01-26-2010 01:02 AM by NIIcK.)
01-26-2010 12:59 AM
Visit this user's website Find all posts by this user Quote this message in a reply
kilburn Offline
Development Team
*****
Dev Team

Posts: 2,182
Joined: Feb 2007
Reputation: 34
Post: #4
RE: RewriteEngine not allowed here
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.
(This post was last modified: 01-26-2010 01:07 AM by kilburn.)
01-26-2010 01:05 AM
Visit this user's website Find all posts by this user Quote this message in a reply
NIIcK Offline
Junior Member
*

Posts: 43
Joined: Jan 2010
Reputation: 0
Post: #5
RE: RewriteEngine not allowed here
(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
01-26-2010 01:12 AM
Visit this user's website Find all posts by this user Quote this message in a reply
kilburn Offline
Development Team
*****
Dev Team

Posts: 2,182
Joined: Feb 2007
Reputation: 34
Post: #6
RE: RewriteEngine not allowed here
You can change it in the web tools -> protected areas section of the domain's control panel Smile
01-26-2010 01:14 AM
Visit this user's website Find all posts by this user Quote this message in a reply
NIIcK Offline
Junior Member
*

Posts: 43
Joined: Jan 2010
Reputation: 0
Post: #7
RE: RewriteEngine not allowed here
(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
01-26-2010 01:20 AM
Visit this user's website Find all posts by this user Quote this message in a reply
kilburn Offline
Development Team
*****
Dev Team

Posts: 2,182
Joined: Feb 2007
Reputation: 34
Post: #8
RE: RewriteEngine not allowed here
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
01-26-2010 01:29 AM
Visit this user's website Find all posts by this user Quote this message in a reply
NIIcK Offline
Junior Member
*

Posts: 43
Joined: Jan 2010
Reputation: 0
Post: #9
RE: RewriteEngine not allowed here
(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.
(This post was last modified: 01-26-2010 01:49 AM by NIIcK.)
01-26-2010 01:45 AM
Visit this user's website Find all posts by this user Quote this message in a reply
kilburn Offline
Development Team
*****
Dev Team

Posts: 2,182
Joined: Feb 2007
Reputation: 34
Post: #10
RE: RewriteEngine not allowed here
(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).
01-26-2010 01:50 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 5 Guest(s)