Project : Setup a Reliable Web Server
Location-6017 NW 27th Terrace, Gainesville , Florida-32653
Purpose
Primary benefits of using the web server would be the following
Web Server is a software program or server computer equipped to offer World Wide Web access.
*Software Program is a set of computer programs, procedures, and associated documentation concerned with the operation of a data processing system; e.g., compilers, library routines, manuals, and circuit diagrams.
*Server Computer is a device that accepts data, processes the data in accordance with a stored program, generates results, and usually consists of input, output, storage, arithmetic, logic, and control units. A functional unit that can perform substantial computation, including numerous arithmetic operations or logic operations, without human intervention during a run.
*World Wide Web is a global, virtual-network based hypertext information system that uses the Internet as its transport mechanism to display computer screens (or Web pages) of graphical, video, textual, and even audio information.
Brief Idea of the web server to be used at location gainesville , Florida.
Web Server- Apache
Apache is a Public Domain open source web server.
*Public Domain refers to any program that is not copyrighted. Public-domain software is free and can be used without restrictions. The term public-domain software is often used incorrectly to include freeware, free software that is nevertheless copyrighted.
*Open Source refers to a program in which the source code is available to the general public for use and/or modification from its original design free of charge, i.e., open.
We preferred to use Apache because of the following reasons
Apache has been shown to be substantially faster, more stable, and more feature-full than many other web servers.
Although certain commercial servers have claimed to surpass Apache's speed (it has not been demonstrated that any of these "benchmarks" are a good way of measuring WWW server speed at any rate), we feel that it is better to have a mostly-fast free server than an extremely-fast server that costs thousands of dollars.
Apache is run on sites that get millions of hits per day, and they have experienced no performance difficulties.
More informations on Apache can be found on the following web sites.
· Apache web site http://httpd.apache.org/
· About Apache http://httpd.apache.org/ABOUT_APACHE.html
· Apache Week http://www.apacheweek.com/
· There are also some Apache-specific books
http://httpd.apache.org/info/apache_books.html
· Apache Documentation http://httpd.apache.org/docs-2.0
· Apache Version 2.0 http://httpd.apache.org/docs-2.0
· FAQ’s on Apache http://httpd.apache.org/docs/misc/FAQ.html
Where to get Apache?
We can download Apache Server from many sites on the Internet. We would get the most recent version at www.apache.org . This is the official site for Apache.
Also we could check popular software download sites such as www.download.com or www.tucows.com or www.davecentral.com .
Apache is included in the Red hat 9.0
Directory
Structure of Apache Web Server
/home/httpd : Contains a lot of icons and the default html pages that the
server sends to the client.
/etc/httpd/conf : Apache configuration files are stored in this
directory.
/etc/rc.d : This directory maintains a list of services to be started
every time Linux boots depending on the run level. Apache adds its own entries
in the various subdirectories within this directory to start, stop the Apache
Web server.
We can change the settings that Apache uses by editing the file /etc/httpd/conf/httpd.conf
.
Note : We might have seen a srm.conf and access.conf file present in the
/etc/httpd/conf directory. The older versions of Apache Server used these files
for various settings. The newer version of Apache server has kept these files
empty and simply added all the settings in the httpd.conf file itself to avoid
confusion. So in the new version these files are of no significance.
Starting - Stopping - Restarting the Apache Web Server
To test Apache Server we can start Apache server as follows
# httpd start
Note that we must be the superuser to start the Apache server. Since if we want
Apache to respond to requests at port 80 (the default http port) then only the
superuser can bind Apache server to port 80 since it is a privileged port.
Besides this if we start Apache as normal user it would run with the UID/GID of
that user and this is not the right way to run the Server.
Alternatively in case the above command gives us an error we could try the
following
# /etc/rc.d/init.d/http start
To stop the server we can type the following
# httpd stop
Once again in case the above doesn't work then we could try typing the following
# /etc/rc.d/init.d/http stop
To restart the server after we
make any changes to the configuration files, we can type this simple command
# /etc/rc.d/init.d/http restart
The above command would stop the running server and then once again start the
server.
Some error messages we may face
' httpd: could not open document configuration file '
' fopen : no such file or directory '
Both these are problems with the path that has been set. Remember that Apache
finds everything relative to the DocumentRoot directive set in the httpd.conf
file. So see to it that there is no mistake in setting that value. You can read
more about the DocumentRoot directive in the next part of this article. Just
remember that this problem is because of wrong setting in the configuration
file.
' httpd : could not bind to port 80 '
' bind : operation not permitted '
This is mostly because of running Apache as a normal user and not the superuser.
To access port 80 you must be superuser or any other user with the privileges as
the superuser.
Configuring Apache Web Server
Operating System : LINUX – Red Hat 9.0 .
Red Hat Linux is available on CD-ROM directly from Red Hat, Inc., at http://www.redhat.com/commerce or through various Red Hat Linux resellers. It is also available via the Red Hat FTP server (ftp://ftp.redhat.com/pub/redhat/linux/) and many mirror sites (http://www.redhat.com/download/mirror.html).
Red Hat 9 Features
Getting started with Red hat 9.0
The first time we start our Red Hat Linux machine, we will be presented with the Setup Agent, which guides us through the Red Hat Linux configuration. Using this tool, we can set our system time and date, install software, register our machine with the Red Hat Network, and more. Setup Agent lets us configure our environment at the beginning, so that we can get started using our Red Hat Linux system quickly.

The Setup Agent first prompts us to create a user account that we should use on a routine basis. It is not recommended to log in to our root account for common computing tasks, as we may damage our system or unintentionally delete a file. The Setup Agent lets us enter a username, an optional full name for the account, and a password (which you must enter twice). This creates a user account that we can use to log into our Red Hat Linux system and which has its own home directory on the system to store files.

Setup Agent allows us to set your machine's date and time, or lets us synchronize our date and time with an network time server — a machine that sends date and time information to our machine through a network connection. Set the day, month, and year using the calendar tool and set our time in hours, minutes, and seconds using provided text boxes. Once we have set our time and date, click Forward to continue.
If you wish to register our system with the Red Hat Network and receive automatic updates of our Red Hat Linux system, choose Yes, I would like to register with Red Hat Network.
For more informations Red Hat Network and Registration we should refer to documentation on website: http://www.redhat.com/docs/manuals/RHNetwork/
We need to read each instruction while installation.

Step by Step
guide to installing Redhat 9.0
Screen 1 If we have booted our system with the Redhat installation media
or are installing by NFS we will see the Redhat welcome screen. Press enter for
install in graphical mode.
Screen 2 Press next
Screen 3 Select English
Screen 4 Keyboard type. Choose US International
Screen 5 Mouse type. Select our mouse type here and, if we are going to
use this system as a desktop, enable the emulate 3 buttons check box.
Screen 6 Installation type. Choose Custom
Screen 7 Disk Partitioning. Choose Manually with Disk Druid
Screen 8 Disk Setup. Delete all existing partitions (WARNING: ALL Data
currently on the disk is erased!) Depending on our needs, create new partitions.
I go for simplicity, creating two partitions, one for use as swap which I make
twice as large as the amount of physical RAM and one for all other data, called
a root partition. Here's how;
Select new then enter the following into the pop-up box;
file system type swap
size (2x RAM) e.g. 64
then OK
then;
Select new
enter the following into the pop-up box;
Mount Point /
File system type EXT3
and click the Fill to maximum allowable size checkbox
then click OK
We should now have two visible partitions, called /dev/hda1 and /dev/hda2
underneath the /dev/hda entry. One will be type EXT3 and one will be type swap.
At this stage we have finished configuring partitions. Click next to go to the
next screen.
Screen 9 Boot Loader. Grub is the preferred boot loader and the default
options are suitable, so nothing needs to be changed here. Click next.
Screen 10 Network configuration. We will see a list of your network
interfaces (such as eth0). Configure each one to suit our own physical network
requirements, with reference to the information you gathered in chapter 2.
I don't use DHCP for wired machines so I select to configure manually and enter
the IP information in the box provided.
Note that our wireless card probably has not been detected by this stage. Don't
worry we'll configure it later.
Screen 11 Firewall configuration. If we intend to run NoCat your entries
here will be superseded by the NoCat configuration process. For the purpose of
the initail configuration, select Medium security level and ETH0 as a trusted
device. Allow Incoming ssh.
Screen 12 Additional Language Support. Check English (NZ) and uncheck
English (USA)
Screen 13 Timezone. Click on the map of New Zealand to set the timezone.
Screen 14 Root password. This screen is where we set the password for the
super-user.Create a root password that you will remember. Click OK then Next
Screen 15 Authentication Configuration. The default settings don't need
to be changed. Click Next.
Screen 16 Package selection. The packages we chose here will depend on
what we want to do with your system, so the recommendations I make below are
guidelines. Anything that we omit here but need later can be installed at a
later stage. Here it is section by section;
In Editors Emacs can be removed and vim-enhanced can be added
In Graphical Internet evolution, gaim, mozilla-mail, pan and xchat can be
removed.
In Office/Productivity mrproject and openoffice can be removed.
In Sound and Video Any selected packages in this section can be removed.
In Graphics gimp, gimp-data-extras, gtkam, sane-frontends, xsane and
xsane-gimp can be removed.
In Server Configuration Tools select all of the GUI configuration toolswe
require for the various services we intend to have on the box. We may find
redhat-config-bind, redhat-config-httpd, redhat-config-network and
redhat-config-services useful.
In Web server select all that are applicable for our situation if we
intend to use this system as a web server in addition to an Access Point. For
use with NoCat you will need mod_perl and mod_ssl
In DNS Name Server select caching-nameserver.
In Network Servers Select all of the services we wish to run. For our
Access Point we need ZEBRA (configured in chapter 7) and DHCP (configured in
chapter 5.) cipe, pxe, rsh-server, talk-server, telnet-server and ypserv can be
removed.
In Administration Tools select all of the GUI config tools that we think
we require. They are safe to install even if we don't end up using them.
In System Tools amanda, ethereal, ethereal-gnome, nmap and nmap-front-end
are useful and can be installed and we will use shapecfg in appendix C for
configuring bandwidth management.
Click next to being the actual RedHat installation. The install process will
begin by formatting the new partitions and installing the various packages
required for a functioning Linux system. The installation should take
approximately 25 minutes. At the end of this process, configure the X display
system for your hardware if required. It is a good idea to turn off Graphical
login type at this point. We will be presented with the option to create a
bootdisk once the install is complete. It is a good idea to do so.



Introductory Terms
When we learn about a new operating system, we should also learn new terminology. The following are few basic terms we should learn. We can see these terms often throughout all Red Hat Linux documentation including the Red Hat Linux Getting Started Guide:
· Command: An instruction given to the computer, most often with the keyboard or mouse.
· Command line: The space at the shell prompt where commands are typed.
· Graphical Desktop: The most visible area of a GUI. The desktop is where our user Home and Start Here icons are located. We can customize our desktop to have special backgrounds, colors, and pictures to add a personal touch.
· Graphical User Interface (GUI): A general term for interactive windows, icons, menus, and panels which allow a user to initiate actions such as starting applications and opening files using a mouse and keyboard.
· Icons are small images representing an application, folder, shortcut or system resource (such as a diskette drive). Launcher icons usually refer to application shortcuts.
· Man page and Info page: Man (short for manual) and Info pages give detailed information about a command or file (man pages tend to be brief and provide less explanation than Info pages). For example, to read the man page for the su command, type man su at a shell prompt (or type info su for the info page). To close man or Info pages, press [q].
· Panel: A desktop toolbar, usually located across the bottom of our desktop. The panel contains the Main Menu button and shortcut icons to start commonly used programs. Panels can also be customized to suit our needs.
· Root: Root is an administrative user account created during installation and has complete access to the system. We must be logged in as root to accomplish certain system administration tasks, such as changing administrative passwords and running system configuration tools. User accounts are created so that typical user tasks can be done without using the root account, which can reduce the chance of damaging your Red Hat Linux installation or applications permanently.
· RPM: RPM stands for RPM Package manager and is how Red Hat builds and delivers its software files. An RPM is a software package file we can install on our Red Hat Linux computer.
· su and su -: The command su gives us access to the root account or other accounts on our system. When we type su to switch to our root account while still inside our user account shell, we have access to important system files that we can change (or damage if you are not careful). Logging in with the su - command makes us root within the root account shell. Use caution when we are logged in as root.
· X or X Window System: These terms refer to the graphical user interface environments. If we are "in X" or "running X", we are working in a GUI rather than a console environment.
For any reference on Red Hat 9.0 visit www.redhat.com.
The server installation is most appropriate if we would like our system to function as a Linux-based server, and we do not want to heavily customize our system configuration.
Below are the minimum recommended disk space requirements for a server installation where only one language (such as English) will be installed.
· Server (minimum, no graphical interface): 850MB
· Server (choosing everything, no graphical interface): 1.5GB
· Server (choosing everything, including a graphical interface): 5.0GB
If we plan to choose all group packages, as well as select additional individual packages, we may want to allow ourself 5.0GB or more of disk space.
During the server installation, the X Window System is not configured and no GUI will be loaded when the system boots, unless we choose to install the appropriate packages during package selection.
· The size of the swap partition is determined by the amount of RAM in our system and the amount of space available on our hard drive. For example, if we have 128MB of RAM then the swap partition created can be 128MB - 256MB (twice our RAM), depending on how much disk space is available.
· A 100MB partition mounted as /boot in which the Linux kernel and related files reside.
· A root partition mounted as / in which all other files are stored (the exact size of this partition is dependent on our available disk space).
This disk partitioning scheme results in a reasonably flexible file system configuration for most server tasks.
Installation Steps has to be carried in a systematic manner including different packages as per the requirement.
Setting up a root account and password is one of the most important steps during our installation.
The root account is used to install packages, upgrade RPMs, and perform most system maintenance. Logging in as root gives you complete control over your system.
Use the root account only for system administration. Create a non-root account for our general use and su - to root when we need to fix something quickly. These basic rules will minimize the chances of a typo or an incorrect command doing damage to our system.
The installation program will prompt us to set a root password for our system. We must enter a root password. The installation program will not let us proceed to the next section without entering a root password.
The root password must be at least six characters long; the password we type is not echoed to the screen. We must enter the password twice; if the two passwords do not match, the installation program will ask us to enter them again.
To change our root password after we have completed the installation, use the Root Password Tool.
Type the redhat-config-rootpassword command in a shell prompt to launch the Root Password Tool. If we are not root, it will prompt you for the root password to continue.
A root password is the administrative password for our Red Hat Linux system. We should only log in as root when needed for system maintenance. The root account does not operate within the restrictions placed on normal user accounts, so changes made as root can have implications for your entire system.

Root Password
After our partitions have been selected and configured for formatting, we are ready to select packages for installation.
Unless we choose a custom installation, the installation program will automatically choose most packages for us.
To select packages individually, check the Customize the set of packages to be installed checkbox.

Package Group Selection
Installing Package
At this point there is nothing left for us to do until all the packages have been installed . How quickly this happens depends on the number of packages we have selected and our computer's speed.
Boot Diskette Creation
To create a boot diskette, insert a blank, formatted diskette into our diskette drive
It is highly recommended that we create a boot diskette. If, for some reason, our system were not able to boot properly using GRUB, LILO, or a third-party boot loader, a boot diskette would enable us to properly boot our Red Hat Linux system.
After a short delay, our boot diskette will be created; remove it from our diskette drive and label it clearly. Note that if we would like to create a boot diskette after the installation, we will be able to do so.
For more information, please see the mkbootdisk man page, by typing man mkbootdisk at the shell prompt.
Important Informations
Signal 11 or Signal 7 Problems During Installation
Signal 11's and signal 7's are errors indicating a hardware error in memory or on the bus. This can be due to problems in executables or with the hardware of the system. The Linux kernel tends to make much greater use of capabilities of a system's CPU, cache, and memory. Therefore, it is more prone to faulting on marginal or defective hardware.
The first thing to do is check to see if we have the latest installation and supplemental floppies from Red Hat.
Common suspects are memory (RAM) or the CPU-cache. Try turning off the CPU-cache in the BIOS and see if the problem goes away. Also try swapping the RAM modules around in the motherboard slots to see if it is either slot or memory related.
Insert the installation floppy and restart the machine. At the boot: prompt, type the following:
vmlinuz root=/dev/hdXY
[Example: vmlinuz root=/dev/hdb5 ]
Where X is the IDE drive letter and Y is the partition on the drive where we installed the root (/) partition for Red Hat Linux.
For most RPM packages, you can simply type rpm -Uvh filename
· Installation/Upgrading/Removal
o To install a package: rpm -ivh filename
|
rpm -ivh somepackage.1.1-4.i386.rpm |
o To upgrade a package: rpm -Uvh filename
|
rpm -Uvh somepackage.1.1-5.i386.rpm |
o To remove a package: rpm -e packagename
|
rpm -e somepackage |
o To see if a package is installed: rpm -q packagename
|
rpm -q somepackage |
o To get info on an installed package: rpm -qi packagename
|
rpm -qi somepackage |
o To list which files belong to a package: rpm -ql packagename
|
rpm -ql somepackage |
o To see what package a file belongs to: rpm -qf path-to-filename
|
rpm -qf /usr/bin/some_executable |
First, log in as root and run the adduser command.
|
adduser username |
Make certain that we also set up a password for the new user.
|
passwd username |
When the system comes to the LILO: prompt, type linux single.
When we get the # prompt we will need to type passwd root.
This will update the password to a newer one. At this point we can type shutdown -r now and the system should boot up normally. We can now use your new root password to gain root access.
To see other resources, check the following:Check if there are conflicts.
cat /proc/pci
cat /proc/interrupts
cat /proc/ioports
cat /proc/dma
Getting Online-Using LAN
Going online through LAN had been easy .
We just need to connect the web server to one ports of the router or hub and is online.
But this was just to test if the webserver network configuration are fine to get online. Using this setup is not of any use as we need to host web page and make the computer a Web server. Using the above setup the web server would get a static IP address and test web page could not be hosted .
Although using dynamic IP address its difficult osting a test page but I tried to do. But using above setting its never possible.
Getting Online using – USB Alcatel MODEM.
ISP- Bell South
Bell South doesn’t support Linux environment so it doesn’t provide drivers for USB modem also to work in Linux environment.
This is now a tough part.
Need to find drivers for the USB modem.
Finally able to locate the drivers for USB Modem but the next step are more challenging and its really a togh job to make this work.
Drivers can be downloaded from the site www.alcateldsl.com
Drivers version speedtouch-1.2-beta1.tar.gz
Management Applications speedmgmt.tar.gz
Steps
§ Tar xvvzf speedtouch-1.2-beta1.tar.gz
§ Cd speedtouch-1.2-beta1
§ Make
§ Make install
Tar xvvzf speedtouchmmt.tar.gz
Now Go to
§ /etc/ppp/peers
§ create file adsl
Enter the following
§ Debug
§ Kdebug 1
§ Noipdefault
§ Defaultroute
§ Pty “/usr/local/bin/pppoa2 –vpi8 –vci35”
§ Nodetach
§ Sync
§ User ualexv@bellsouth.net
§ Noauth
§ Kdebug 7
§ Noaccomp
§ #no magic
§ noccp
§ #passive
§ #lcp –echo-interval 5
§ #lcp –echo-failure 30
§ #persist
Check the –vpi –vci at internet provider.
Now Go To
§ /etc/ppp/chap-secret
Create file in root home Dir
§ Startadsl
Enter the following
§ #!/bin/sh
§ /sbin/modprobe n_hdlc >&/tmp/pppd.log
§ /sbin/modprobe ppp_synctty >&/tmp/pppd.log
§ /usr/local/bin/modem_run –f/root/mgmt/mgmt.o –m
§ /usr/sbin/pppd calladsl >&/tmp/pppd.log
§ /sbin/route.add default pppo
§ chmod 777/root/startadsl
Now Go To
§ /etc/resolve.conf
and fill the dns-server
Now :
§ /startadsl
To stop
§ Create /root/stopadsl
Important References
http://linux-usb.sourceforge.net/SpeedTouch/howto.html
http://forums.devshed.com/archive/33/2003/04/2/39216
http://nvile.free.fr/speedtouch/
Using all the above codes and process didn’t prove to be successful. This finally didn’t work.
So next question was “ How can this work” Seemed to be not possible.
Next idea which came in mind was how can we use the Router DG814 to make this work.
But how can we make this Router work for our purpose? Using the router the web server would get the Static IP address and so a test web page can never be hosted. Afterall ISP is providing dynamic IP address. How can we use the dynamic IPaddress , use router and host a test Page!
Steps

Using the concept of port forwarding can make local computers or servers available to the Internet for different services.
To setup a computer or server to be accessible to the Internet for an Internet service:
By default, the gateway will perform Network Address Translation (NAT), allowing all the PCs on your network to share one public IP address.
After port forwarding Web Server is able to get dynamic IP address from the router.
So with the help of this concept I could host a test webpage to check if the web server works fine.
This concept proved successful using the dynamic IP address:http://216.78.162.239.
If we type the above IP address in the browser the Test webpage is displayed . So this proves that its working fine.
Running Windows Application on Red Hat 9.0
WINE
STEPS
Download the source/Rpm for WINE.
http://sourceforge.net/project/showfiles.php?group_id=6241&release_id=170629
Should be a root user when downloading this.
After downloading check if the file is successfully downloaded . check the number of bytes to verify .
Need to untar or unzip the downloaded file Wine-20030618.tar.gz
Go to the terminal window or console and type in the following to extract the downloaded file
tar zxvf Wine-20030618.tar.gz
This will extract the contents of the above file.
Become the superuser or root user
cd wine-20030618.tar.gz
make depend && make && make install
Change the user or come out of the superuser or root.
Open the terminal windows or console and type the following
export LD_ASSUME_KERNEL=2.2.5
This is the most important command , if we could not get this we could never have been able to use the WINE and would have been getting the error again and again.
wine notepad.exe
This should open up the notepad in the Red Hat 9 environment.
Followed the same steps to run the Application PC208W but whenever we try to run ,it starts fine but it then freezes up and doesn't move ahead.
Could be that this application is not compatible right now as WINE is still in progress to make different application work.
I am still in the progress to sort this problem .
WEB SERVER RUNNING -(07.15.03)
Got the Static IP from Bell South . Registered a new domain capece.net with Total Hosting. Used the Capability of IP Forwarding to run the Web Server.
Web Server is running fine now with a trial web page .
Domain : capece.net.
Registrar: totalhosting.com
Static IP : Bell South- Gainesville