Thursday, May 8, 2008

LINUX EDUCATION

Does Linux have a future?

Open Source

The idea behind Open Source software is rather simple: when programmers can read, distribute and change code, the code will mature. People can adapt it, fix it, debug it, and they can do it at a speed that dwarfs the performance of software developers at conventional companies. This software will be more flexible and of a better quality than software that has been developed using the conventional channels, because more people have tested it in more different conditions than the closed software developer ever can.



The Open Source initiative started to make this clear to the commercial world, and very slowly, commercial vendors are starting to see the point. While lots of academics and technical people have already been convinced for 20 years now that this is the way to go, commercial vendors needed applications like the Internet to make them realize they can profit from Open Source. Now Linux has grown past the stage where it was almost exclusively an academic system, useful only to a handful of people with a technical background. Now Linux provides more than the operating system: there is an entire infrastructure supporting the chain of effort of creating an operating system, of making and testing programs for it, of bringing everything to the users, of supplying maintenance, updates and support and customizations, etcetera. Today, Linux is ready to accept the challenge of a fast-changing world.

Ten years of experience at your service

While Linux is probably the most well-known Open Source initiative, there is another project that contributed enormously to the popularity of the Linux operating system. This project is called SAMBA, and its achievement is the reverse engineering of the Server Message Block (SMB)/Common Internet File System (CIFS) protocol used for file- and print-serving on PC-related machines, natively supported by MS Windows NT and OS/2, and Linux. Packages are now available for almost every system and provide interconnection solutions in mixed environments using MS Windows protocols: Windows-compatible (up to and including Win2K) file- and print-servers.
Maybe even more successful than the SAMBA project is the Apache HTTP server project. The server runs on UNIX, Windows NT and many other operating systems. Originally known as "A PAtCHy server", based on existing code and a series of "patch files", the name for the matured code deserves to be connoted with the native American tribe of the Apache, well-known for their superior skills in warfare strategy and inexhaustible endurance. Apache has been shown to be substantially faster, more stable and more feature-full than many other web servers. Apache is run on sites that get millions of visitors per day, and while no official support is provided by the developers, the Apache user community provides answers to all your questions. Commercial support is now being provided by a number of third parties.
In the category of office applications, a choice of MS Office suite clones is available, ranging from partial to full implementations of the applications available on MS Windows workstations. These initiatives helped a great deal to make Linux acceptable for the desktop market, because the users don't need extra training to learn how to work with new systems. With the desktop comes the praise of the common users, and not only their praise, but also their specific requirements, which are growing more intricate and demanding by the day.
The Open Source community, consisting largely of people who have been contributing for over half a decade, assures Linux' position as an important player on the desktop market as well as in general IT application. Paid employees and volunteers alike are working diligently so that Linux can maintain a position in the market. The more users, the more questions. The Open Source community makes sure answers keep coming, and watches the quality of the answers with a suspicious eye, resulting in ever more stability and accessibility.
Listing all the available Linux software is beyond the scope of this guide, as there are tens of thousands of packages. Throughout this course we will present you with the most common packages, which are almost all freely available. In order to take away some of the fear of the beginning user, here's a screenshot of one of your most-wanted programs. You can see for yourself that no effort has been spared to make users who are switching from Windows feel at home:


1.2. The user interface

1.2.1. Is Linux difficult?

Whether Linux is difficult to learn depends on the person you're asking. Experienced UNIX users will say no, because Linux is an ideal operating system for power-users and programmers, because it has been and is being developed by such people.
Everything a good programmer can wish for is available: compilers, libraries, development and debugging tools. These packages come with every standard Linux distribution. The C-compiler is included for free, all the documentation and manuals are there, and examples are often included to help you get started in no time. It feels like UNIX and switching between UNIX and Linux is a natural thing.
In the early days of Linux, being an expert was kind of required to start using the system. Those who mastered Linux felt better than the rest of the "lusers" who hadn't seen the light yet. It was common practice to tell a beginning user to "RTFM" (read the manuals). While the manuals were on every system, it was difficult to find the documentation, and even if someone did, explanations were in such technical terms that the new user became easily discouraged from learning the system.
The Linux-using community started to realize that if Linux was ever to be an important player on the operating system market, there had to be some serious changes in the accessibility of the system.

1.2.2. Linux for non-experienced users

Companies such as RedHat, SuSE and Mandrake have sprung up, providing packaged Linux distributions suitable for mass consumption. They integrated a great deal of graphical user interfaces (GUIs), developed by the community, in order to ease management of programs and services. As a Linux user today you have all the means of getting to know your system inside out, but it is no longer necessary to have that knowledge in order to make the system comply to your requests.
Nowadays you can log in graphically and start all required applications without even having to type a single character, while you still have the ability to access the core of the system if needed. Because of its structure, Linux allows a user to grow into the system: it equally fits new and experienced users. New users are not forced to do difficult things, while experienced users are not forced to work in the same way they did when they first started learning Linux.
While development in the service area continues, great things are being done for desktop users, generally considered as the group least likely to know how a system works. Developers of desktop applications are making incredible efforts to make the most beautiful desktops you've ever seen, or to make your Linux machine look just like your former MS Windows or MacIntosh workstation. The latest developments also include 3D acceleration support and support for USB devices, single-click updates of system and packages, and so on. Linux has these, and tries to present all available services in a logical form that ordinary people can understand.
The screenshot below shows how each item in the Channel list (RH 7.2, StarOffice, Opera, Ximian Gnome, Loki games and CodeWeavers) can be updated with one mouse click. Adding or removing software packages or keeping the system up to date is simple with tools like this one, called Red Carpet:

1.1. History

1.1.1. UNIX

In order to understand the popularity of Linux, we need to travel back in time, about 30 years ago...
Imagine computers as big as houses, even stadiums. While the sizes of those computers posed substantial problems, there was one thing that made this even worse: every computer had a different operating system. Software was always customized to serve a specific purpose, and software for one given system didn't run on another system. Being able to work with one system didn't automatically mean that you could work with another. It was difficult, both for the users and the system administrators.
Computers were extremely expensive then, and sacrifices had to be made even after the original purchase just to get the users to understand how they worked. The total cost of IT was enormous.
Technologically the world was not quite that advanced, so they had to live with the size for another decade. In 1969, a team of developers in the Bell Labs laboratories started working on a solution for the software problem, to address these compatibility issues. They developed a new operating system, which was
simple and elegant
written in the C programming language instead of in assembly code
able to recycle code.
The Bell Labs developers named their project "UNIX."
The code recycling features were very important. Until then, all commercially available computer systems were written in a code specifically developed for one system. UNIX on the other hand needed only a small piece of that special code, which is now commonly named the kernel. This kernel is the only piece of code that needs to be adapted for every specific system and forms the base of the UNIX system. The operating system and all other functions were built around this kernel and written in a higher programming language, C. This language was especially developed for creating the UNIX system. Using this new technique, it was much easier to develop an operating system that could run on many different types of hardware.
The software vendors were quick to adapt, since they could sell ten times more software almost effortlessly. Weird new situations came in existence: imagine for instance computers from different vendors communicating in the same network, or users working on different systems without the need for extra education to use another computer. UNIX did a great deal to help users become compatible with different systems.
Throughout the next couple of decades the development of UNIX continued. More things became possible to do and more hardware and software vendors added support for UNIX to their products.
UNIX was initially found only in very large environments with mainframes and minicomputers (note that a PC is a "micro" computer). You had to work at a university, for the government or for large financial corporations in order to get your hands on a UNIX system.
But smaller computers were being developed, and by the end of the 80's, many people had home computers. By that time, there were several versions of UNIX available for the PC architecture, but none of them were truly free.

1.1.2. Linus and Linux

Linus Torvalds, a young man studying computer science at the university of Helsinki, thought it would be a good idea to have some sort of freely available academic version of UNIX, and promptly started to code.
He started to ask questions, looking for answers and solutions that would help him get UNIX on his PC. Below is one of his first posts in comp.os.minix, dating from 1991:
From: torvalds@klaava.Helsinki.FI (Linus Benedict Torvalds)Newsgroups: comp.os.minixSubject: Gcc-1.40 and a posix-questionMessage-ID: <1991jul3.100050.9886@klaava.helsinki.fi>Date: 3 Jul 91 10:00:50 GMTHello netlanders,Due to a project I'm working on (in minix), I'm interested in the posixstandard definition. Could somebody please point me to a (preferably)machine-readable format of the latest posix rules? Ftp-sites would benice.
From the start, it was Linus' goal to have a free system that was completely compliant with the original UNIX. That is why he asked for POSIX standards, POSIX still being the standard for UNIX.
In those days plug-and-play wasn't invented yet, but so many people were interested in having a UNIX system of their own, that this was only a small obstacle. New drivers became available for all kinds of new hardware, at a continuously rising speed. Almost as soon as a new piece of hardware became available, someone bought it and submitted it to the Linux test, as the system was gradually being called, releasing more free code for an ever wider range of hardware. These coders didn't stop at their PC's; every piece of hardware they could find was useful for Linux.
Back then, those people were called "nerds" or "freaks", but it didn't matter to them, as long as the supported hardware list grew longer and longer. Thanks to these people, Linux is now not only ideal to run on new PC's, but is also the system of choice for old and exotic hardware that would be useless if Linux didn't exist.
Two years after Linus' post, there were 12000 Linux users. The project, popular with hobbyists, grew steadily, all the while staying within the bounds of the POSIX standard. All the features of UNIX were added over the next couple of years, resulting in the mature operating system Linux has become today. Linux is a full UNIX clone, fit for use on workstations as well as on middle-range and high-end servers. Today, all the important players on the hard- and software market each have their team of Linux developers; at your local dealer's you can even buy pre-installed Linux systems with official support.

1.1.3. Current application of Linux systems

Today Linux has joined the desktop market. Linux developers concentrated on networking and services in the beginning, and office applications have been the last barrier to be taken down. We don't like to admit that Microsoft is ruling this market, so plenty of alternatives have been started over the last couple of years to make Linux an acceptable choice as a workstation, providing an easy user interface and MS compatible office applications like word processors, spreadsheets, presentations and the like.
On the server side, Linux is well-known as a stable and reliable platform, providing database and trading services for companies like Amazon, the well-known online bookshop, US Post Office, the German army and such. Especially Internet providers and Internet service providers have grown fond of Linux as firewall, proxy- and web server, and you will find a Linux box within reach of every UNIX system administrator who appreciates a comfortable management station. Clusters of Linux machines are used in the creation of movies such as "Titanic", "Shrek" and others. In post offices, they are the nerve centers that route mail and in large search engine, clusters are used to perform internet searches.These are only a few of the thousands of heavy-duty jobs that Linux is performing day-to-day across the world.
It is also worth to note that modern Linux not only runs on workstations, mid- and high-end servers, but also on "gadgets" like PDA's, mobiles, a shipload of embedded applications and even on experimental wristwatches. This makes Linux the only operating system in the world covering such a wide range of hardware.



How to install roundcube on cPanel Server?

To install roundcube on a cPanel or Linux Server, you should know your MySQL root password. Replace your MySQL root password with Database Password.
If you have already used RoundCube installation before then make sure you have removed traces of it.
Follow the steps given below and remove any traces of it with,
cd /usr/local/cpanel/base
rm -rf roundcube*
mysql -p -e ‘drop database roundcube’;
chattr -i /usr/local/cpanel/base/frontend/x/webmaillogin.html
chattr -i /usr/local/cpanel/base/webmaillogin.cgi
/scripts/upcp
You will have to specify your root password when prompted.
Let us begin with installation
A) Download roundcube first from the given sourse and apply the proper permission to directories
cd /usr/local/cpanel/base
wget -O roundcube.tar.gz http://heanet.dl.sourceforge.net/sourceforge/roundcubemail/roundcubemail-0.1-rc1.tar.gz
tar -zxvf roundcube.tar.gz
rm -rf roundcube.tar.gz
mv -f roundcubemail-0.1-rc1 roundcube
cd roundcube
chmod -R 777 temp
chmod -R 777 logs
B) Create the database and install the intial sql file. The following commands will do this for you.
replace the mysql password in place of DATABASEPASSWORD
mysql -e “CREATE DATABASE roundcube;” -pDATABASEPASSWORD
mysql -e “use roundcube; source SQL/mysql.initial.sql;” -pDATABASEPASSWORD
C)Set the configuration as given below
cd config
mv db.inc.php.dist db.inc.php
mv main.inc.php.dist main.inc.php
Now open db.inc.php
nano db.inc.php
Find
$rcmail_config[’db_dsnw’] = ‘mysql://roundcube:pass@localhost/roundcubemail’;
Replace with
$rcmail_config[’db_dsnw’] = ‘mysql://root:DATABASEPASSWORD@localhost/roundcube’;
Now Open main.inc.php
nano main.inc.php
Find
$rcmail_config[’default_host’] = ‘’;
Replace with
$rcmail_config[’default_host’] = ‘localhost’;
D) Configure cPanel to show roundcube in the theme. Please note this is for the X theme(default) only!! If you use another theme please skip the next part and see below.
cd /usr/local/cpanel/base/roundcube/skins/default/images/
cp –reply=yes roundcube_logo.png /usr/local/cpanel/base/frontend/x/images/roundcube_logo.png
cp –reply=yes roundcube_logo.png /usr/local/cpanel/base/webmail/x/images/roundcube_logo.png
cd /usr/local/cpanel/base
wget http://www.hostgeekz.com/files/hostgeekz/HGpatch-roundcube-0.1-rc1
patch -p0

RoundCube——
***UPDATE***
Remember to chattr +i the files or add the patch to your /scripts/upcp.
chattr +i /usr/local/cpanel/base/frontend/x/webmaillogin.html
chattr +i /usr/local/cpanel/base/webmaillogin.cgi



Apache Installation on Linux

Apacahe is a very unique and the most popular web server which is used by different types of websites which is also called as Apache httpd .
Below are the installation steps for Apache. The user who is familiar with changing directories, using tar and gunzip, compiling and has root account of the server can easily install Apache
Installing Apache version 1.3.37
1) SSH to your server as root & download Apache 1.3.37 source from Apache httpd server website, http://httpd.apache.org/
# cd /usr/local/src
# wget http://httpd.apache.org/download.cgi
2) Extract the tar file.
# tar -zxvf apache1.3.tar.gz
# cd apache1.3
3) Now configure the source tree. We are installing apache at /usr/local/apache. Following will create a make file.
# ./configure –prefix=/usr/local/apache \
–enable-so \
–enable-cgi \
–enable-info \
–enable-rewrite \
–enable-speling \
–enable-usertrack \
–enable-deflate \
–enable-ssl \
–enable-mime-magic
You may only enable ‘-so‘. More information regarding the other options, you can try ./configure –help
Setting up Apache server.
1) With the above installation of apache the apache conf file is created at /usr/local/apache/conf/httpd.conf
1) If you want to run Apache on a different port to the default (80) then then change the number on line 280. Ports less than 1023 will require Apache to be started as root. Port 80 is probably the easiest to use since all other ports have to be specified explicitly in the web browser, eg: http://localhost:81.
Port 80
2) You may want to change the server admin email address on line 313:
ServerAdmin admin@example.com
3) Specify your machine name on line 331, you may just have to remove the # comment marker. If you configure virtual hosts as outlined below then Apache will use the virtual server you name here as the default documents for the site.
ServerName www.example.com
4) You should set the document root on line 338:
DocumentRoot /usr/local/apache/htdocs
5) And on line 363:
This should be changed to whatever you set DocumentRoot to.
6) The default file to serve in directories is index.html. You can change this or add new file names (in order or importance) on line 414.
DirectoryIndex index.html index.htm index.php
7) If you don’t get a large number of hits and you want to know where your visitors are from then turn host name look ups on at line 511. Turning this on does place extra load on your server as it has to look up the host name corresponding to the IP address of all your visitors.
HostnameLookups On
8) Apache Errorlog on line 520:
ErrorLog /usr/local/apache/logs/error_log
Setting Up Virtual Hosts:
1) Virtual Hosts in Apache enables the single Apache server to serve different web pages for different domains. Through Virtual Hosts we can configure how Apache should handle requests to each domain.
When any site or domain is browsed in a web browser, the browser sends the hostname of the server that it is connecting to, to the web server. All the HTTP request that come to the server (on the ports it was told to listen to) are caught by Apache. It checks the host name included in the request and uses that to determine the virtual host configuration it should utilize.
2) Whena request is received by Apache, it get following details:
Hostname: The domain name (eg. hostingcomments.com)
IP address: (eg. 10.10.10.1)
Port: (eg. 80)
During Apache configuration, we should mention each IP address and port combination for which we will be specifying virtual host domains, in the configuration file. So we should add the NameVirtualHost entry in the httpd.conf file:
NameVirtualHost 10.10.10.1:80
Please make sure the ipaddress that you use is configured on your machine.
3) Each virtual host will have its own directory for the web pages to be stored. This can be anywhere that the Apache web server has permission to read. For example, on a cPanel server the web pages are located at /home/username/public_html.
Now If we set a domain hostingcomments.com on the, its VirtualHost entry will be:
NameVirtualHost 10.10.10.1:80
ServerAlias www.hostingcomments.com
ServerAdmin webmaster@hostingcomments.com
DocumentRoot /home/hosting/public_html/
ServerName tmcnetwork.bayker.com
BytesLog domlogs/hostingcomments.com-bytes_log
CustomLog /usr/local/apache/domlogs/tmcnetwork.bayker.com combined
Running Apache:
1) apachectl is the easiest way to start and stop your server manually.
# cd /usr/local/apache/bin
# ./apachectl start
2) You can also copy the file /usr/local/apache/bin/httpd to /etc/init.d/ from where your can stop & start apache.
# /etc/init.d/httpd stop
# /etc/init.d/httpd start
4) Now make Apache from the above make file.
# make
5) If make is successful & goes without any error , install Apache
# make install


LINUX FLAVOURS

Different companies have various distributions of linux they differ in add-on software, GUI, basic commands, parameters, price and in others. These companies upgrade there versions in same time frame. Some of linux flavours are as per below.

* Red Hat:- The Red Hat distributions for Intel, Alpha and Sparc are built from the exact same source packages. This is to ensure maximum portability between platforms regardless of the underlying hardware architecture.
It’s also pegged as the top distro in terms of the development, deployment and management of Linux for an internet infrastructure.
Red Hat is also famous for a very easy installation system known as Red Hat Package Management, which effectively allows download and installation of packages with a single command.

* DEBIAN:-Debian Project claims to be “an association of individuals who have made common cause to create a free operating system”. But it has a reputation for being the ‘elite’ users choice in Linux, infamous for its uber techie ‘holier than thou’ user base.
Although, like many Linux variants, Debian is updated and maintained through the work of many users who volunteer their efforts, extensive pre-release testing is done to ensure the highest degree of reliability possible, and a publicly accessible bug tracking system provides an easy way to monitor user feedback.

* SUSE:- SuSE is the leading Linux distro in Europe and the biggest competitor to Red Hat. Known for its easy to use interface, SuSE is also renowned for good customer service, making it a strong player in the enterprise space.
Like Red Hat, SuSE is one of the oldest flavours of Linux. SuSE is also involved in the UnitedLinux project

* MANDRAKE:- MandrakeSoft seized this opportunity to integrate a user-friendly graphical desktop environment as well as to contribute its own graphical configuration utilities.
As a result Mandrake quickly became famous for setting the standard in ease-of-use and functionality and proved that Linux as a server or workstation has no reason to be jealous of any other more established operating systems.

* GENTOO:- Gentoo Linux is a versatile and fast distribution geared towards developers and network professionals. Again, a benefit of Gentoo is its advanced package management system called Portage.
This is a true ports system in the tradition of BSD ports, but is Python-based and sports a number of advanced features including dependencies, fine-grained package management, ‘fake’ installs, sand-boxing, safe un-merging, system profiles, virtual packages, config file management and more. It’s smooth and sleek, but definitely a Linux for power users.

* CALDERA:- OpenLinux product line is a multi-tasking, multi-user Linux-based operating system surrounded with utilities, graphical interfaces, installation procedures, third-party applications, etc.
But, like Turbolinux , the SCO Group - which was recently acquired by Caldera - will now focus on the UnitedLinux project.

* UBUNTU:- Ubuntu is a complete Linux-based operating system, freely available with both community and professional support. It is developed by a large community.Ubuntu is suitable for both desktop and server use. The current Ubuntu release supports PC (Intel x86), 64-bit PC (AMD64), Sun UltraSPARC and T1 (Sun Fire T1000 and T2000), PowerPC (Apple iBook, Powerbook, G4 and G5) and OpenPower (Power5) architectures.

Linux Advantages

Low cost: You don’t need to spend time and money to obtain licenses since Linux and much of it’s software come with the GNU General Public License. You can start to work immediately without worrying that your software may stop working anytime because the free trial version expires.

Stability: Linux doesn’t need to be rebooted periodically to maintain performance levels. It doesn’t freeze up or slow down over time due to memory leaks and such. Continuous up-times of hundreds of days (up to a year or more) are not uncommon.

Performance: Linux provides persistent high performance on workstations and on networks. It can handle unusually large numbers of users simultaneously, and can make old computers sufficiently responsive to be useful again.

Network friendliness: Linux was developed by a group of programmers over the Internet and has therefore strong support for network functionality; client and server systems can be easily set up on any computer running Linux. It can perform tasks such as network backups faster and more reliably than alternative systems.

Flexibility: Linux can be used for high performance server applications, desktop applications, and embedded systems. You can save disk space by only installing the components needed for a particular use. You can restrict the use of specific computers by installing for example only selected office applications instead of the whole suite.

Compatibility: It runs all common Unix software packages and can process all common file formats.

Choice: The large number of Linux distributions gives you a choice. Each distribution is developed and supported by a different organization. You can pick the one you like best; the core functionalities are the same; most software runs on most distributions.

Fast and easy installation: Most Linux distributions come with user-friendly installation and setup programs.
Full use of hard disk: Linux continues work well even when the hard disk is almost full.

Multitasking: Linux is designed to do many things at the same time; e.g., a large printing job in the background won’t slow down your other work.
Security: Linux is one of the most secure operating systems. “Walls” and flexible file access permission systems prevent access by unwanted visitors or viruses.

Open source: If you develop software that requires knowledge or modification of the operating system code, Linux’s source code is at your fingertips.