Sunday, January 8, 2012

How to Install Linux via apache http web server step by step guide example and implementation


During the first phase of RHCE exam you are asked to install Linux via nfs or ftp or apache server. you will be provided a Linux boot disk and IP address and necessary directory name for installation. You need not to prepare server side on exam but here in this article we will configure both server and client side . We have configured nfs and ftp server fornetwork installation in our pervious article you can check it.
In this practical we will show you How to prepare apache httpd server for network installation and further we will installation linux via apache httpd web server.

RHCE Exam Questions

There is a HTTP server 192.168.0.254 and all required packages are dumped in /var/www/html/rhel5 of that server. Install the Redhat Enterprise Linux 5 by creating following partitions:

/ - 1048
/home - 1028
/boot - 512
/var - 1028
/usr - 2048
swap 2X256 (RAM SIZE)

prepare Linux server for network installation

For this practical we need two systems one linux server and one client system. These pre quests should be completed on Linux server.
  • Linux server should be configured with hostname Server.example.com and IP address 192.168.0.254
  • DHCP and HTTP server should be configured and httpd and dhcpd service should be in running status
    service httpd restart

Prepare HTTP server for network installation

By default document root for http server is /var/www/html. So create a directory here with name rhel5 and make the dump of RHEL CD in it and restart the httpd service.
create dump of RHEL disk to /var/www/html/rhel5 and restart httpd service
dump or RHEL
service httpd restart
We have prepared HTTP server for network installation.

Configure Client for network installation via web server

Boot system with Linux boot CD, [ disk will be provided by examiner] Give linux askmethodcommand on boot prompt
linux askmethod
Select language to English
Select language to English
Select Keyboard layout to US
Select Keyboard layout to US
Select install method HTTP to install via web server
select method to http
At this point you can remove Linux boot disk form CDROM as we installing linux from http server.
Select Enable IPv4 supports and select dynamic ip configuration [ we have configured dhcp server on linux server so ip will be automatically retrieve ]
ip configuration
Give to ip address of web server in website name and rhel5 in directory name
ip address of website
After few second you will retrieve anaconda linux boot loader form server
boot screen retirved from server
Now you can install linux as you have installed it from local CD ROM . All remaining steps are same.

Two time saving technique

During RHCE exam most concern thing is time. So we suggest to create the partition According to the Question because Size and what-what partition should you create at installation time is specified in your question. Do not create any extra partition to save time because any additional partition will take time in formatting.
Due to the time limit, you should care about the installation packages. At Exam time these packages are enough.
  • X-Window System
  • GNOME Desktop
  • (these two packages are generally not required)
  • Administration Tools.
  • System Tools
  • Windows File Server
  • FTP Servers
  • Mail Servers
  • Web Servers
  • Network Servers
  • Editors
  • Text Based Internet
  • Server Configuration Tools
  • Base
  • Printing Supports

Saturday, January 7, 2012

How to configure linux print server step by step guide Example and Implementation


Linux uses the Common UNIX Printing System, also known as CUPS. CUPS uses the Internet Printing Protocol (IPP) to allow local printing and print sharing. The /etc/cups/ directory stores all the configuration files for printing. However, these files can be easily managed with the Printer Configuration Tool in Linux.
Exam question Raw (Model) printer named printer1 is installed and shared on 192.168.0.254. You should install theshared printer on your PC to connect shared printer using IPP Protocols.
Exam question Raw printer named printerx where x is your station number is installed and shared on server1.example.com. Install the shared printer on your PC to connect shared printer using IPP Protocols. Your server is 192.168.0.254.
Before you can use any printer, you first have to install it on a Linux system on your network. To start the Printer Configuration Tool, go to the System menu on the top panel and select Administration, Printing or execute the command system-config-printer.
printer path
If no printers are available for the system, only the Server Settings view is available for selection. If local printers are configured, a Local Printers menu will available.

Install new printer

click New Printer on the toolbar.
new printer
In the dialog window that appears, accept the default queue name or change it to a short, descriptive name that begins with a letter and does not contain spaces. Then select printerfrom list and click on forward and click on finsh.
spool directories
When your system prints a file, it makes use of special directories called spool directories. The location of the spool directory is obtained from the printer's entry in its configuration file. On Linux, the spool directory is located at/var/spool/cups under a directory with the name of the printer.
print job
A print job is a file to be printed. When you send a file to a printer, a copy of it is made and placed in a spool directory set up for that printer.
classes
CUPS features a way to let you select a group of printers to print a job instead of selecting just one. That way, if one printer is busy or down, another printer can be automatically selected to perform the job. Such groupings of printers are called classes. Once you have installed your printers, you can group them into different classes.
Once you have successfully installed local printer it will show in right pane. and in left pane you can see all administrative options.
printer option
  • To view shared printer on other system Tick mark on first option
  • To share locally attached printer tick mark on second option
  • To allow remote administration of this printer check mark on third option
Tick mark on appropriate option and click on apply
share printer from server

configure window clients

Go on window system and ping from printer server and open internet explorer and give the ip address of server with printer port 631
internet explorer
This will launch CUPS web application click on manage printer
manage printer
now you will see the shared printer on server click on print test page
print test page
A test page will be send on printer server copy this url of printer
copy url
click on start button select printer and fax and click on add new printer. this will launch add new printer wizard click next on welcome screen and select network printer
network printer
On this screen select internet printer and paste the url which you copied from internet explorer
internet printer
Install appropriate driver from list or use have disk option you have drive cd and click next. On next screen set this printer defaults and click on next and finish.
set defaults

Remote administration of print server

Go on linux system and ping from server and click on printing from administration menu
printer path
Now click on go to server 
go to printer server
Now give print server ip address
ip address of print server
It will take few minute to connect from server depending on network speed
connecting
Now give root password to connect printer server
root password
you can see all print administrative Manu in right pane Once you have connected with sever
print server options

configure Linux clients

Go on linux system and ping from server and click on printing from administration menu
printer path
Now click on new printer
new printer
Click on forward In the next New Printer screen, select the type of connection to internetprinting protocols and in hostname give server ip and printer name in printername
select ipp
select the appropriate model. If multiple drivers are available, select the one most appropriate for your configuration. If you do not want to choose the default and click forward and finish. The main Printer Configuration window should now include the name of your printer.
make default
To print test page click on print test page and a test page will send to print server
print test page

Managing Printers from the Command-Line

The lpadmin command enables you to perform most printer administration tasks from the command-line.
lpadmin

lpc To view all known queues
lpr To send print requests to any local print queue
lpq To see the print queue
lprm To delete the jobs of your choice use it with the job number
lp To print any file.
lpadmin

Friday, January 6, 2012

How to configure linux squid server step by step guide Example and Implementation


Proxy servers operate as an intermediary between a local network and Internet. Requests from local clients for web services can be handled by the proxy server. Squid is a high-performance HTTP and FTP caching proxy server. It is also known as a Web proxy cache. As it stores data from frequently used Web pages and files, it can often give your users the data they need without their systems having to look to the Internet.
From squid web proxy server you can control what should be access on your network from internet. It could be act as a filter that could filter everything from porn site to advertise , videos.
In our example we will configure squid web proxy server and filter sites and deny permission to specific host from accessing internet.

Configure squid web proxy server

squid rpm is required to configure squid web proxy server check it for install if not found install it.
sqid rpm
check the hostname and ip address of server it will be use in editing of squid.conf
hostname
Main Squid configuration file is squid.conf in the /etc/squid/ directory. This file contains over 4000 lines in , but only a few are active by default. Most of this file is filled with comments that describe most directives and associated options. To make editing easier use show line numbers options and locate desire tag from line number. We suggest you not to cram line number use them only to locate the desire tag as a simple enter can change the number of all lines in file.
open /etc/squid/squid.conf for editing
vi squid.conf
show hidden line with : set nu option on vi command mode
You need to add three lines to the squid.conf file in the /etc/squid/ directory before activating Squid
First editing is about hostname locate visible_hostname tag near about line no 2835
visible_hostname tag
Go in the end of this tag near about line no and add the hostname which you have checked in pervious command
visible hostname
By default squid works on port no 3128 but can change this. Port tag is located near line no 73
port number tag
For our example we using the default port.
Next editing is to create access control list. Access control tag is located near the line no 2226
access control tag
We will create three access list.
  • First to block host with ip address 192.168.1.7 from accessing internet.
  • Second to block a particular site.
  • Third to allow our lab network for accessing internet.
Go in the end of access control tag near about line 2410 and create access list as show here
access list tag in squid.conf
Final editing is to implement whatever access list you have configured in access list tag go to http access tag near line no 2482
http access tag
In the end of this tag near line no 2529 apply the configured access list
http access
Be very careful about the order of access list alway put http_access deny all line in the end of all line. Whatever access list defined below the http_access deny all line will never be checked.
You have made necessary changed in squid.conf now save it and return to command prompt.
We have created a access list web_deny to filter the web traffic. We have set http_access deny web_deny tag in squid.conf. Now you can add the url of those websites in this file which you want block.
Now create /etc/squid/web_deny file.
vi web_deny
for testing purpose in our example we are blocking www.google.com
editing in web deny
you can add any sites url in this file which you want to block.
You have completed all necessary steps now start the squid service.
service squid restart

Squid client configuration

On client set the ip configuration. Set proxy servers ip 192.168.1.3 to default getway anddns server ip on client system.
ip setting
Now open the web browser and set the port number and ip address of proxy server in connection tab
internet explorer setting
If you can successful retrieve website mean squid is working correctly
web page
Now try to open www.google.com
deny web access
Now go system which ip address is 192.168.1.7 and try to access after doing same setting
deny host in squid