Sie sind auf Seite 1von 56

1.

Linux
1.1 Introduction to Linux
Linux is a Unix-like and mostly POSIX-compliant computer operating system
assembled under the model of free and
open source software development and
distribution. The defining component
of
Linux is the Linux kernel, an operating
system kernel first released on 5
October 1991 by Linux Torvalds.
Linux was originally developed as a
free operating system for Intel x86based personal computers. It has since
been ported to more computer
hardware platforms than any other
operating system.] It is a leading
operating system on servers and other
big iron systems such as mainframe computers and supercomputers. As of June
2013, more than 95% of the world's 500 fastest supercomputers run some variant
of Linux, including all the 44 fastest.
Linux also runs on embedded systems, which are devices whose operating
system is typically built into the firmware and is highly tailored to the system;
this includes mobile phones, tablet computers, network routers, facility
automation controls, televisions and video game consoles. Android, which is a
widely used operating system for mobile devices, is built on top of the Linux
kernel.

1.2 History
The history of Linux began with UNIX in 1969. UNIX was created at Bell Labs
with the goals: Simplicity, Recyclable code, written in C as opposed to assembly.
Development started in 1991. Linux Torvalds wanted to create a free
implementation of UNIX. By 1993 there were 12000 Linux users. Today Linux
rivals UNIX in stability and scalability.

1.3 Linux Architecture


Linux System Architecture is consists of following layers

Hardware layer - Hardware consists of all peripheral devices (RAM/ HDD/


CPU etc).
Kernel - Kernel is the core part of Linux. It is responsible for all major
activities of this operating system. It is consists of various modules and it
interacts directly with the underlying hardware. Kernel provides the required
abstraction to hide low level hardware details to system or application
programs. Core component of Operating System, interacts directly with
hardware, and provides low level services to upper layer components.

Figure.1.1 Linux System Architecture

Shell - An interface to kernel, hiding complexity of kernel's functions from


users. Takes commands from user and executes kernel's functions.
Utilities - Utility programs giving user most of the functionalities of an
operating systems.

1.4 Features

Multitasking: several programs running at the same time.

Multiuser: several users on the same machine at the same time (and no twouser licenses!).

Multiplatform: runs on many different CPUs, not just Intel.

Multiprocessor: SMP support is available on the Intel and SPARC platforms


(with work currently in progress on other platforms), and Linux is used in
several loosely-coupled MP applications, including Beowulf systems and the
Fujitsu AP1000+ SPARC-based supercomputer.

Multithreading: has native kernel support for multiple independent threads of


control within a single process memory space.

Runs in protected mode on the 386.

Has memory protection between processes, so that one program can't bring the
whole system down.

Demand loads executable: Linux only reads from disk those parts of a
program that are actually used.

Shared copy-on-write pages among executables. This means that multiple


processes can use the same memory to run in. When one tries to write to that
memory, that page (4KB piece of memory) is copied somewhere else. Copyon-write has two benefits: increasing speed and decreasing memory use.

Virtual memory using paging (not swapping whole processes) to disk: to a


separate partition or a file in the file system, or both, with the possibility of
adding more swapping areas during runtime (yes, they're still called swapping
areas). A total of 16 of these 128 MB (2GB in recent kernels) swapping areas
can be used at the same time, for a theoretical total of 2 GB of useable swap
space. It is simple to increase this if necessary, by changing a few lines of
source code.

A unified memory pool for user programs and disk cache, so that all free
memory can be used for caching, and the cache can be reduced when running
large programs.

Dynamically linked shared libraries (DLLs) and static libraries too, of course.

Does core dumps for post-mortem analysis, allowing the use of a debugger on
a program not only while it is running but also after it has crashed.

Mostly compatible with POSIX, System V, and BSD at the source level.

Through an iBCS2-compliant emulation module, mostly compatible with


SCO, SVR3, and SVR4 at the binary level.

All source code is available, including the whole kernel and all drivers, the
development tools and all user programs; also, all of it is freely distributable.
Plenty of commercial programs are being provided for Linux without source,
but everything that has been free, including the entire base operating system, is
still free.

POSIX job control.

Pseudo terminals (pty's).

387-emulation in the kernel so that programs don't need to do their own math
emulation. Every computer running Linux appears to have a math coprocessor.
Of course, if your computer already contains an FPU, it will be used instead of
the emulation, and you can even compile your own kernel with math
emulation removed, for a small memory gain.

Support for many national or customized keyboards, and it is fairly easy to add
new ones dynamically.

Multiple virtual consoles: several independent login sessions through the


console, you switch by pressing a hot-key combination (not dependent on
video hardware). These are dynamically allocated; you can use up to 64.

Supports several common file systems, including minix, Xenix, and all the
common system V file systems, and has an advanced filesystems of its own,
which offers file systems of up to 4 TB, and names up to 255 characters long.

Transparent access to MS-DOS partitions (or OS/2 FAT partitions) via a


special filesystems: you don't need any special commands to use the MS-DOS
partition, it looks just like a normal Unix filesystems (except for funny
restrictions on filenames, permissions, and so on). MS-DOS 6 compressed
partitions do not work at this time without a patch (dmsdosfs). VFAT (WNT,
Windows 95) support and FAT-32 is available in Linux 2.0

Special filesystems called UMSDOS which allows Linux to be installed on a


DOS filesystems.

read-only HPFS-2 support for OS/2 2.1

HFS (Macintosh) file system support is available separately as a module.

CD-ROM filesystem which reads all standard formats of CD-ROMs.

TCP/IP networking, including ftp, telnet, NFS, etc.

Appletalk server

Netware client and server

Lan Manager/Windows Native (SMB) client and server

Many networking protocols: the base protocols available in the latest


development kernels include TCP, IPv4, IPv6, AX.25, X.25, IPX, DDP
(Appletalk), Netrom, and others. Stable network protocols included in the
stable kernels currently include TCP, IPv4, IPX, DDP, and AX.25

1.5 Windows vs. Linux


Table 1.Windows vs. Linux

Linux

Windows

Linux is an example of Open


Source software development
What is it?
and Free Operating System
(OS).
Linux can be freely distributed,
downloaded freely, distributed
through magazines, Books etc.
Cost
There are priced versions for
Linux also, but they are
normally cheaper than Windows.
Everyone. From home users to
User developers
and
computer
enthusiasts alike.
Linux kernel is developed by the
community. Linux Torvalds
oversees things.
Manufacturer

Windows is the family of


operating system (OS) from
Microsoft, which is the most
famous OS in the world.
For desktop or home use,
Windows can be expensive.
A single copy can cost
around $50 to $ 450
depending on the version of
Windows.
Everyone. From home users
to developers and computer
enthusiasts alike.
Microsoft
created
the
Windows operating system,
but allows other computer
manufactures to distribute
their own computers with
Windows pre-installed.
Usage Linux can be installed on a wide On PC's desktops, laptops,
variety of computer hardware, servers and some phones.
ranging from mobile phones,
5

Development
and
Distribution

GUI

File system
support

Text mode
interface

Price

Security

Threat
detection and
solution

Processors
Examples
Gaming

tablet computers and video game


consoles, to mainframes and
supercomputers.
Linux is developed by Open
Source development i.e. through
sharing and collaboration of
code and features through
forums etc and it is distributed
by various vendors.
Linux typically provides two
GUIs, KDE and Gnome. But
there are millions of alternatives
such as LXDE, Xfce, Unity,
Mate, twm, ect.

Windows is developed and


distributed by Microsoft.

The Windows GUI is an


integral component of the
OS and is not replaceable.
This can be a con when it
comes to Windows 8's
Metro.
Ext2, Ext3, Ext4, Jfs, ReiserFS, FAT, FAT32, NTFS, exFAT
Xfs, Btrfs, FAT, FAT32, NTFS
BASH (Bourne Again Shell) is Windows uses a command
the Linux default shell. It can shell and each version of
support multiple
command Windows has a single
interpreters.
command interpreter with
dos-like commands, recently
there is the addition of the
optional Power Shell that
uses
more
Unix-like
commands.
Free but support is available for $50-$450
a price.
Linux has had about 60-100 According to Dr.Nic Peeling
viruses listed till date. None of and Dr Julian Satchell's
them
actively
spreading Analysis of the Impact of
nowadays.
Open Source Software there
have been more than 60,000
viruses in Windows. Anti
Virus cost about $20 to $400
In case of Linux, threat detection After detecting a major
and solution is very fast, as threat in Windows OS,
Linux is mainly community Microsoft generally releases
driven and whenever any Linux a patch that can fix the
user posts any kind of threat, problem and it can take more
several developers start working than 2/3 months. Sometimes
on it from different parts of the sooner, Microsoft releases
world
patches and updates weekly.
Dozens of different kinds.
Limited but most (80%)
Ubuntu, Fedora, Red Hat, Windows 8, 8.1, 7, Vista, XP
Debian, Archlinux, Android etc.
Very few games available Almost all games are
natively. Some games can be compatible with Windows.
played through Wine, but often Some CPU intensive and
not all features are available.
graphics intensive games are
6

User
experience

Graphics
performance
Company /
developer

Although there are many GUI


applications, most of the work is
done through Terminal (a
console window), and if a
problem arrises GUI is rarely
usable to fix them.
Because
hardware
manufacturers, such as NVidia,
often
do
not
provide
documentation
for
Linux
developers, drivers cannot use
full card performance.
Linux Torvalds

Linux is a Unix-like and POSIXcompliant computer operating


system assembled under the
model of free and open source
Introduction software
development
and
(from distribution.
The
defining
Wikipedia) component of Linux is the Linux
kernel, an operating system
kernel first released
Available Multilingual
language(s)
License GNU/Free
All
Supported
platforms

Combined
with
newest
DirectX versions and full
graphics card support the
performance is almost as
good as it can get.
Microsoft
Microsoft Windows is a
series of graphical interface
operating
systems
developed, marketed, and
sold by Microsoft. Microsoft
introduced an operating
environment
named
Windows on November 20,
1985
as
a
graphical
operating system shell for
MS-DOS.
Multilingual

Proprietary
PowerPC: versions 1.0 - NT
4.0; DEC Alpha: versions
1.0 - NT 4.0; MIPS R4000:
versions 1.0 - NT 4.0; IA-32:
versions 1.0 - 8; IA-64:
version XP; x86-64: versions
XP - 8; ARM: version RT;
Gnome or KDE (Depends on Graphical (Windows Aero)
distro)
Basic Terminal (CLI)
MS-DOS
Open Source
Closed / Shared source
Many
Windows Update

Default user
interface
Preceded by
Source model
Update
method
Terminal Multi Terminal Windows

1.6 Distributors of Linux

exclusive to Windows PC's.


Everything can be controlled
through
GUI
and
incompatibility problems are
rare.

Ubuntu
7

--

Mint
Fedora
Debian
Red Hat
Etc.

1.7 Red Hat Enterprise Linux

Red Hat, Inc. is an American multinational software company providing opensource software products to the enterprise community. Founded in 1993, Red Hat
has its corporate headquarters in Raleigh, North Carolina, with satellite offices
worldwide.
Red Hat has become associated to a large extent with its enterprise operating
system Red Hat Enterprise Linux and with the acquisition of open-source
enterprise middleware vendor JBoss. Red Hat provides operating system
platforms, middleware, applications, management products, and support, training,
and consulting services. Red Hat creates, maintains, and contributes to many free
software projects and has also acquired several proprietary software packages and
released their source code mostly under the GNU GPL while holding copyright
under a single commercial entity and selling user subscriptions. As of June 2013,
Red Hat is the largest corporate contributor to Linux.

2.YUM Server
2.1.What is YUM?

Yum or Yellow dog Update, Modified is a package manager that was


developed by Duke University to improve the installation of RPMs.
Yum searches numerous repositories for packages and their dependencies so
they may be installed together in an effort to alleviate dependency issues. Red
Hat Enterprise Linux 5 uses Yum to fetch packages and install RPMs.
Yum uses a configuration file at /etc/yum.conf.
There are multiple ways by which you can install a repository on the system
and install/update packages:
1. Add an existing repository.
2. Setup a new repository having packages populated from ISO's
downloaded from RHN.
3. Register the system on RHN and subscribed to the channels depending
on the subscription you have.

2.2.How to Create YUM Server.

Step 1: Make a directory at /var/ftp/pub

Figure 2.1Making a directory

This Directory is made for copying all the packages from installation disk to packages
folder. It is done so that we dont have to mount the CD again and again.

10

Step 2: Mount cd

Figure. 2.2 Mounting CD


Here it is shown that the CD is successfully mounted and we can access the data
inside it.
We change the directory to /mnt to proceed to copy the packages.

11

Step 3: Copy Packages from /mnt/Packages to /var/ftp/pub

Figure. 2.3 Copying Packages

Cp is used to copy one or more files to another location. Here we are copying the
packages form Packages folder to /var/ftp/pub
Note :
1. From second cd too Server content in to our /var/ftp/pub/Packages/ folder as shown
below.
2. Here please take destination folder as /var/ftp/pub so that we can implement FTP
server to share our repository.
3. If you have RHEL5 DVD then execute below command once.

12

Figure. 2.4 Packages being copied

13

Step 4: Install the packages vsftpd, deltarpm, python-deltarpm and createrepo.

Figure. 2.5 Installing the required Packages

In this step, we change the directory to /var/ftp/pub/Packages and install the all those
package that are required to run the YUM server and remove the dependency
problem.

14

Step 5: Open file test.repo .

Figure. 2.6 Opening Repository

Now, we create a repository to save the server information that we are going to create.
Note : The directory /etc/yum.repos.d/ contains two .repo files which should be
removed or moved to other directory, so that YUM server will check default .repo file
itself. Q. What if I don't move or remove the default .repo files from /etc/yum.repos.d/
folder? A: Every time when you try to install packages through YUM, your yum will
check all these files for repositories for getting packages which will or will not work
and most probably delay is increased in getting those packages from online servers.

15

Step 6: Enter the following in test.repo

Figure. 2.7 Entering Server Information


The new file which is created contains as follows.
[server]
name=myrepo
baseurl=file:///var/ftp/pub/Packages
gpgcheck=0
After entering these entries save and exit from the file.
[server1.example.com] ==>This informs what is the repository name.
baseurl ==> This is the server and path of the repo(here its a local repo so the base
url is just a file:///
gpgcheck ==> This is to check the authentication of the repository, which is disabled
in this case.

16

Step 7: Restart vsftpd service.

Figure. 2.8 Restarting vsftpd service

Vsftpd is restarted whenever we edit repositories so that they are updated.

17

Step 8: Update the repositories.

Figure. 2.9 Repositories Updated

Note: In-order to use yum repository we have to clean the yum meta data, so before
installing any package first time use yum clean all command as shown above.

18

Step 9: Use yum list all to check the repositories data.

Figure. 2.10 Showing Repositories Data

YUM server has been created and its content is shown with yum list all command.

19

3.WEB Server
3.1.What is HTTP and HTTP Server?
The Hypertext Transfer Protocol (HTTP) is an application protocol for distributed,
collaborative, hypermedia information systems. HTTP is the foundation of data
communication for the World Wide Web.
Hypertext is structured text that uses logical links (hyperlinks) between nodes
containing text. HTTP is the protocol to exchange or transfer hypertext.
The Apache HTTP Server commonly referred to as Apache, is a web server
application notable for playing a key role in the initial growth of the World Wide Web.
Originally based on the NCSA HTTPd server, development of Apache began in early
1995 after work on the NCSA code stalled. Apache quickly overtook NCSA HTTPd
as the dominant HTTP server, and has remained the most popular HTTP server in use
since April 1996. In 2009, it became the first web server software to serve more than
100 million websites.
Apache is developed and maintained by an open community of developers under the
auspices of the Apache Software Foundation. Most commonly used on a Unix-like
system, the software is available for a wide variety of operating systems, including
Unix, FreeBSD, Linux, Solaris, Novell NetWare, OS X, Microsoft Windows, OS/2,
TPF, OpenVMS and eComStation. Released under the Apache License, Apache is
open-source software.

3.2. Requirements
YUM server, HTTP rpm.

20

3.3. Creation of Apache HTTP server


Step 1: Check whether http is installed or not.

Figure.3.1Checking http files

In this step, we have to check whether the rpm packages of http are installed or not.
For checking this we use the command rpm qa | grep http. If the packages are
installed it will show them in the result, if the packages are not installed we install
them with the help of YUM server, using command yum install http* -y.

21

Step 2: Edit the httpd configuration file.

Figure.3.2Editng http Configuration

httpd.conf file contains the configuration settings for the Apache server.
Edit the httpd.conf file using your vi editor using the vi command. Once loaded, there
are a number of settings that need to be changed to match our environment.

22

Step 3: Enter the server information as shown below.

Figure3.3 Entering Server Information

The ServerAdmin directive defines an administrative email address for people


wishing to contact the root for your site,
Next the ServerName and ServerAlias directives need to be defined so that the
web server knows which virtual host this configuration file refers to.
we need to define where the web site files are going to be located using the
Document Root directive. The tradition is to use /var/www/html
Save and quit the file.

23

Step 4: Check for errors in configuration file.

Figure 3.4Checking Errors

http t command is used to check whether there is any syntax error in httpd.conf file
or not.
If there arent any errors in the above mentioned file Syntax OK message will be
displayed.

24

Step 5: Restart httpd service.

Figure3.5Restartinghttpd service

httpd is restarted whenever we edit repositories related to that service so that they are
updated.

25

Step 6: Create a html file in /var/www/html .

Figure 3.6Creating html file

Here, malala.html is the new html file created.

26

Step 7: Write the message to be displayed in malala.html .

Figure 3.7Editing html file

In this file, we are supposed to write html coding or just a simple message to
be displayed.
Save file and exit.

27

Step 8: Now, edit the host file and enter the IP address of server, host
name and server name after removing anything that was previously
written.

Figure.3.8 Host file data

IP address: - 192.168.1.1
Host Name: - ashubh
Server Name: - impulseyouth.com

28

Step 9: Restart httpd service.

httpd is restarted whenever we edit repositories related to that service so that they are
updated.

29

Step 10: Now open firefox and type your server name in the url bar.

Figure.3.9 Firefox

30

3.4.Indexing on webpage
Step 1: Create a directory in /var/www/html/

Figure.3.10Creating song directory

This directory is created to save the files that we are going to host on download page.

31

Step 2: Create some files in song directory.

Figure.3.11Creating files in song

We are using mp3 files as downloading files. Here we are creating some mp3 files
that will be used as downloading files.

32

Step 3: Open httpd configuration file.

Figure.3.12Editing http configuration

httpd.conf file contains the configuration settings for the Apache server.
Edit the httpd.conf file using your vi editor using the vi command. Once loaded, there
are a number of settings that need to be changed to match our environment.

33

Step 4: Add the directory information and path as shown below.

Figure.3.13Adding server data

The Directory Index directive allows you to specify a document to be served to a


client when a directory is requested (that is, when the URL ends with the / character).
All the other attributes are same as those which are described in previous section.
Save and quit the file.

34

Step 5: Open firefox.

Figure.3.14 Opening firefox

Now, we open firefox to test our webpage that we have created.

35

Step 6: Type the address of song directory in url bar.

Figure.3.15 Download Page

To check whether download page is successfully created or not we type the address of
song folder in url bar. If the above page is displayed, it means that we have
successfully created the download page.

36

3.5. Adding Authentication to a webpage


Step 1: Create a directory in /var/www/html/

Figure.3.16Creating song directory

This directory is created to save the files that we are going to host on download page.

37

Step 2: Create some files in song directory.

Figure.3.17 Creating files in song

We are using mp3 files as downloading files. Here we are creating some mp3 files
that will be used as downloading files.

38

Step 3: Open httpd configuration file.

Figure.3.18Editing http configuration

httpd.conf file contains the configuration settings for the Apache server.
Edit the httpd.conf file using your vi editor using the vi command. Once loaded, there
are a number of settings that need to be changed to match our environment.

39

Step 4: Add the directory information and path as shown below.

Figure.3.19Adding server data

The Directory Index directive allows you to specify a document to be served to a


client when a directory is requested (that is, when the URL ends with the / character).
All the other attributes are same as those which are described in previous section.
Save and quit the file.

40

Step 5: Now, create a hidden file in song directory.

Figure.3.20 Create Hidden File

Now we create hidden file which contains information about which users will be able
to access the download page.

41

Step 6: Type the following in that file.

Figure.3.21 Editing Hidden File

Here we are specifying the information about the site or page that we have created
and its location.
Save and quit the file.

42

Step 7: Restart service httpd

Figure.3.22Restarting httpd Service

httpd.conf file contains the configuration settings for the Apache server.
Edit the httpd.conf file using your vi editor using the vi command. Once loaded, there
are a number of settings that need to be changed to match our environment.

43

Step 8: Add password to existing user for visiting the web page as
follows.

Figure.3.23 Adding Password

In this step, we are allocating username and password to the download page.

44

Step 9: Open firefox and type the address of song directory in url bar.

Figure.3.24 Webpage Asking Authentication

45

Step 10: Type user name and password to access the page

Figure.3.25 Information Being Entered

46

Step 11: If user name and password is correct you will be redirected to
download page.

Figure.3.26 Download Page Reached

47

3.6.Hosting two websites on single IP address


Step 1: Open httpd configuration file.

Figure.3.27 Opening Httpd Configuration file

httpd.conf file contains the configuration settings for the Apache server.
Edit the httpd.conf file using your vi editor using the vi command. Once loaded, there
are a number of settings that need to be changed to match our environment.

48

Step 2: Enter the alias server information as follows.

Figure.3.28 Adding Server Information

The ServerAdmin directive defines an administrative email address for people


wishing to contact the root for your site,
Next the ServerName and ServerAlias directives need to be defined so that the
web server knows which virtual host this configuration file refers to.
we need to define where the web site files are going to be located using the
Document Root directive. The tradition is to use /var/www/html

49

Step 3: Create html file in/var/www/html/file.htm

Figure.3.29Creating html file

Now, create the /var/www/html/ directory and place an malala1.html file in it.

50

Step 4: Enter the message in that file.

Figure.3.30 Inserting Data in File

In this file, we are supposed to write html coding or just a simple message to
be displayed.
Save and exit.

51

Step 5: Now, edit the host file using command vi /etc/hosts and enter
the IP address of server, host name and server name.

Figure.3.31 Adding Host

It is beneficial to trick your workstation into believing that a certain hostname points
to a test or development server instance of that hostname instead of the production
(current live) instance.
In Linux, this is done by modifying the /etc/hosts file on your workstation. Simply
open the file with vi editor and add a line to the file with the IP address of the test
server and the name of the production server.

52

Step 6: Open firefox and type the alias server name in urlbar to reach the
designed page.

Figure.3.32 Site created

53

Conclusion
Linux is basically used as a free operating system. The development of Linux is
one of the most prominent examples of free and open source collaboration. Red
Hat Linux, assembled by the company Red Hat is a popular Linux based
operating system.theHypertext Transfer Protocol (HTTP) is an application
protocol for distributed, collaborative, hypermedia information system which is
developed under the LINUX operating system.A web Browser is a very common
example of http server. The given project shows the steps of how to create an http
server using the Linux operating system.

54

Future Work
The interoperability framework provides a high level context and structure within
which interoperability discussion can occur. It identifies key categories and issues
that need to be addressed. It will not provide reference architecture and a high
level model that identifies the primary systems involved in the future smart grid
along with key boundaries information change and interactions. Such architecture
ad model is needed in the future.
The architecture would be based on foundation that distributed generations,
demand response and transmission\distributed technology will become automated
through the use of model large scale, distributed computing technology.
In order to fully evaluate the expected benefits of the proposed architecture here is
a need to implement this architecture in a real grid environment, which then can
be tested for evaluation of scalability and reliability .the architecture provides a
basis for the implementation of the experimental prototype for future research, and
it could be implemented on a grid implementation in the real environment to
develop a grid enabled application, demonstrate the feasibility of semantic
heterogeneity, and evaluate the implementation of the proposed architecture.
There are many avenues that can be explored on the basis of this study. The
architecture proposed as the potential to widely applicable, but has yet to be
proven for its functional feasibility when implemented in a real environment.

55

Bibliography
http://www.basicconfig.com/linux/http
http://computernetworkingnotes.com/network-administration/how-toconfigure-yum-server-in-rhel6.html
http://rbsrhel.blogspot.in/2013/03/rhel-6-yum-server-and-client.html
http://en.wikipedia.org/wiki/Red_Hat_Linux
http://yourlinuxzone.blogspot.in/2011/12/configure-http-server-on-redhat.html
http://www.ehowstuff.com/how-to-install-http-server-on-rhel-6/

56

Das könnte Ihnen auch gefallen