Showing posts with label Ubuntu OS. Show all posts
Showing posts with label Ubuntu OS. Show all posts

Monday, 13 January 2014

How To Install Squid Proxy Server on CentOS / Redhat enterprise Linux 5


How do I install Squid Proxy server on CentOS 5 Liinux server?



Sure Squid server is a popular open source GPLd proxy and web cache. It has a variety of uses, from speeding up 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 primarily 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 process. Squid keeps meta data and especially hot objects cached in RAM, caches DNS lookups, supports non-blocking DNS lookups, and implements negative caching of failed requests. Squid consists of a main server program squid, a Domain Name System lookup program (dnsserver), a program for retrieving FTP data (ftpget), and some management and client tools.



Install Squid on CentOS / RHEL 5


Use yum command as follows:
# yum install squid
Output:



Loading "installonlyn" plugin
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Package squid.i386 7:2.6.STABLE6-4.el5 set to be updated
--> Running transaction check
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
squid i386 7:2.6.STABLE6-4.el5 updates 1.2 M
Transaction Summary
=============================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 1.2 M
Is this ok [y/N]: y
Downloading Packages:
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: squid ######################### [1/1]
Installed: squid.i386 7:2.6.STABLE6-4.el5
Complete!

Squid Basic Configuration


Squid configuration file located at /etc/squid/squid.conf. Open file using a text editor:
# vi /etc/squid/squid.conf
At least you need to define ACL (access control list) to work with squid. The defaults port is TCP 3128. Following example ACL allowing access from your local networks 192.168.1.0/24 and 192.168.2.0/24. Make sure you adapt to list your internal IP networks from where browsing should be allowed:
acl our_networks src 192.168.1.0/24 192.168.2.0/24
http_access allow our_networks


Save and close the file. Start squid proxy server:
# chkconfig squid on
# /etc/init.d/squid start

Output:



init_cache_dir /var/spool/squid... Starting squid: .       [  OK  ]

Verify port 3128 is open:
# netstat -tulpn | grep 3128
Output:



tcp        0      0 0.0.0.0:3128                0.0.0.0:*                   LISTEN      20653/(squid)

Open TCP port 3128


Finally make sure iptables is allowing to access squid proxy server. Just open /etc/sysconfig/iptables file:
# vi /etc/sysconfig/iptables
Append configuration:
-A RH-Firewall-1-INPUT -m state --state NEW,ESTABLISHED,RELATED -m tcp -p tcp --dport 3128 -j ACCEPT
Restart iptables based firewall:
# /etc/init.d/iptables restart
Output:



Flushing firewall rules:                                   [  OK  ]
Setting chains to policy ACCEPT: filter [ OK ]
Unloading iptables modules: [ OK ]
Applying iptables firewall rules: [ OK ]
Loading additional iptables modules: ip_conntrack_netbios_n[ OK ]

Client configuration


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

How To Install Squid 2.7 from source on Centos 6

Steps :


This squid installation is done on Centos6


1. Frist you need to install Development tools
#yum groupinstall "Development Tools"
2. Get the “squid 2.7 ” source. decompress it.
#wget http://www.squid-cache.org/Versions/v2/2.7/squid-2.7.STABLE9.tar.gz
#tar -xzvf squid-2.7.STABLE9.tar.gz
3. change directory to squid -2.7


root@xyz squid-2.7.STABLE9]#
check configure options by
#./configure -help
4. Select your configuration
like
./configure --enable-gnuregex --enable-carp --with-pthreads --enable-heap-replacement --enable-icmp --enable-delay-pools --enable-useragent-log --enable-htcp --with-openssl --enable-linux-netfilter --disable-internal-dns --enable-auth=digest,ntlm,basic --enable-auth-baisc=PAM,NCSA,LDAP --enable-auth-basic=none --enable-basic-auth-helpers=PAM,NCSA,LDAP --enable-external-acl-helpers=unix_group,ldap_group --with-filedescriptors=8192 --enable-removal-policies=lru,heap
5.Make it.


#make
Installation
for installation you need to have root privileges .
# su


# make Install
if you get it without errors congratulate yourself.
and proceed to next step .
Your default installation directory is
#/usr/local/squid/
6.post-Installation
After compiling and installing squid, you should create the cache_dir, give it the rights permissions for the squid user/group and then run:
#/usr/sbin/squid -z
to initialize the cache_dir and create the necessary subdirs
If everything works as expected then try to start squid normally


Code:


#/usr/sbin/squid


7. Debug.
If you get any errors start squid in debug mode to get the errors on screen:


Code:


#/usr/sbin/squid -N -d 5



Search Terms


1.How To Install Squid 2.7 from source on Centos 6 


2.How To Install Squid 2.7  on Centos 6 

Saturday, 4 January 2014

Install lamp with 1 command in Ubuntu 12.10, 13.04 Raring Ringtail & LinuxMint13



LAMP (Linux, Apache, MySQL and PHP) is an open source Web development platform that uses Linux as operating system, Apache as the Web server, MySQL as the relational database management system and PHP as the object-oriented scripting language. We did show you in our previous post how to install LAMP in Ubuntu 10.04 with one command using tasksel command. It is a software installation application that is an integral part of the Debian installer and works under Ubuntu Linux too. It groups some packages by tasks and offers the user an easy way to install the packages for that task. It provides the same functionality as using conventional meta-packages. in Maverick this command dosn`t come by default, so we need to install it first before to perform the LAMP installation. This tutorial was has been tested on Ubuntu 10.04, 10.10, 11.04, 11.10, 12.04 LTS Precise Pangolin. Also tested in LinuxMint13 and works fine. Open terminal and Type the command :install it first with
sudo apt-get install tasksel

Now to install LAMP, type the taskel command in terminal :
sudo  tasksel

And select LAMP Server: During the installation you will be asked to insert the mysql root password Now check if php is working :
$sudo vi /var/www/info.php

and add
<?php
phpinfo();
?>

save and exit restart apache2 ,
#sudo /etc/init.d/apache2 restart

Now open browser and type :
http://ip/info.php or http://localhost/info.php

Php is installed. To full manage your lamp Server database, install phpmyadmin
sudo  apt-get  install  phpmyadmin

To login to phpmyadmin, open browser and type :
http://ip/phpmyadmin   or http://localhost/phpmyadmin

{module user9-footer|none}
How To Install LAMP In Ubuntu OS OS