.htaccess rules work for apache but no LS

QuantumNet

Well-Known Member
#1
Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?pg=$1 [L,QSA]

With apache this allows requests to be directed through PHP so the PHP application can handle the Friendly URL request and display the correct page accordingly. the !-f and !-d conditions tell apache not to direct directory and file requests to PHP.


Litespeed ignores these flags and directs everything through PHP, preventing people from downloading files.
 

mistwang

LiteSpeed Staff
#2
It should work. You can enable rewrite log by adding

RewriteLogLevel 9

to the <VirtualHost .... > section for that vhost in httpd.conf

Rewrite log will be in lsws/conf/error.log or /usr/local/apache/logs/error_log when used with cPanel. Once we get the log, we can pinpoint the problem.
 

QuantumNet

Well-Known Member
#3
[root@*** logs]# more error.log|grep goldgoat
2008-12-03 09:50:27.909 [INFO] [74.85.160.100:13211-0#APVH_www.***.com] [REWRITE] strip base: '/' from URI: '/goat/goldgoat.tar'
2008-12-03 09:50:27.909 [INFO] [74.85.160.100:13211-0#APVH_www.***.com] [REWRITE] Rule: Match 'goat/goldgoat.tar' with pattern '^robots\.txt$', result: -1
2008-12-03 09:50:27.909 [INFO] [74.85.160.100:13211-0#APVH_www.***.com] [REWRITE] Rule: Match 'goat/goldgoat.tar' with pattern '^(.*)$', result: 2
2008-12-03 09:50:27.909 [INFO] [74.85.160.100:13211-0#APVH_www.***.com] [REWRITE] stat( /home/***/***.com/public_html/goat/goldgoat.tar ) failed
2008-12-03 09:50:27.909 [INFO] [74.85.160.100:13211-0#APVH_www.***.com] [REWRITE] stat( /home/***/***.com/public_html/goat/goldgoat.tar ) failed
2008-12-03 09:50:27.909 [INFO] [74.85.160.100:13211-0#APVH_www.***.com] [REWRITE] Source URI: 'goat/goldgoat.tar' => Result URI: 'index.php?pg=goat/goldgoat.tar'
2008-12-03 09:50:27.909 [INFO] [74.85.160.100:13211-0#APVH_www.***.com] [REWRITE] append query string 'pg=goat/goldgoat.tar'
[root@*** logs]# ls /home/***/***.com/public_html/goat/goldgoat.tar
/home/***/***.com/public_html/goat/goldgoat.tar
[root@*** logs]# ls /home/***/***.com/public_html/goat/
goldgoat.tar
[root@*** logs]#
 

mistwang

LiteSpeed Staff
#4
Looks like a permission problem, maybe the user that lshttpd run as has no permission to check file status under goat/ directory.
 

QuantumNet

Well-Known Member
#5
drwxr-xr-x 2 zippy zippy 4096 Dec 1 16:44 goat
-rw-r--r-- 1 zippy zippy 12466360320 Dec 1 16:06 goldgoat.tar


even if I chown both directory and file to apache:apache I have the same problem.
 

mistwang

LiteSpeed Staff
#6
how about command

sudo -u apache ls .../goat/

if get permission denied, it is a permission problem, otherwise, we have to look somewhere else.
 

QuantumNet

Well-Known Member
#8
[root@srv goat]# sudo -u apache ls ../goat/
audit_log_user_command(): Connection refused
goldgoat.tar


[root@*** goat]# ps aux|grep http
root 9851 0.0 0.2 5148 2300 ? S 10:05 0:00 lshttpd
root 9852 0.0 0.0 1592 336 ? S 10:05 0:00 httpd (lscgid)
apache 9853 0.0 0.1 5340 2072 ? S 10:05 0:00 lshttpd


[root@*** goat]# ps aux|grep php
apache 9866 0.0 0.9 26676 9480 ? S 11:39 0:00 lsphp5
apache 26233 0.0 0.7 22968 8324 ? Ss 10:22 0:00 lsphp5
 

mistwang

LiteSpeed Staff
#9
goldgoat.tar is a 12GB file, without Large file support, stat() function will fail.
Our 4.0b3 has large file support for 32bit OS, you can give it a try.
 
Top