Install squid proxy on ubuntu 10.4 with cache directory on Different mounted drive

For dual OS on their PC, usually we have 2 or more partition drive.
Now i want to write how to install squid proxy on ubuntu with cache directory on different drive of your hard drive.
1st we must download and install the squid, open the terminal then type:

$ sudo apt-get install squid

wait until the installation complete,
after installation complete type this command on the terminal

$ sudo gedit /etc/fstab

then find where your drive are mounted
on mine just like this:

# /media/Data was on /dev/sda5 during installation
......../media/DATA     ntfs    defaults,nls=utf8,umask= .......

then change from umask with the line

umask=077,uid=1000,gid=1000

by default the umask and uid was set for anyone who use your PC, by change the umask with that line above is to change the permission of your mounted drive to become as your user permission and your user group.
why i change the umask and uid, because when i install squid on my PC i found some error while creating the cache directory, thats why i change the permission of the mounted drive.
after change umask, uid, and gid we must restart our PC 1st.
After restart the PC open the terminal againt and tipe:

$ sudo gedit /etc/squid/squid.conf

on ubuntu 10.4 by tiping those command automatically creating the file on the folder if the folder exist.
so for the more easily way we do not need to use the touch command to creating file.
then copy this on the squid.conf

http_port 3128
cache_mgr Your_Squid_mgr
forwarded_for off
visible_hostname Your_Host_name
cache_effective_user Your_user
cache_effective_group Your_user
 
cache_mem 16 MB
#/media/Data/ is my mounted drive name, change it with yours mounted drive name.
cache_dir ufs /media/DATA/squid2/cache0 7500 16 256 
cache_dir ufs /media/DATA/squid2/cache1 7500 16 256
cache_dir ufs /media/DATA/squid2/cache2 7500 16 256
cache_dir ufs /media/DATA/squid2/cache3 7500 16 256
coredump_dir /media/DATA/squid2/
 
logformat combined %>a %ui %un [%tl] "%rm %ru HTTP/%rv" %Hs %<st "%{Referer}>h" "%{User-Agent}>h" %Ss:%Sh
access_log /media/DATA/access.log squid
cache_store_log none
cache_log /media/DATA/cache.log
 
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
maximum_object_size 1024 KB
maximum_object_size_in_memory 128 KB
 
negative_ttl 2 minutes
half_closed_clients off
cache_swap_high 99%
cache_swap_low 95%
 
ipcache_size 4096
ipcache_low 95
ipcache_high 100
 
memory_pools off
reload_into_ims ON
pipeline_prefetch ON
 
acl ALL src 0.0.0.0/0.0.0.0
#this is for your local network(LAN)
acl localNet src 192.168.0.0/24
acl localNet src 192.168.1.0/24
acl localNet src 192.168.10.0/24
acl localNet src 192.168.100.0/24
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443
acl Safe_ports port 80
acl Safe_ports port 21
acl Safe_ports port 443
acl Safe_ports port 70
acl Safe_ports port 210
acl Safe_ports port 1025-65535
acl Safe_ports port 280
acl Safe_ports port 488
acl Safe_ports port 591
acl Safe_ports port 777
acl CONNECT method CONNECT
 
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
 
refresh_pattern cgi-bin	0	0%	0
refresh_pattern \?	0	20%	4320
refresh_pattern .	0	20%	4320
 
storeurl_access deny ALL
 
http_access allow manager localhost
http_access allow localhost
http_access allow localNet
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny ALL
http_reply_access allow ALL
icp_access allow ALL
 
header_access Proxy-Connection deny ALL
header_access Cache-Control deny ALL
header_access X-Cache deny ALL
header_access X-Cache-Lookup deny ALL
header_access X-Powered-BY deny ALL
header_access Via deny ALL
header_access Forwarded-FOR deny ALL
header_access X-Forwarder-FOR deny ALL

after that save the config and type:

$ sudo squid -z

if no error then type:

$ sudo squid -d 1 D

if no error then type:

$ sudo squid sYD

Finish, and Enjoy Browsing With Squid Proxy On Ubuntu.