Pages

Aug 24, 2008

How to Install Squid Proxy Server




How to Install Squid Proxy Server


Certainly Squid server is a favourite open source GPLd proxy and web cache. It’s a variety of functions, from accelerating a web server by caching repeated requests, to caching web, name server query , and other network lookups for a group of people sharing network resources. It is mainly designed to run on Linux / Unix-like systems. Squid is a high-performance proxy caching server for Web clients, supporting FTP, gopher, and HTTP data objects. Unlike traditional caching software, Squid handles all requests in a single, non-blocking, I/O-driven technique. Squid maintains meta data and specially hot objects cached in RAM, caches DNS lookups, supports non-blocking DNS lookups, and implements negative caching of failed requests. Squid comprises of a main server program squid, a Domain Name System lookup program (dnsserver), a program for retrieving FTP data (ftpget), and a lot of management and client tools.

Here is the instruction on how to install Squid proxy server:

1. Download Squid Cache

You can download Squid at http://www.squid-cache.org/Versions/ . There, you can see a lot of version of Squid. I prefer you to download the latest version. Here is the link for the latest version:

http://www.squid-cache.org/Versions/v3/3.0/squid-3.0.STABLE8.tar.gz

Note: If you want to download it directly from your server. Please use the following command:

wget http://www.squid-cache.org/Versions/v3/3.0/squid-3.0.STABLE8.tar.gz

2. Squid Cache Installation

To extract the downloaded compressed file, please use the following command:

tar -zxvf squid-3.0.STABLE8.tar.gz

this will create a directory named squid-3.0.STABLE8 at the current directory. Next, go into the directory:

cd squid-3.0.STABLE8

To build and install the Squid Cache, type:

./configure --prefix=/usr/local/squid
make all
make install

The command above will install squid in directory /usr/local/squid

3. Customize and Run Squid Cache

1. customize the squid.conf configuration file:
vi /usr/local/squid/etc/squid.conf

2. Initalise the cache:
/usr/local/squid/sbin/squid -z

3. start the cache:
/usr/local/squid/sbin/squid

Note: If you have problem to initialize the cache, please give the write permission (preferably chmod 777) for the specified directory.

Verify Squid Cache Installation

netstat -tulpn | grep 3128

Output:

tcp 0 0 0.0.0.0:3128 0.0.0.0:*

If you get the output above, you have successfully install Squid proxy server. :)

4. Client Configuration

Open a web browser > Tools > Internet option > Network settings > and setup Squid server IP address and port # 3128.

Good Luck!


Jul 15, 2008

Using TAR with Bunzip2 files

Bunzipping and then unTARring in two steps is not convenient.

It is not necessary to use Bunzip2 and then TAR to unzip a file in two separate steps.

Tar will do the job on its own if the -j switch is used, thus:

tar xjvf linux-source.tar.bz2

By the same token, you may use the -z switch with a gzipped file, e.g.

tar zxvf linux-source.tar.gz

Enjoy!

Jul 9, 2008

All in one driver solution with DriverMax




Need to reinstall Windows but you misplaced your driver disks? Not sure you have everything you need? DriverMax has you covered. Backing up and reinstalling your drivers couldn't be easier.

After installing DriverMax, go into Driver Operations and click on Export drivers. A list of all your installed drivers will be displayed and you can pick and choose which ones to export, or simply export the whole lot in one go. Once you've reinstalled Windows, go back into Driver Operations, click on Import drivers, and point to the folder containing your saved drivers. The import can take a while, but in comparison to manually installing each driver individually, this is a walk in the park.

DriverMax is also useful even if you don't need to perform a complete reinstall - you can use the program just to make sure that your drivers are up to date or export a list of your installed drivers as an html or text file.

DriverMax is compatible with Windows 2003, XP and Vista and you have to supply your email address in order to receive a registration code.

Tags: drivers, export, import, installing, vista, xp

* Read
* Permalink
* Email this
* Share
* Comments [3]

Jun 25, 2008

How to Configure Samba on RedHat Linux

What's Samba?

Samba allows linux computers to share files and printers across a network connection. By using its SMB protocol, your linux box can appear in Windows Network Neighborhood or My Network Places just like any other windows machine. You can share files this way, as well as printers. By using samba on my home network, for example, my Windows machines have access to a printer directly hooked up to my Linux box, and my Linux box has access to a printer directly hooked up to one of my Windows machines. In addition, everyone can access everyone else's shared files. You can see how samba can be very useful if you have a network of both Windows as well as Linux machines.

Samba configurations are slightly different depending on the distribution you're using. Therefore, this tutorial explains how it's done on a RedHat Linux machine, as this is my distro of choice, and the only one I've ever installed samba on. The following method has been used by me on RedHat 7.2, 7.3, and 8.

Installing Samba

The first step to configuring samba is, obviously, to make sure that it's installed. In most cases, this will already be the case. It is often a good idea to install the samba daemon package with the RedHat installation.

You can test to see if samba is installed by typing rpm -q samba in a terminal. This performs a query on the samba package. If installed, it will indicate the version. If not, it will indicate "package not installed".

If samba is not currently installed, there are a multitude of places to get it. The RPM package is available on the RedHat CDs, on the RedHat network, or straight from www.samba.org or one of the samba mirror sites. In addition, you might wish to find it at www.rpmfind.net, a nice resource for RPM packages.

Once you have the samba RPM package downloaded somewhere on your harddrive, it's time to install it. Browse to where the file is located and perform one of the following two operations:

if samba is not currently installed,
rpm -i samba.rpm
(replace samba.rpm with the full version name of the file)

if you wish to upgrade your samba version,
rpm -U samba.rpm

Now that samba is installed, we can work on configuring this program.

smb.conf file

All of samba is configured in one single file, the smb.conf file. This file, located at /etc/samba/smb.conf, allows you to specify which resources on the linux machine you wish to share and who they can be accessed by.

A fresh installation of samba will include a sample smb.conf file. This file is completely commented, pointing out all of your available options, and how you can change them. However, samba is an extremely powerful tool, and most casual users have no need for 3/4 of the contents of this sample file. Therefore, I'm providing my own smb.conf file below. If you wish to just share a few folders across a small home LAN, you might be better off basing your own smb.conf file off of mine, as opposed to the long-winded sample file.

[global]
workgroup = PUTIEVILLE
server string = My Lil Linux Box
hosts allow = 192.168. 127.
log file = /var/log/samba/%m.log
security = user
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

[Downloads]
comment = Downloads
path = /home/windisk/Downloads
browseable = yes
writable = yes
public = yes
read only = no

[homes]
comment = My Home Directory
browseable = yes
writable = yes
public = yes
read only = no

[printers]
path = /var/spool/samba
public = yes
guest ok = yes
printable = yes
browseable = yes
writable = yes
read only = no


Samba Users

Since we're using user level security (the best option when connecting to a WinNT based machine, such as Windows 2000 or Windows XP), we need to set up samba users.

First, lets create the smbpasswd file that we defined in the smb.conf file. The best way to go about this is to create it based on your existing /etc/passwd file. In other words, samba users are created based on existing linux users:

cat /etc/passwd | mksmbpasswd.sh > /etc/samba/smbpasswd

Chmod 600 this file (/etc/samba/smbpasswd) so that only root has read and write permissions.

However, this file only copies over Linux users to samba users. It doesn't copy over their passwords, as well. Therefore, use the following command to set each samba user's password:

smbpasswd username

Obviously, replace username with each of your user's usernames. You will then be prompted to enter a password for this user account. I like to set my samba user's passwords the same as their linux user counterparts. However, this isn't necessary.

Samba Service

Now that everything has been configured, the final step is to start the samba service. Samba runs in the background as a linux daemon. Therefore, it can be controlled by typing:

service smb start
service smb stop
service smb restart

Note that once the computer is restarted or shutdown, the samba service won't start up again the next time. I use the GUI (xwindows) program serviceconf to set up all my services to execute automatically.

Connecting To A Samba Resource

Now that everything should be working, let's test it out. We use the samba client to connect to a samba resource. For testing purposes, we can connect to localhost.

smbclient //localhost/Downloads

You must specify the name of the computer as well as the resource you wish to connect to. In this case, I can connect to the Downloads resource because I specified this resource in my smb.conf file (note it points to /home/windisk/Downloads).

Since you are using the samba client while already logged in as a linux user, you will only be prompted for a password. The username will be assumed to be the samba counterpart of the linux username you're currently logged in as.

If you wish, you can go to a Windows machine such as Windows XP. If you open My Network Places, and browse to your workgroup, your linux machine should be listed. When trying to access it, you should be prompted with a username and password. This can be any of the samba users you previously created. Once logged in, you should see a listing of all available resources available.