Google+ Badge

Tuesday, March 15, 2016

SARG is a tool that analyses the proxy log files and creates beautiful reports out of it. It is handy to see how much bandwidth is used by individual machines on the network and one can check on which websites the network's users are surfing.

Server Descriptions :

     • Hostname   = proxy.reubro.com
     • Services      = DNS, Squid Proxy and SARG.
     • Eth0           = Connected to Internet  
     • Eth1           = Connected to LAN

Please remember without the Squid and DNS setup, no use of installing sarg on the system it will won’t work at all. Before installing Sarg we must configure DNS and Squid as Transparent Proxy. DNS for the name resolution in caching mode.


Step 1 - Installation of required packages for SARG.

Step 2 - Download SARG package, here I am go to my software folder.

Step 3 - Extract sarg package, using below command.

Step 4 -  Compile SARG package using below Commands.

Step 5 - Now, time to edit SARG main configuration file. It has lots of option to edit you should go through all of them before edit anything. However, we will editing only the ones that we need.

Step 6 - After that restart the service.

Step 7 - Configuring firewall, open port 80 for accessing web server.

      iptables –I INPUT –p tcp –dport 80 –j ACCEPT

Step 8 - Now finally you can generate SARG reports.

The above command will generate reports in mentioned directory "/var/www/html/access_reports" which can be accessed from the web browser using the address http://IP-Address/access_reports

Step 9 - SARG Main Page

Step 10 - To automate the process of generating sarg report in given span of time via cron jobs. For example, let’s assume you want to generate reports on hourly basis automatically, to do this, you need to configure a Cron job.

That's it...

How to mount AWS S3 bucket in linux EC2 instance using S3FS


If you have not created a S3 bucket kindly go through with EC2 documentation.The documentation is very clear and easy to understand .

S3FS is FUSE (File System in User Space) based solution to mount an Amazon S3 buckets. On s3fs mounted files systems we can simply use cp, mv and ls the basic Unix commands similar to run on locally attached disks. 

Step 1 - First, we want to update repository.

Step 2 - Before installing s3fs, we want to install dependencies.

Note : In this section may be we get dependency error like fuse-utils. In this case I have to go below example.

Step 3 - Download and Compile Latest Fuse package first using below command.
URL : wget http://downloads.sourceforge.net/project/fuse/fuse-2.X/2.9.3/fuse-2.9.3.tar.gz
    root@ip-172-31-24-7:~# ./configure
   root@ip-172-31-24-7:~# make
   root@ip-172-31-24-7:~# make install

Step 4 - Now we can install s3fs dependency packages on this server
apt-get install build-essential gcc libfuse-dev fuse-utils libcurl4-openssl-dev libxml2-dev mime-support build-essential libcurl4-openssl-dev

Step 5 - Download and Compile Latest S3FS using below example and extract.
URL : wget https://s3fs.googlecode.com/files/s3fs-1.61.tar.gz

Step 6 - Open /etc/fuse.conf file to make small change. Uncomment the line #user_allow_other.

Step 7 - Now getting the access key and secret key for adding /etc/passwd-s3fs file.

Click on AWS Menu => Your AWS Account Name => Security Credentials.
Here you can see access key and secret key (secret key is visible when you click on show tab). Copy these both keys separately and add on /etc/passwd-s3fs file.

Step 8 - Create a new file under the /etc/ with the name passwd-s3fs and Paste the access key and secret key in this manner => "accesskey:secretkey". And also change the permission.

Step 9 - Now create a directory to mount S3bucket in /mnt directory and mount S3 bucket using below example.
Note: you can get bucket name from S3 management console.

Step 10 -  To check mounted S3 bucket using below command.

Step 11 - We can create file and folder for testing purpose.

Step 12 - Go to AWS S3 bucket control Panel and check the file is there.

Step 13 - Unmount we created S3 bucket and check it.

Note : Here, we unmount the S3 Bucket from the EC2 server. But we can see the file in S3 control panel.

Step 14 - File uploading through AWS S3 bucket directly.

Step 15 - Again we can re-mount and check the files. here we can see we uploaded file.

Step 16 - Check the s3fs status using below commands.

That's it...

How to Install Admin Pack (RSAT) in Windows 7

Remote Server Administration Tools for Windows 7 with SP1 enables IT administrators to manage roles and features that are installed on computers that are running Windows Server 2008 R2, Windows Server 2008, or Windows Server 2003, from a remote computer that is running Windows 7.


Remote Desktop manager is one of the admin pack tool to manage multiple remote desktop connections in one screen and it allows saving user name password for each connection profile. So next time you do not need to type user name and password to connect specific computer or server. Install the Administration Tools pack on a computer that is running the Professional, Enterprise, or Ultimate editions of Windows 7.


Step 1 - Integrate Windows System in “mydomain.com”. Logon with administrator local account and go to network properties and check the network details and connectivity.

Step 2 - Download the installation package from below url and make sure to select the correct one for your system, 32-bit or 64-bit: 
http://www.microsoft.com/en-AU/download/details.aspx?id=7887
Step 3 - When you run the installation package, you will see this message, which explains that you are able to install an update – click on ‘Yes’. 

Step 4 - Then after reading and agreeing to the terms, click on ‘I Accept’.

Step 5 - The installation will take a few minutes, when complete click ‘Close’.

Step 6 - Go to Programs and features. Select Turn Windows features on or off then select Remote Server Administration Tools as shown below.

Depends on the requirement of network, you can select each option. As I mentioned earlier, you can manage Windows 2003,2008 and 2008 R2 Servers from Windows 7 client computer by this administration tools pack.  You must be in administrator group or administration tasks privilege should have been given to perform some of server tasks.

Step 7 - So newly added administrations pack tool feature can be found under Administrative Tools in Windows 7.
 
Even you can install Server Manager in Windows 7 and do the same all server tasks in Windows 2003, 2008 and 2008 R2 from Windows 7 client.

Note: May it will not work on normal user you must create a user or Domain administrative user under the Domain (Active directory). After that login in to that user. In that time it will work on properly.


Step 8 - Go to control panel and open the Administrative tool and first access DNS.

Step 9 - Now lets check the Active Directory Users and Computers.

That's it...