logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: caching - htcacheclean
Author
paul_in_oz



Joined: 13 Feb 2008
Posts: 3
Location: Melbourne

PostPosted: Wed 13 Feb '08 5:07    Post subject: caching - htcacheclean Reply with quote

Greetings,

I have just started using Apache 2.2.6 at our organisation as a proxy server. Running on windows server 2003 R2. I have enabled caching using mod_cache / mod_disk_cache which is working well, however the cache has blown out to 20 GB.

I have tried to use htcacheclean, however I can not get the server to restart afterwards. A sample of my httpd.conf is below:-

_______________________________________________________________

LoadModule cache_module modules/mod_cache.so

<IfModule mod_cache.c>

LoadModule disk_cache_module modules/mod_disk_cache.so
# If you want to use mod_disk_cache instead of mod_mem_cache,
# uncomment the line above and comment out the LoadModule line below.
<IfModule mod_disk_cache.c>

CacheRoot I:/Proxy/ApacheCache
CacheEnable disk /
CacheDirLevels 5
CacheDirLength 3
CacheMaxFileSize 128000
CacheMinFileSize 64
CacheDisable http://au1.aconex.com

htcacheclean -n -t -p I:/Proxy/ApacheCache -l 10000M

# switches
# -n Be nice. This causes slower processing in favour of other processes. #htcacheclean will sleep from time to time so that (a) the disk IO will be #delayed and (b) the kernel can schedule other processes in the meantime.
# -t Delete all empty directories.
# -p Path of the root of the cache
# -l Limit size of cache add B for Bytes, K for Kilobytes and M for Megabytes

</IfModule>

_______________________________________________________________

I am sure I am missing something. Like a LoadModule or a way to call the htcacheclean, but im not sure what. I have done a fairly extensive search and come up with nothing.

Can anyone set me on the right track on how to sort this out please?

Regards,

Paul.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Fri 29 Feb '08 15:37    Post subject: Reply with quote

First thing you can try is removing the Ifmodule blocks.
Second thing: start apache in debug mode (httpd -e debug) or enable server-info page to see which modules are loaded.
Anything about that in the error log or windows event log?
Back to top
paul_in_oz



Joined: 13 Feb 2008
Posts: 3
Location: Melbourne

PostPosted: Mon 03 Mar '08 2:05    Post subject: Reply with quote

Hi James,

I #ed out the ifmodule and /ifmodule blocks as suggested. It didn't seem to do anything - neither bad nor good. The server still worked fine.

I ran a debug and got this error at the end:-

(OS 10048)Only one usage of each socket address (protocol/network address/port)
is normally permitted. : make_sock: could not bind to address 0.0.0.0:8080
no listening sockets available, shutting down
Unable to open logs.

I checked through the windows event viewer and found 2 types of errors relating to this issue:-

Event ID 3299
The Apache service named reported the following error:
>>> Invalid command 'htcacheclean', perhaps misspelled or defined by a module not included in the server configuration .

Event ID 3299
The Apache service named reported the following error:
>>> Syntax error on line 537 of C:/Apache2.2/conf/httpd.conf: .

I can also post the full debug comments if you would like to see them. I am not sure how to enable server-info.

Does the above info help at all?

Regards

Paul.
Back to top
tdonovan
Moderator


Joined: 17 Dec 2005
Posts: 611
Location: Milford, MA, USA

PostPosted: Mon 03 Mar '08 4:02    Post subject: Reply with quote

Maybe you misunderstood what htcacheclean is.

It is not an Apache directive that you put in your httpd.conf file - it is a separate stand-alone program that you run. The docs are here.

Also - there is no space between switches and values for htcacheclean.
For example, it should be: -pI:/Proxy/ApacheCache, not -p I:/Proxy/ApacheCache.

An example of starting up htcacheclean from the Windows command prompt is:
Code:
START /MIN "CacheClean" htcacheclean.exe -d5 -n -t -pI:/Proxy/ApacheCache -l10000M
This will cause the cache to be cleaned every 5 minutes.
You can stop the cache-cleaning process by closing the (minimized) CacheClean window.
Be careful not to get two or more instances of htcacheclean running at the same time.

If you don't want to use the -d switch to run htcacheclean continuously, check out the Windows SCHTASKS command to schedule it to run periodically.

-tom-
Back to top
paul_in_oz



Joined: 13 Feb 2008
Posts: 3
Location: Melbourne

PostPosted: Tue 04 Mar '08 0:49    Post subject: Reply with quote

Thanks tdonovan, (Tom)

I could get it running from the command prompt OK, and it worked. So as a work-around (or so I thought) I set it up as a scheduled task. Which works OK as well.

I was definitely under the impression that it ran from the httpd.conf file - thanks for straightening me out on that one!!

This is the first time I have ever used Apache - we had to build a new proxy server as we had our old proxy service outsourced through messagelabs and it was slow and laggy, and we didn't want to use ISA as the boss was not too enamored with it. - He has used it before, I haven't as I have never set up a proxy before.

The Apache - once I started to figure it out - was very easy to set up, just seemed to work Smile but the htcacheclean kinda had me stumped!!

Thanks to you and James for your help.....
Back to top


Reply to topic   Topic: caching - htcacheclean View previous topic :: View next topic
Post new topic   Forum Index -> Apache