chapter apache installation in linux- mandrake. acknowledgment the following information has been...

67
Chapter Apache Installation in Linux-Mandrake

Post on 21-Dec-2015

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Chapter

Apache Installation in Linux-Mandrake

Page 2: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Acknowledgment

• The following information has been obtained directly from www.mandrake.com

• All credit it due to the above

Page 3: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Linux

Unix Windows

Linux:Where Unix

meets Windows

GUI based approach to Apache installation.

Page 4: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Apache Configuration Using KDE

• In this section, Apache will be configured using the available tools and utilities of the KDE desktop. This is not necessarily a recommended way to run a web server, but it does offer a convenient environment to begin learning the first steps of running a web server in the safety of an internal LAN.

Page 5: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Checking for Already Installed Apache

Page 6: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Using ktail to Monitor Installation

• Alt-F2 will open a mini-command line in KDE, and kdesu -c ktail will launch ktail as the root user. Ktail will be used throughout the following pages to monitor Apache's log files during configuration

Page 7: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Launching ktail to Monitor the Installation

Alt F2 opens a mini command line

Page 8: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Providing root Password

Page 9: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Accessing the Service Activity

Page 10: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Activating the httpd Service

Page 11: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Starting Stopping and Restarting Apache

Page 12: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Monitoring Start, Stop

and Restart

Page 13: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Accessing the Web

Page 14: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Accessing the Web Server Using Localhost

Page 15: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Gain Access as Super

User to root

Page 16: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Root Folder(File)

Page 17: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Location of Apache Files

Page 18: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Bookmark the Location

Page 19: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Location of Web Files

Page 20: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Renamed Index.html

Page 21: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Loading Your Own Web

• A web can now be stored in this folder to become the website on the Apache server

• Index.html will be the first file that would be accessed first

Page 22: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

KDE File Manager as a Limited Web Browser

Page 23: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Accessing the Website from Other MachinesUse IP Address

Page 24: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Location of Logs

Page 25: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Drag and Drop Logs into ktail for Viewing

Page 26: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Other Details in Error Log

Page 27: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Event Details

• Date and time of event

• What type of event

• The event itself

Page 28: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Other Details in Access Log

Page 29: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Other Details on Access Log

• The machine's name or IP address that accessed the server

• Date and time of access• The file that was transferred • An access code and the number of bytes transferred • The server's name or IP address that was requested • The web browser that was used • And some info about the visitor's system

Page 30: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Location of conf Files

A copy has been made of the conf files folder

Page 31: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Making a Copy of the Conf Files

• /etc/httpd/conf is where Apache's configuration files are located. You may want to first make a backup copy of the original configuration directory before making edits to the enclosed files. Ctrl-t opens a konsole in the current directory, and cp -r conf confOrigBackup recursively copies the folder & contents with a new name.

Page 32: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Locating Apache’s Main httpd.conf

File

Page 33: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Editing httpd.conf

Using Kedit

Page 34: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Disabling Some Kedit Options Before Saving Changes to

httpd.conf

Page 35: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Section1: Modules

Page 36: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

A Note on Modules

• This first section of Apache's configuration file deals with modules. Modules add extra capabilities to Apache that aren't normally included in its basic set of features. If you install Mandrake's RPM modules for Apache you most likely won't ever need to manually enter any module information yourself, as the required entries will automatically be added with the packages.

• continued

Page 37: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

php3 Module: An Example

• mod_php3 is a module that enables this popular scripting language to be used with Apache. If mod_php3 is installed on your system, you can test it by creating a simple test page as seen on the next page

Page 38: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Creating index.php3 for

Testing of php3 Support

Page 39: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Testing for php3 Support

Page 40: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Success in Testing for php3

• You can test Apache by loading the page into Netscape. If php3 wasn't enabled properly, a screen of raw text would appear instead of a normal looking web page as seen here.

Page 41: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

A Note on Testing for php3

• This is just a quick way to demonstrate if php3 is enabled on a server. php3 is a full-featured, HTML-embedded scripting language used for creating dynamically generated web pages. One common use of php3 is as a replacement for CGI scripts. Unfortunately this topic can't be covered in detail on these pages. For more info on php3, phpbuilder is a good starting point.

Page 42: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Location of Web

Documents (Root)

Page 43: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Document Root

• The document root is where the web pages of the active website are kept– Similar to the home directory of the

www server in Windows

Page 44: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Display of Directory

Listing

Page 45: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Absence of index File

• A directory listing is displayed as shown in the previous slide in the absence of an index file

Page 46: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Activating Configuration Changes

• After every configuration change Apache must be restarted

• It is usually a good practice to make one change at a time and then check ktail to ensure that the change had been made without any errors before proceeding to make the next change

Page 47: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Starting, Stopping and Restarting Apache

• Commands– apachetl start, apachetl stop,

apachetl restart

• GUI– Apache may also be started, stopped

and restarted through the control services GUI• Access the httpd service for this purpose

Page 48: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Redirecting 404 and

Other Error Messages

Page 49: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Viewing of Serve

Status

Other IP addresses may be specified for

viewing of server status from other machines.

Page 50: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Display of Server

Status

From a different machine.

Page 51: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Server Type and

Port Numbers

Page 52: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Note on Server Type and Port Numbers

• Standalone is recommended for server type

• Information on port numbers can be found in /etc/services

• Users do not have to enter a port number on the address if default port numbers are maintained– Example is Port 80 used for www

service

Page 53: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Phantom User Nobody

• Apache runs as a phantom user known as nobody with very limited access

• Anyone exploiting this name to gain access to Apache will severely be restricted from causing any damage

Page 54: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Phantom User

Page 55: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Location of Apache

Configuration

Page 56: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Server Name

Page 57: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

A Note on Server Name

• Server name is the one seen by the browsers in the filed “location name”

• For hosting a name accessible over the Internet, the name must have been registered and it must have a DNS entry on a DNS sever

• Server name need not relate to the machine’s host name

Page 58: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Access to Local Host

Name

Page 59: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Adding a Host Name

Page 60: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

The New

Name

Page 61: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

A Note on Changing Name

• In general, changing host names should be avoided

• Certain services are configured based on the host name and they may not function properly after changing the name of the host

Page 62: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Permissions on

Folders

Page 63: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Access Given

to Folders

Permission given to others.

Page 64: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Right Clicking on Folders to

Give Permission

Page 65: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Changing Permissions

• Show entries and change into commands will give public to enter the folder and view its contents

Page 66: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Summary

• Windows users may still use some of the techniques learned to configure and operate Linux operations

• However, some command line programming is still inevitable

• In the long run, more GUI based operations is likely to be introduced in Linux

Page 67: Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from

Giving Permission

using the chmod

Command