Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's
Author Message
XtraX
Hangin' Around



Joined: Nov 03, 2004
Posts: 43

PostPosted: Wed Nov 03, 2004 2:52 pm Reply with quote

Hello Raven great site by the way..

I'm looking for information on cache lite and just how do l install it and where can l get it,

We have Nuke 7.2 installed and are looking to increase its speed and load times.

So any other tips to speed up the site would also be appreciated as well.

Our site has a total of 50 to 90 members online at all times and 150 visitors and we have noticed a drastic slow down on page loading sence the amoutn of traffic has encreased.


Any help you could provide would be highley appreciated.

Thanks XtraX Smile
 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Wed Nov 03, 2004 3:13 pm Reply with quote

Thanks.
[ Only registered users can see links on this board! Get registered or login! ] [ Only registered users can see links on this board! Get registered or login! ]
 
View user's profile Send private message
XtraX







PostPosted: Wed Nov 03, 2004 5:37 pm Reply with quote

Thanks Raven for your help and the link to how l will start this now any pointers you may have before l get started besides backing up lol..

XtraX
 
XtraX







PostPosted: Wed Nov 03, 2004 5:46 pm Reply with quote

Quick question it says to extract it into the includes folder ? do l leave Cache Lite in the folder it created when extracting it and upload it that way into the includes folder or do l upload the contents of Cache_lite into includes so just the files them selves
 
XtraX







PostPosted: Wed Nov 03, 2004 5:48 pm Reply with quote

Never mind duuhh thats why they use the include line sorry for them dum question
 
XtraX







PostPosted: Wed Nov 03, 2004 9:24 pm Reply with quote

Ok l need a little help l e-mailed chatserv as well, Its been awhile sence l did any udates to my heavily modified Nuke 7.2 and l was wondering where l can get the list of files and updates to make to my nuke 7.2 ..?

So l can secure it from SQL injections as l will have to manully update each file so l dont loose any changes made..

XtraX
 
Raven







PostPosted: Wed Nov 03, 2004 9:51 pm Reply with quote

All of Chat's updates are available on my front page.
 
XtraX







PostPosted: Wed Nov 03, 2004 10:13 pm Reply with quote

But all l need is the code to replace there the actual files and l cant over write them or l will loose my previouse work

Ps the Cache_Lite rocks my site is 7 times faster thanks for your help it was so easy to install

XtraX Very Happy
 
Raven







PostPosted: Thu Nov 04, 2004 12:31 am Reply with quote

Wait until I release the Cache Lite control panel I'm writing Smile
 
sharlein
Member Emeritus



Joined: Nov 19, 2002
Posts: 322
Location: On the Road

PostPosted: Thu Nov 04, 2004 12:13 pm Reply with quote

I think the directions are easy to follow. I tried to do 4 blocks and had zero successes. The last one (block survey) finally gave me something - an error code:
Code:
Fatal error: Call to undefined function: voteresults() in /home/xxxx/html/blocks/block-Survey.php on line 69

Any thoughts to put me back on track?

_________________
Give Me Ambiguity Or Give Me Something Else! 
View user's profile Send private message
XtraX







PostPosted: Thu Nov 04, 2004 12:58 pm Reply with quote

Post your code here and l will help you what code did you include in your blocks ?
and make sure to include the full path to the tmp file and make sure you created a Cache_Lite folder inside the tmp file and set permissions on it to 775 so it has read and write access..

XtraX
 
sharlein







PostPosted: Thu Nov 04, 2004 3:05 pm Reply with quote

Code:
<?php


if (eregi("block-ScrollingSentinel.php",$_SERVER['PHP_SELF'])) {
    Header("Location: ../index.php");
    die();
}
// include the Cache-Lite package
require_once("includes/Cache_Lite/Lite.php");
// set some variables
$options = array(
  "cacheDir" => "/tmp/Cache_Lite/",
  "lifeTime" => 900
);
// create a Cache_Lite object
$objCache = new Cache_Lite($options);
// test if there exists a valid cache,
// the ID will be the basename of the block
$fileid = basename($blockfile,".php");
if ($content = $objCache->get($fileid)) {
// add a message indicating this is cached output
  $content .= "\n[cached with ID=$fileid]";
}
else
{
// do the block's work here...

global $prefix, $db, $user, $admin, $ab_config;
$usemarquee = 1;
$scrolldirection = "Down";
$content = "";
$content .= "<table border=1><tr><td ALIGN=\"center\" VALIGN=\"top\"> This is the list of Sentinel banned IP addresses. </td></tr></table><hr>\n";
$content .= "<Marquee Behavior=\"Scroll\" Direction=\"$scrolldirection\" Height=\"150\" ScrollAmount=\"1\" ScrollDelay=\"75\" onMouseOver=\"this.stop()\" onMouseOut=\"this.start()\"><br>";
$result = $db->sql_query("SELECT ip_addr, reason FROM $prefix"._nsnst_blocked_ips." ORDER BY date DESC LIMIT 30");
while (list($ip_addr, $ip_reason) = $db->sql_fetchrow($result)) {
  if((is_admin($admin) AND $ab_config['display_link']==1) OR ((is_user($user) OR is_admin($admin)) AND $ab_config['display_link']==2) OR $ab_config['display_link']==3) {
    $lookupip = str_replace("*", "0", $ip_addr);
    $content .= "<b><big>&middot;</big></b>&nbsp;<a href=\"".$ab_config['lookup_link']."$lookupip\" target=\"_blank\">$ip_addr</a>\n";
  } else {
    $content .= "<b><big>&middot;</big></b>&nbsp;$ip_addr\n";
  }
  if((is_admin($admin) AND $ab_config['display_reason']==1) OR ((is_user($user) OR is_admin($admin)) AND $ab_config['display_reason']==2) OR $ab_config['display_reason']==3) {
    $result2 = $db->sql_query("SELECT reason FROM $prefix"._nsnst_blockers." WHERE blocker='$ip_reason'");
    list($reason) = $db->sql_fetchrow($result2);
    $reason = str_replace("Abuse-","",$reason);
    $content .= "&nbsp;-&nbsp;$reason\n";
  }
  $content .= "<br />\n";
}
$content .= "</Marquee><br>";
$content .= "<hr><center><a href=\"http://www.nukescripts.net\" target=\"_blank\">"._AB_NUKESENTINEL." ".$ab_config['version_number']."</a></center>\n";
// ...and save it in the cache for future use
$objCache->save($content, $fileid);
}

?>


permissions=766
 
XtraX







PostPosted: Thu Nov 04, 2004 6:02 pm Reply with quote

First you need to set the full path to your tmp/Cache_Lite file

Example: Mine is this!
Quote:
/home/virtual/site13/fst/var/tmp/Cache_Lite/


Mine is not located in the root folder for better security and this has to be done on every block second thing

Make sure the file is actually located in the path you specified

/tmp/Cache_Lite/

If your not sure what the direct path to the file is located on your server create a php file call it whatever you want example

123.php as you dont want others seeing this information and put this tag inside it

Code:
<?php phpinfo(); ?>


Then use your browser to directly go to the file
[ Only registered users can see links on this board! Get registered or login! ] site.com/123.php

that will give you the full path ..

Once you do get cache lite working it will also put an input line on the block itself viewable to you or anyone else letting you know it was cached ..

to remove this from the block comment out this line in the block file

// $content .= "\n[cached with ID=$fileid]";

Hope this helps

XtraX Smile
 
Raven







PostPosted: Thu Nov 04, 2004 6:26 pm Reply with quote

Steve,

If you don't already have a tmp folder in your root nuke folder, create one. Then in the tmp folder create a folder called Cache_Lite. Now, when you specify
"cacheDir" => "tmp/Cache_Lite/" do NOT use a preceeding /. So, your top code in your block should look like this
Code:
require_once("includes/Cache_Lite/Lite.php");

// set some variables
$options = array(
  "cacheDir" => "tmp/Cache_Lite/",
  "lifeTime" => 3600
);
Note that I have moved my Lite.php file, but you should get the idea.
 
Nukeum66
Life Cycles Becoming CPU Cycles



Joined: Jul 30, 2003
Posts: 551
Location: Neurotic, State, USA

PostPosted: Thu Nov 04, 2004 10:04 pm Reply with quote

Hey Raven, I been using Cache Lite for a few weeks now. Caching blocks works great. My question is how would I use Cache Lite to cache whole pages? Would this be done in the same manner as a block?

_________________
Scott Johnson MIS Ubuntu/Linux 11.10 
View user's profile Send private message Visit poster's website
sharlein







PostPosted: Fri Nov 05, 2004 2:28 pm Reply with quote

Here is the block code I am using:
Code:
<?php


/********************************************************/
/* Hacker Beware center block        (SQL Programing)   */
/* By: Stephen2417 (Orignal Code) &    xfsunolesphp     */
/* http://stephen2417.com          http://xfsunoles.com */
/* Copyright © 2004 by Stephen2417 & xfsunolesphp       */
/********************************************************/

if (eregi("block-Hacker_Beware2.php",$_SERVER['PHP_SELF'])) {
    Header("Location: ../index.php");
    die();
}
// include the Cache-Lite package
require_once("includes/Cache_Lite/Lite.php");
// set some variables
$options = array(
  "cacheDir" => "tmp/Cache_Lite/",
  "lifeTime" => 900
);
// create a Cache_Lite object
$objCache = new Cache_Lite($options);
// test if there exists a valid cache,
// the ID will be the basename of the block
$fileid = basename($blockfile,".php");
if ($content = $objCache->get($fileid)) {
// add a message indicating this is cached output
  $content .= "\n[cached with ID=$fileid]";
}
else
{
// do the block's work here...


global $db, $prefix, $ab_config;
$total_ips = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_nsnst_blocked_ips" ));
if(!$total_ips) { $total_ips = 0; }
$content  = "<center><img src=\"images/sentinel/Sentinel_Medium.png\" alt=\"You have been warned!\" title=\"You have been warned!\"><br />We have caught $total_ips shameful hackers.</center>";
$content .= "<hr><center><a href=\"http://www.nukescripts.net\">"._AB_NUKESENTINEL." ".$ab_config['version_number']."</a></center>\n";

// ...and save it in the cache for future use
  $objCache->save($content, $fileid);
}

?>

and here is the error I get:
Code:
Warning: main(includes/Cache_Lite/Lite.php): failed to open stream: No such file or directory in /home/xx/public_html/blocks/block-Hacker_Beware2.php on line 15


Fatal error: main(): Failed opening required 'includes/Cache_Lite/Lite.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/xx/public_html/blocks/block-Hacker_Beware2.php on line 15

Quote:
Line 15 = require_once("includes/Cache_Lite/Lite.php");
 
Raven







PostPosted: Fri Nov 05, 2004 4:10 pm Reply with quote

Steve,

Make sure that you have copied Lite.php from the Lite folder into the Cache_Lite folder.
 
Nukeum66







PostPosted: Fri Nov 05, 2004 8:39 pm Reply with quote

Just for kicks try placing a copy of PEAR.php in your root directory.
[ Only registered users can see links on this board! Get registered or login! ]
 
sharlein







PostPosted: Sat Nov 06, 2004 9:06 am Reply with quote

Sorry it took me so long to get back to you. I had PEAR.php in the root folder since I started. I even replaced it once to make sure it was corrupted. I think the problem lies in another direction entirely. Thanks, Steve
 
Nukeum66







PostPosted: Sat Nov 06, 2004 11:04 am Reply with quote

Have you tried playing with the permissions on that directory?
 
Raven







PostPosted: Sat Nov 06, 2004 11:08 am Reply with quote

Raven wrote:
Steve,

Make sure that you have copied Lite.php from the Lite folder into the Cache_Lite folder.
Have you done this?
 
Rage
Insane



Joined: Jul 30, 2004
Posts: 85

PostPosted: Sat Nov 06, 2004 11:51 am Reply with quote

Will there be any possibility of making this control panel work with CPG-Nuke Raven?

_________________
It's not that I'm afraid of dying, it's just that I don't want to be there when it happens. - Woody Allen 
View user's profile Send private message
Raven







PostPosted: Sat Nov 06, 2004 11:54 am Reply with quote

I know nothing of the internals of CGPNuke. I'm sure it is possible but I will have to look into it.
 
sharlein







PostPosted: Sat Nov 06, 2004 12:06 pm Reply with quote

Yes, Raven, I copied the Lite.php to the cache_lite folder and then placed it into includes.
 
dean
Worker
Worker



Joined: Apr 14, 2004
Posts: 193

PostPosted: Wed Jul 20, 2005 9:20 pm Reply with quote

So after all this, besides a speed difference is there a way I can tell its working? I dont see anything in the tmp directory except for the Cache_Lite directory and nothing is contained in it.
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©