DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • December 05, 2016, 10:39:55 AM
Home Forums News Links Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
IRC Channels
Search

Pages: [1]   Go Down
  Print  
Author Topic: Data Caching  (Read 4062 times)
0 Members and 1 Guest are viewing this topic.
Dhampir
Guest
« on: September 18, 2005, 10:41:06 AM »

I've went through the search, and I haven't found anything...so sorry if I missed it if this was posted before.

Data caching, what all do I need to do, to set it up?

I want to see what it can do for my server, but, I don't want to mess anything up without knowing what I'm doing.

Any push in the right direction would be helpful.

Thanks,

-Dhampir
Logged
Kendaer
Guest
« Reply #1 on: September 18, 2005, 01:26:38 PM »

basically what it does is save the results of common queries.  This means that things which don't change too often don't need to hit the sql server.  These cached results are stored as files on your disk in a format specified by PHP (ie, not human editable).

What you need to be able to do this is a space on your filesystem where you can store the files.  This space needs to be writeable by the user that the webserver process is running as.

At that point you can just enter the path into the field in the config and enable data caching and you should be good to go.  All of the core code is already set up to use caches for anything which is reasonable as soon as you turn on that switch and have the filesystem piece set up.  You should just get the benefits of using it.

However, we cannot help you set up permissions, or anything else, since those are all related to your machine and/or your hosting service and installation.

Hope this helps.
Logged
Dannic
Guest
« Reply #2 on: September 18, 2005, 01:37:46 PM »

in most cases you can set up the directory and change the permissions in your ftp client.

Create your new directory and chmod the directory to 755.  Then in your game settings put the path to the directory for your cache files in the appropriate place.

More than likely it will have to be the full path.

ie.

/home/yourhome/public_html/logd/somedirectory
Logged
Dhampir
Guest
« Reply #3 on: September 18, 2005, 02:56:10 PM »

Alright, I did the best as I could, and I got this error.

Warning: fopen(/public_html/lotgd/datacache/datacache_moduleprepare): failed to open stream: No such file or directory in /home/dkrealm/public_html/lotgd/lib/datacache.php on line 49


Does this mean that I have to put files for each of the errors I get, in the datacache file?

Or, am i totally off, and I should quit while I'm ahead? lol
Logged
Dannic
Guest
« Reply #4 on: September 18, 2005, 03:39:00 PM »

did you change the directory permissions to allow writing to it?  That is an important step.
Logged
Boofo
Member
Mod God
*****
Offline Offline

Posts: 774


View Profile
« Reply #5 on: September 19, 2005, 12:31:18 AM »

Alright, I did the best as I could, and I got this error.

Warning: fopen(/public_html/lotgd/datacache/datacache_moduleprepare): failed to open stream: No such file or directory in /home/dkrealm/public_html/lotgd/lib/datacache.php on line 49


Does this mean that I have to put files for each of the errors I get, in the datacache file?

Or, am i totally off, and I should quit while I'm ahead? lol

I just ran into this. Just chmod the  cache directory to 777 and it will fix the error. It doesn't like 755 for some reason on my server.
Logged

chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden
Kendaer
Guest
« Reply #6 on: September 19, 2005, 07:37:51 AM »

Right.. That's a sign that you don't have permissions to write to that directory Dhampir.

Boofo, that's because the apache server is usually running as 'nobody' or 'apache', not as your user, which is why you need to give 'others' write permission (the difference in 7 versus 5 as a permission setting in the last field)

Quick unix tutorial for those who care.

On unix, permissions are set up as a bitfield.

These are

Directory bit, read self, write self, execute self, read group, write group, execute group, read other, write other, execute other.

On files, execute means 'this file can be run as a command'.  On directories, it means 'the contents of this directory (ie, the directory listing) can be seen, even if the files themselves cannot.

so, when you chmod something 755, you are setting read+write+execute for yourself, read and execute for the group you are in and read and execute for anyone else on the system (ie, other).

Since Apache usually runs as a completely non-priveledged user (ie, not in any groups and not as you), then it falls under the 'other' category, and so you must have that last set of bits set correctly.

chmod 777 gives everyone full read/write access to the directory, and unfortunately that's what is necessary in this case.  You could actually get away with 776 which would let the files be read and written, but would prevent random people from doing an ls on the directory to see what the files were named (since the code knows the names of the files, it never needs to look them up Smiley)

There.. have probably too much information Smiley
Logged
Elessa
Faerie
Mod God
*****
Offline Offline

Posts: 3598


short, sweet and to the point


View Profile
« Reply #7 on: September 19, 2005, 10:16:55 AM »


There.. have probably too much information Smiley

* Elessa smiles as she marks the thread for reference for herself

nay, tis not too much information. tis good to read an explanation that is easy to comprehend.
Logged

Uuma ma ten rashwe, ta tuluva a lle

Play the latest beta version here on LoGD DragonPrime - Axebridge
Boofo
Member
Mod God
*****
Offline Offline

Posts: 774


View Profile
« Reply #8 on: September 19, 2005, 10:52:52 AM »

Thanks, Kendaer. I never fully understood the permissions thing. Great explanation. Wink
Logged

chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden
Dhampir
Guest
« Reply #9 on: September 24, 2005, 10:52:59 AM »

Thanks Kendaer...now I get it.

But the problem for me, was the directory I put it, I was changing my permissions in my FTP user, and then copy/pasting what the directory was there.

When I decided to check what it did in my cpanel, it showed me my correct directory, and when I put that in, it worked.

Again, thanks.
Logged
Nightborn
Guest
« Reply #10 on: September 27, 2005, 12:25:20 PM »

Smiley I recommend every server to use this feature.

I have it now on 2 lotgd 1.0.3 running on my webspace, and it accelerated the page gen to roughly 1/2 of my former gen.

however, I had to use the given phptmp directory... and subdirectory in my normal webspace is not working (somehow).
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Version 1.1.2 is the current supported version and is available for download.

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Who's Online
55 Guests, 0 Users
DragonPrime LoGD
Recent Topics
Home Forums News Links Downloads Login Register Advanced Search