LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > LiteSpeed Cache > LiteSpeed Cache + PhpFox

Reply
 
Thread Tools Display Modes
  #11  
Old 12-28-2012, 06:28 PM
LowKey LowKey is offline
Member
 
Join Date: Dec 2012
Posts: 16
Hi,

Still got issue
--
RewriteBase /
RewriteRule (.*\.php)?$ – [L,E=Cache-Control:max-age=120]
--
After applied , the website become ;

404 Not Found

The resource requested could not be found on this server!
Powered By LiteSpeed Web Server
LiteSpeed Technologies is not responsible for administration and contents of this web site!
Reply With Quote
  #12  
Old 12-28-2012, 06:37 PM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,389
Enable rewrite logging (add "RewriteLogLevel 9" in vhost of httpd.conf), restart lsws to make it effective. Then grep /usr/local/apache/logs/error_log with REWRITE to find out where that 404 comes from.
Reply With Quote
  #13  
Old 12-28-2012, 06:54 PM
LowKey LowKey is offline
Member
 
Join Date: Dec 2012
Posts: 16
Quote:
Originally Posted by webizen View Post
Enable rewrite logging (add "RewriteLogLevel 9" in vhost of httpd.conf), restart lsws to make it effective. Then grep /usr/local/apache/logs/error_log with REWRITE to find out where that 404 comes from.
I'm enable RewriteLogLevel 9 on httpd.conf and restarted lsws.

Just got this dumped. Nothing REWRITE error dumped on error_log
2012-12-28 21:52:28.078 [INFO] [103.22.201.25:14375-0#APVH_xxx.net] File not found [/home/xxx/public_html/404.shtml]
2012-12-28 21:52:28.113 [INFO] [103.22.201.127:36960-0#APVH_xxx.net] File not found [/home/xxx/public_html/...]

Not sure why this happen.
Reply With Quote
  #14  
Old 12-28-2012, 07:29 PM
LowKey LowKey is offline
Member
 
Join Date: Dec 2012
Posts: 16
Here some information

top - 22:26:05 up 12 days, 7:43, 4 users, load average: 1.12, 0.64, 0.81
Tasks: 283 total, 1 running, 282 sleeping, 0 stopped, 0 zombie
Cpu(s): 10.0%us, 2.1%sy, 0.0%ni, 87.7%id, 0.2%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 24605732k total, 19208184k used, 5397548k free, 975168k buffers
Swap: 12386288k total, 38064k used, 12348224k free, 15598724k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
9 root 20 0 0 0 0 S 26.9 0.0 1037:37 ksoftirqd/1
7083 nobody 20 0 201m 23m 15m S 26.9 0.1 0:10.52 lsphp5
26827 mysql 15 -5 6156m 554m 7240 S 25.9 2.3 4:59.91 mysqld
4 root 20 0 0 0 0 S 24.9 0.0 1443:18 ksoftirqd/0
7479 nobody 20 0 200m 19m 12m S 12.3 0.1 0:00.75 lsphp5
7460 nobody 20 0 198m 19m 14m S 11.6 0.1 0:02.35 lsphp5
25 root 20 0 0 0 0 S 6.0 0.0 270:04.10 ksoftirqd/5
7149 nobody 20 0 203m 24m 15m S 4.3 0.1 0:05.52 lsphp5
13 root 20 0 0 0 0 S 3.3 0.0 721:29.60 ksoftirqd/2
7458 nobody 20 0 198m 16m 11m S 2.7 0.1 0:00.86 lsphp5
17 root 20 0 0 0 0 S 1.7 0.0 882:15.09 ksoftirqd/3
21 root 20 0 0 0 0 S 1.0 0.0 393:56.21 ksoftirqd/4
6178 nobody 16 -4 110m 4932 2328 S 1.0 0.0 0:01.25 litespeed
7468 nobody 20 0 200m 19m 12m S 1.0 0.1 0:01.07 lsphp5
7477 nobody 20 0 202m 22m 13m S 0.7 0.1 0:00.44 lsphp5
29 root 20 0 0 0 0 S 0.3 0.0 950:26.22 ksoftirqd/6

1) sudo -u nobody cat /home/marsha/public_html/.htaccess [passed]
2) sudo -u marsha cat /home/marsha/public_html/.htaccess [passed]

both can sudo and show the content .htaccess

i also using tutorial http://www.bestdesigns.co.in/blog/cr...write-log-file

but still Rewrite error not show up.
Reply With Quote
  #15  
Old 12-29-2012, 01:55 AM
LowKey LowKey is offline
Member
 
Join Date: Dec 2012
Posts: 16
Hi,

After a few testing now, REWRITE error show up

Quote:
2012-12-29 04:49:08.271 [INFO] [103.22.201.131:32034-0#APVH_xxx.net] [REWRITE] strip base: '/' from URI: '/static/ajax.php'
2012-12-29 04:49:08.271 [INFO] [103.22.201.131:32034-0#APVH_xxx.net] [REWRITE] Rule: Match 'static/ajax.php' with pattern '(.*\.php)?$', result: 2
2012-12-29 04:49:08.271 [INFO] [103.22.201.131:32034-0#APVH_xxx.net] [REWRITE] apply cache-control: 'max-age=120'.
2012-12-29 04:49:08.271 [INFO] [103.22.201.131:32034-0#APVH_xxx.net] [REWRITE] Source URI: 'static/ajax.php' => Result URI: '..#'
2012-12-29 04:49:08.271 [INFO] [103.22.201.131:32034-0#APVH_xx.net] [REWRITE] Last Rule, stop!
2012-12-29 04:49:08.271 [INFO] [103.22.201.131:32034-0#APVH_xxx.net] [REWRITE] prepend rewrite base: '/', final URI: '/..#'
2012-12-29 04:49:08.271 [INFO] [103.22.201.131:32034-0#APVH_xxx.net] File not found [/home/marsha/public_html/...]
2012-12-29 04:49:08.271 [INFO] [103.22.201.131:32034-0#APVH_xxx.net] File not found [/home/marsha/public_html/404.shtml]
2012-12-29 04:49:08.281 [INFO] [103.22.201.125:21705-0#APVH_xxx.net] [REWRITE] strip base: '/' from URI: '/static/ajax.php'
2012-12-29 04:49:08.281 [INFO] [103.22.201.125:21705-0#APVH_xxx.net] [REWRITE] Rule: Match 'static/ajax.php' with pattern '(.*\.php)?$', result: 2
2012-12-29 04:49:08.281 [INFO] [103.22.201.125:21705-0#APVH_xxx.net] [REWRITE] apply cache-control: 'max-age=120'.
2012-12-29 04:49:08.281 [INFO] [103.22.201.125:21705-0#APVH_xxx.net] [REWRITE] Source URI: 'static/ajax.php' => Result URI: '..#'
2012-12-29 04:49:08.281 [INFO] [103.22.201.125:21705-0#APVH_xxx.net] [REWRITE] Last Rule, stop!
2012-12-29 04:49:08.281 [INFO] [103.22.201.125:21705-0#APVH_xxx.net] [REWRITE] prepend rewrite base: '/', final URI: '/..#'
2012-12-29 04:49:08.281 [INFO] [103.22.201.125:21705-0#APVH_xxx.net] File not found [/home/marsha/public_html/...]
2012-12-29 04:49:08.281 [INFO] [103.22.201.125:21705-0#APVH_xxx.net] File not found [/home/marsha/public_html/404.shtml]
2012-12-29 04:49:08.289 [INFO] [103.22.201.131:60088-4#APVH_xxx.net] [REWRITE] strip base: '/' from URI: '/static/ajax.php'
2012-12-29 04:49:08.289 [INFO] [103.22.201.131:60088-4#APVH_xxx.net] [REWRITE] Rule: Match 'static/ajax.php' with pattern '(.*\.php)?$', result: 2
2012-12-29 04:49:08.289 [INFO] [103.22.201.131:60088-4#APVH_xxx.net] [REWRITE] apply cache-control: 'max-age=120'.
.htaccess setting
Quote:
######################################
## [PHPFOX_HEADER]
##
## @copyright [PHPFOX_COPYRIGHT]
## @author Raymond Benc
## @package PhpFox
## @version $Id: htaccess.txt 4580 2012-07-31 15:19:24Z Raymond_Benc $
######################################

# Options -Indexes
# Header unset Pragma
# FileETag None
# Header unset ETag

# URL Rewrite
<IfModule mod_rewrite.c>
RewriteEngine On

#
# Full path to your site
#
RewriteBase /
RewriteRule (.*\.php)?$ – [L,E=Cache-Control:max-age=120]
# Rename Photo Names
# RewriteRule ^file/pic/photo/([0-9]+)/([0-9]+)/([A-Za-z0-9]{32}+)\-(.*?)_([0-9]*?)\.(.*)$ file/pic/photo/$1/$2/$3_$5.$6
# RewriteRule ^file/pic/photo/([0-9]+)/([0-9]+)/([A-Za-z0-9]{32}+)\-(.*?)\.(.*)$ file/pic/photo/$1/$2/$3.$5

#
# Rules
#
RewriteCond &#37;{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php?do=/$1

# Image Access Protection
# RewriteRule ^file/pic/photo/(.*)\.(.*)$ static/image.php?file=$1&ext=$2
</IfModule>
Please check

Thanks
Reply With Quote
  #16  
Old 12-31-2012, 10:10 AM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,389
Your rewrite rule is wrong.

Change below

Quote:
RewriteRule (.*\.php)?$ – [L,E=Cache-Control:max-age=120]
To

Quote:
RewriteRule (.*\.php)?$ – [E=Cache-Control:max-age=120]
Reply With Quote
  #17  
Old 12-31-2012, 08:46 PM
LowKey LowKey is offline
Member
 
Join Date: Dec 2012
Posts: 16
Hi,

After change to the correct .htaccess rules as you mention

My website become unresponsive

Quote:
2012-12-31 23:41:18.008 [INFO] [HTAccess] Configuration file [/home/marsha/public_html/.htaccess] changed.
2012-12-31 23:41:18.008 [INFO] [HTAccess] Updating configuration from [/home/marsha/public_html/.htaccess]
2012-12-31 23:41:18.009 [INFO] [103.22.201.131:37478-0#APVH_xxx.net] connection to [/tmp/lshttpd/lsphp5.sock.171] on request #0, confirmed, 0, associated process: 1
8714, running: 1, error: Resource temporarily unavailable!
2012-12-31 23:41:18.016 [INFO] [103.22.201.131:37478-0#APVH_xxx.net] connection to [/tmp/lshttpd/lsphp5.sock.171] on request #0, confirmed, 0, associated process: 1
8714, running: 1, error: Resource temporarily unavailable!
2012-12-31 23:41:18.033 [INFO] [103.22.201.131:37478-0#APVH_xxx.net] connection to [/tmp/lshttpd/lsphp5.sock.171] on request #0, confirmed, 0, associated process: 1
8714, running: 1, error: Resource temporarily unavailable!
2012-12-31 23:41:18.047 [INFO] [103.22.201.131:37478-0#APVH_xxx.net] connection to [/tmp/lshttpd/lsphp5.sock.171] on request #0, confirmed, 0, associated process: 1
8714, running: 1, error: Resource temporarily unavailable!

and the Load average slightly become high load average.

Here my cahce policy on the server

Quote:
Enable Cache Yes
Cache Expire Time (seconds) 300
Cache Request with Query String No
Cache Request with Cookie No
Cache Response with Cookie No
Ignore Request Cache-Control No
Ignore Response Cache-Control No
Enable Private Cache Yes
Private Cache Expire Time (seconds) 120
Is that correct ?

Please let me know


Thanks.
Reply With Quote
  #18  
Old 01-01-2013, 10:59 AM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,389
Quote:
Originally Posted by LowKey View Post
...

2012-12-31 23:41:18.009 [INFO] [103.22.201.131:37478-0#APVH_xxx.net] connection to [/tmp/lshttpd/lsphp5.sock.171] on request #0, confirmed, 0, associated process: 1
8714, running: 1, error: Resource temporarily unavailable!
2012-12-31 23:41:18.016 [INFO] [103.22.201.131:37478-0#APVH_xxx.net] connection to [/tmp/lshttpd/lsphp5.sock.171] on request #0, confirmed, 0, associated process: 1
8714, running: 1, error: Resource temporarily unavailable!

...
Your PHP engine is not responding. This has nothing to do with LS Caching. Did you build matching PHP? Also check stderr.log for any indication.

Regarding your cache policy, you should set Enable Cache to No in order to use rewrite rule for caching.
Reply With Quote
  #19  
Old 01-03-2013, 09:00 AM
LowKey LowKey is offline
Member
 
Join Date: Dec 2012
Posts: 16
Quote:
Originally Posted by webizen View Post
Your PHP engine is not responding. This has nothing to do with LS Caching. Did you build matching PHP? Also check stderr.log for any indication.

Regarding your cache policy, you should set Enable Cache to No in order to use rewrite rule for caching.
Yes, I'm build matching PHP.

Still same issue after Enable Cache set to No
Quote:
2013-01-04 00:54:29.664 [STDERR] 7941: packetLen < 0
2013-01-04 00:54:30.525 [STDERR] 8585: packetLen < 0
2013-01-04 00:54:32.613 [STDERR] 8323: packetLen < 0
2013-01-04 00:54:34.401 [STDERR] 7896: packetLen < 0
2013-01-04 00:54:34.401 [STDERR] 8457: packetLen < 0
2013-01-04 00:54:35.584 [INFO] [49.124.58.46:54289-0#APVH_xxx.net] connection to [/tmp/lshttpd/lsphp5.sock] on request #3, confirmed, 0, associated process: 7253, running: 1, error: Broken pipe!
2013-01-04 00:54:35.590 [INFO] [108.162.222.250:19746-0#APVH_xxx.net] connection to [/tmp/lshttpd/lsphp5.sock] on request #4, confirmed, 0, associated process: 7253, running: 1, error: Broken pipe!
2013-01-04 00:54:37.286 [STDERR] 8587: packetLen < 0
2013-01-04 00:54:38.329 [STDERR] 7999: packetLen < 0
2013-01-04 00:54:38.757 [INFO] [175.143.153.228:53473-0#APVH_xxx.net] connection to [/tmp/lshttpd/lsphp5.sock] on request #0, confirmed, 0, associated process: 7253, running: 1, error: Resource temporarily unavailable!
2013-01-04 00:54:38.757 [INFO] [175.143.153.228:53473-0#APVH_xxx.net] connection to [/tmp/lshttpd/lsphp5.sock] on request #0, confirmed, 0, associated process: 7253, running: 1, error: Resource temporarily unavailable!
2013-01-04 00:54:38.757 [INFO] [175.143.153.228:53473-0#APVH_xxx.net] connection to [/tmp/lshttpd/lsphp5.sock] on request #0, confirmed, 0, associated process: 7253, running: 1, error: Resource temporarily unavailable!
2013-01-04 00:54:38.758 [INFO] [175.143.153.228:53473-0#APVH_xxx.net] connection to [/tmp/lshttpd/lsphp5.s
Quote:
RewriteBase /
RewriteRule (.*\.php)?$ – [E=Cache-Control:max-age=120]

Still same issue happen, There is any other idea?

Thanks
Reply With Quote
  #20  
Old 01-04-2013, 08:43 PM
LowKey LowKey is offline
Member
 
Join Date: Dec 2012
Posts: 16
Good News,

Today, i'm got my LS Cache working. Yes, but it's just help a little, maybe need to working more on this. At least this the page load seems fastest than before.

This is my cache rules on .htaccess
Quote:
<IfModule mod_rewrite.c>
RewriteEngine On

RewriteBase /

RewriteRule /static/ajax.php - [L,E=Cache-Control:max-age=30]
RewriteRule ajax.php - [L,E=Cache-Control:max-age=30]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php?do=/$1

</IfModule>
This rules was working to cache PHPFox, at "Home" page , make the "Home" page load faster.

Here some screenshot :

http://cl.ly/image/1i1e1a3n1Z3S
http://cl.ly/image/0m0d0q2f1U2h
http://cl.ly/image/3g2B1j3W011G

I got Cache Hits/Sec : 1.0
Total Cache Hits : 6,545
Total Request : 1,904,511

Seem not fully cached yet on the whole website, but i'm need some help about understanding the rules.

I need help for cache this url
http://www.xxx.net/user/login
Path : /home/xxx/www/module/user

How to exclude this url from LS Cache ?
Quote:
To opt out your AdminCP
/home/your_username/public_html/your_admincp/
working url : http://www.xxx.com/admincp

To opt out User profiles (pics, cover photos)
/home/your_username/public_html/user/profile/
working url : http://www.xxx.com/user/profile

To opt out Designer
/home/your_username/public_html/core/index-member/customize/
working url : http://www.xxx.com/core/index-member/customize
If, my current is wrong, please let me know. so we can simply it.

Glad to hear from you

Thanks.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 02:10 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.