Web Technology – Web Server Setup : Chris Uriarte ITI-520: Web Technology Web Server Setup Meeting 2: Apache Installation and Initial Configuration Rutgers.

Slides:



Advertisements
Similar presentations
Web Application Server Apache Tomcat Downloading and Deployment Guide.
Advertisements

1 Configuring Internet- related services (April 22, 2015) © Abdou Illia, Spring 2015.
20-753: Fundamentals of Web Programming 1 Lecture 11: Web Server Case Study Fundamentals of Web Programming Lecture 11: Web Server Case Study.
Chapter Apache Installation on Linux. Acknowledgement The contribution made by Darrin Morison is acknowledged.
Initial web server configuration 1WUCM1. Overview Planning Testing the OS/Environment – IP setup Installation Configuration – Simple minimum details Testing.
Apache Installation by Jack Davis. Web Servers The Apache HTTP Server is the most widely used web server on the Internet. Apache is fast, free, and full-featured.
1 Configuring Web services (Week 15, Monday 4/17/2006) © Abdou Illia, Spring 2006.
Apache Configuration Setting up a web server. Basic Server Facts Runs on port 80 Server application -> httpd Richly configurable Many defaults will let.
Chapter Apache Installation on Linux. Acknowledgement The contribution made by Darrin Morison is acknowledged.
Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from
Configuring a Web Server. Overview  Understand how a Web server works  Install IIS (Internet Information Services) and Apache Web servers  Examine.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 8: Implementing and Managing Printers.
CP476 Internet Computing Browser and Web Server 1 Web Browsers A client software program that allows you to access and view Web pages on the Internet –Examples.
Apache : Installation, Configuration, Basic Security Presented by, Sandeep K Thopucherela, ECE Department.
Installing Apache There are several ways to install the Apache web server – in CIT 370, you probably installed it from the CentOS CD-ROM although in fact,
Chapter 22 Web Hosting and Internet Servers Xuanxuan Su.
Hands-On Microsoft Windows Server 2008 Chapter 8 Managing Windows Server 2008 Network Services.
A crash course in njit’s Afs
Linux Operations and Administration
Microsoft Windows 2003 Server. Client/Server Environment Many client computers connect to a server.
Web Server Configuration Alokes Chattopadhyay Computer & Informatics Centre IIT Kharagpur.
The Linux Operating System Lecture 5: Apache Tonga Institute of Higher Education.
Linux Operations and Administration
Booting and boot levels
Web Servers Installation and Configuration May 24, 2001 CIS System Administration Problem Statement The class topic is setting up a Linux server to support.
Apache Server The Apache Server Apache is a WWW server that implements the HTTP protocol. Apache runs as a daemon. This means that it is a resident.
Web Servers1-1 Web Servers Xingquan (Hill) Zhu
An introduction to Apache. Different Types of Web Servers Apache is the default web server for may Unix servers. IIS is Microsoft’s default web server.
Apache, PHP, MySQL Installation and configuration Web Programming with PHP,TITAS PROJECTIICT,BUET.
5 Chapter Five Web Servers. 5 Chapter Objectives Learn about the Microsoft Personal Web Server Software Learn how to improve Web site performance Learn.
Web Services CSCI N321 – System and Network Administration Copyright © 2007,2008 by Scott Orr and the Trustees of Indiana University.
SUSE Linux Enterprise Desktop Administration Chapter 12 Administer Printing.
1 Apache. 2 Module - Apache ♦ Overview This module focuses on configuring and customizing Apache web server. Apache is a commonly used Hypertext Transfer.
Apache Web Server v. 2.2 Reference Manual Chapter 1 Compiling and Installing.
1 Apache and Virtual Sites and SSL Dorcas Muthoni.
Apache and... Virtual Hosts ---- aliases mod_rewrite ---- htaccess AFNOG 11 Kigali, Rwanda May 2010 Dorcas Muthoni Courtesy: Hervey Allen.
Database-Driven Web Sites, Second Edition1 Chapter 5 WEB SERVERS.
1 Week 6 The lynx browser Apache Web Server John Wang With materials courtesy of Inge Mclaurin.
Application Layer Khondaker Abdullah-Al-Mamun Lecturer, CSE Instructor, CNAP AUST.
Web Technology – Web Server Setup : Chris Uriarte ITI-520: Web Technology Web Server Setup Meeting 2: Apache Installation and Initial Configuration Rutgers.
Apache, MySQL and PHP Installation and Configuration Chapter 1 Apache Installation and Configuration.
Apache Web Server Administration Syed Iqbal Syed Iqbal.
ITI Chris Uriarte ITI-481: Unix Administration Meeting 2 Rutgers University Center for Applied Computer Technologies Chris Uriarte, Instructor.
1 Session 1: Introduction to PHP & MySQL iNET Academy Open Source Web Development.
What is a port The Ports Collection is essentially a set of Makefiles, patches, and description files placed in /usr/ports. The port includes instructions.
WAMP Windows Apache MySQL and PHP i.e. “WAMP”. Why WAMP? WampServer is a Windows web development environment. It allows you to create and test web pages.
Free Powerpoint Templates Page 1 Free Powerpoint Templates Users and Documents.
Web Technology – Web Server Setup : Chris Uriarte Meeting 4: Advanced Topics, Continued: Securing the Apache Server and Apache Performance Tuning Rutgers.
More than one site? Use multiple configuration files Use multiple configuration files  httpd –d {path}  Assumes “conf/httpd.conf” Logging transactions.
Linux Operations and Administration
Web Server Administration Chapter 6 Configuring a Web Server.
APACHE -By V.Gouthaman. The Apache HTTP Server, commonly referred to as Apache is web server software notable for playing a key role in the initial growth.
Presented by Lonnye Bower Fardin Khan Chris Orona APACHE WEB SERVER.
Web Technology – Web Server Setup : Chris Uriarte WMB-520: Web Technology Web Server Setup Meeting 2: Apache Installation and Initial Configuration Rutgers.
Institute for Visualization and Perception Research 1 © Copyright 1998 Haim Levkowitz Setting up a Web server Setting up basic services... Web server maintenance...
INTERNET APPLICATIONS CPIT405 Install a web server and analyze packets.
LINUXCHIX WEBMAIL. Software run by an ISP or online service that provides access to send, receive, and review using only your Web browser. Users.
Multi-Domain Hosting CPTE 212 “Missing Slides” for 1/22/2015 John Beckett.
Web Server Administration Chapter 6 Configuring a Web Server.
Apache Web Server v. 2.2 Reference Manual Chapter 2 Starting Apache.
APACHE Apache is generally recognized as the world's most popular Web server (HTTP server). Originally designed for Unix servers, the Apache Web server.
9/21/04 James Gallagher Server Installation and Testing: Hands-on ● Install the CGI server with the HDF and FreeForm handlers ● Link data so the server.
Web and Proxy Server.
Unix System Administration
DHCP server & Client Objectives Contents
Introduction to Programming the WWW I
INSTALLING AND SETTING UP APACHE2 IN A LINUX ENVIRONMENT
Configuring Internet-related services
LING 408/508: Computational Techniques for Linguists
APACHE WEB SERVER.
Presentation transcript:

Web Technology – Web Server Setup : Chris Uriarte ITI-520: Web Technology Web Server Setup Meeting 2: Apache Installation and Initial Configuration Rutgers University Internet Institute Instructor: Chris Uriarte

Web Technology – Web Server Setup : Chris Uriarte Apache The world’s leading web server software (powers 61% of all web servers in the world) Runs on UNIX and Windows platforms. UNIX version is the most stable and most widely used. Configuration is the same on all UNIX platforms.

Web Technology – Web Server Setup : Chris Uriarte How Do I Get Apache? The Current release of Apache Released October You can download it from the Apache Website: –Binary Versions – software that is ready-to-use for your specific operating system platform –Source Code – the computer code used to build Apache. You must use a compiler to build the code. You can buy a Unix distribution that comes bundled with Apache pre-built (most Linux distributions include Apache by default).

Web Technology – Web Server Setup : Chris Uriarte Installing Apache from Source Allows you to build the Apache binaries from scratch. Optimizes Apache for the platform on which it will run. Allows you to decide whether to build Apache as a static or a dynamic server. Allows you to decide what modules you want to include. You need a C compiler (i.e. gcc) to install source, which is included in most UNIX distributions.

Web Technology – Web Server Setup : Chris Uriarte Apache Modules Apache has a modular structure. Only a core set of features exists within the main Apache executable. Apache Modules provide additional functionality Example Module: mod_speling: The Speling module attempts to correct misspellings of URLs that users might have entered, namely by checking capitalization or by allowing up to one misspelling (character insertion, omission, transposition, typo).

Web Technology – Web Server Setup : Chris Uriarte Apache: Static vs. Dynamic Servers Static Servers –Must decide at build time what modules to include. Recompiling will be necessary to add modules later. Dynamic Servers –Uses mod_so to load modules dynamically when Apache server is started. –New modules can usually be added later without recompiling.

Web Technology – Web Server Setup : Chris Uriarte Installing Apache Source Create a directory under your iti.rutgers.edu home directory called “apache” –mkdir apache You now need to obtain the Apache source file (which you’d usually do from You can copy the source that is contained locally on the iti.rutgers.edu server: –cd apache –cp ~chrisjur/apache_ tar.gz. You should now have the Apache source file under your home directory in /home/itiXXXX/apache.

Web Technology – Web Server Setup : Chris Uriarte Unzipping and Untar’ing the Source File You now have the Apache source distribution under your home directory in /home/itiXXXX/apache. The source file is actually a group of tar’ed files and directories, which is then zipped using the gzip utility. You can untar and unzip the source distribution by issuing: –tar –xvzf apache_ tar.gz

Web Technology – Web Server Setup : Chris Uriarte Unzipping and Untar’ing the Source File – con’t. Unpacking the distribution file will create another directory under /home/itiXXXX/apache called “apache_1.3.12” (/home/itiXXXX/apache/apache_1.3.12). “cd” to the apache_ to view the files and directories that are included in the distribution.

Web Technology – Web Server Setup : Chris Uriarte Sample Directory Listing from Source Distribution iti% cd apache_ iti% ls ABOUT_APACHE LICENSE README.NT conf htdocs Announcement Makefile README.configure config.layout icons INSTALL Makefile.tmpl WARNING-NT.TXT config.status logs KEYS README cgi-bin configure src iti% ls -al total 272 drwx chrisjur users 4096 Oct 15 20:21. drwx chrisjur users 4096 Oct 15 21:10.. -rw chrisjur users Mar ABOUT_APACHE -rw chrisjur users 2922 Feb Announcement -rw chrisjur users Dec INSTALL -rw chrisjur users Aug KEYS -rw chrisjur users 2848 Jan LICENSE -rw chrisjur users Oct 15 20:20 Makefile -rw chrisjur users Jan Makefile.tmpl -rw chrisjur users 2046 Apr README -rw chrisjur users 3132 Mar README.NT -rw chrisjur users Dec README.configure -rw chrisjur users 331 Sep WARNING-NT.TXT drwx chrisjur users 4096 Feb cgi-bin drwx chrisjur users 4096 Feb conf -rw chrisjur users 5909 Dec config.layout -rwx--x--x 1 chrisjur users 312 Oct 15 20:20 config.status -rwx chrisjur users Feb configure drwx chrisjur users 4096 Feb htdocs drwx chrisjur users 4096 Feb icons drwx chrisjur users 4096 Feb logs drwx chrisjur users 4096 Oct 15 20:21 src

Web Technology – Web Server Setup : Chris Uriarte Apache Installation: Step 1 Before actually building the Apache binaries, you must run a configure utility, which inspects your system and prepares the distribution for compiling. The configure script is located in the directory that was created when you unpacked the Apache source distribution (i.e. /home/itiXXX/apache/apache_1.3.12)

Web Technology – Web Server Setup : Chris Uriarte Apache Installation: Step 1 con’t. Run the configure script like this:./configure --prefix=/home/itiXXX/apache The “prefix” flag tells Apache where you actually want to install the software and configuration files. It also builds the Apache software so it knows where to look for configuration files

Web Technology – Web Server Setup : Chris Uriarte Apache Installation: Step 2 After the configure script runs successfully, you now need to compile the software code into the actual binaries. You can start the compile by issuing the make command in the Apache distribution directory, i.e: –cd /home/itiXXX/apache/apache_ –make The compile process will take 2-10 minutes, depend

Web Technology – Web Server Setup : Chris Uriarte Apache Installation: Step 3 When the compile is complete, you can install the software and configuration files by issuing the make install command. This will copy the built binaries and configuration files into the /home/itiXXXX/apache directory you specified when you ran the configuration script. We will now refer to this directory as the Server Root directory.

Web Technology – Web Server Setup : Chris Uriarte The Server Root Directory Examine the contents of the Server Root directory. You now have a group of directories Apache uses: –bin: the location of the actual apache program and other utilities –conf: location of the configuration files –htdocs: the directory where web pages and and associated files are kept –logs: where apache keeps log files –man: UNIX man pages for apache –cgi-bin: the directory where CGI scripts are kept

Web Technology – Web Server Setup : Chris Uriarte Apache and Privileged Ports Any TCP/IP port >1024 is considered a privileged port. Privileged Ports can only be accessed by applications started by the root user. Therefore, since you are not the root user on this system, you must configure Apache to use a port >1024.

Web Technology – Web Server Setup : Chris Uriarte Quickstart: Change the Port Number your Apache Server Uses “cd” to the Apache conf directory (/home/itiXXX/apache/conf) Use a text editory to open the httpd.conf file, which is the main Apache configuratio file. Find the line that says “Port XX”. Your file may say “Port 8080” or some other number.

Web Technology – Web Server Setup : Chris Uriarte Change your Apache Port, con’t. Replace the number next to the “Port” directive to a number that corresponds to you. Use the numeric portion of your iti.rutgers.edu username. For example, if your username is iti2345, use port 2345 as your port number. Exit your editor and save the file.

Web Technology – Web Server Setup : Chris Uriarte Getting Ready to Run Apache for the First Time… Apache is configured to look for web documents in the htdocs directory under the server root (/home/itiXXX/apache/htdocs). Be default, a page called “index.html” is the first page of a the website returned to clients. Examine the index.html file in your htdocs directory.

Web Technology – Web Server Setup : Chris Uriarte Starting Apache: The “Hard” Way The actual Apache binary is called httpd and it resides in the Apache bin directory. You can start Apache by simply executing the httpd command –cd apache/bin –./httpd Apache is now started!

Web Technology – Web Server Setup : Chris Uriarte Verify that Your Instance of Apache is Working Point a web browser to You should see a default Apache web page appear (the contents of the htdocs/index.html document we looked at earlier)

Web Technology – Web Server Setup : Chris Uriarte Stopping Apache: The “Hard” Way Remember, every time you execute a program on a UNIX operating system, a process is created You can kill processes by using the kill command You can kill Apache by issuing the following commend: –kill –TERM `cat /home/itiXXXX/apache/logs/httpd.pid`

Web Technology – Web Server Setup : Chris Uriarte Starting and Stopping Apache: The “Easy” Way with apachectl A script called apachectl is included in the apache/bin directory. You can use apachectl to start, stop and restart the Apache server – very simple to use: –cd /home/itiXXXX/apache/bin/ –./apachectl {start|stop|restart}

Web Technology – Web Server Setup : Chris Uriarte Apache Startup, con’t. Common practice to start apache at boot time with rc scripts located in /etc/rc.d. Typical name and location for Apache rc script: /etc/rc.d/init.d/httpd on Linux systems. Symbolic links set for various run levels. The commands used to start Apache are usually placed in the /etc/rc.local startup file on BSD systems Solaris systems usually place a startup script in the /etc/rc2.d or /etc/rc3.d directories. The root user must add Apache startup commands to the startup scripts on the system.

Web Technology – Web Server Setup : Chris Uriarte Apache Configuration Files Configuration files are placed in the conf/ directory and include: –httpd.conf – master configuration file –access.conf and srm.conf – no longer used Since version 1.3.4, all you configuration is done in the httpd.conf file – the srm.conf and access.conf files are no longer needed. Apache needs to know location of httpd.conf file to start. If httpd.conf needs to move after initial install need to specify location with –f option when starting server. –httpd –f /path/to/httpd/.conf

Web Technology – Web Server Setup : Chris Uriarte httpd.conf: IP address and Port The BindAddress and Port directives in the httpd.conf tell Apache which IP addresses and ports to listen on. Usage: Tells Apache to use the default IP address for this system: BindAddress * Tells Apache to “listen” for web requests on Port 80: Port 80

Web Technology – Web Server Setup : Chris Uriarte Tell Apache to Listen To Additional Ports and IP addresses The Listen directive in the httpd.conf tells Apache to listen to additional Ports and/or Port/IP address combinations. Usage: Listen or Listen : These IP/Ports are used in addition to the IP and Port specified in the BindAddress and Port directive described earlier.

Web Technology – Web Server Setup : Chris Uriarte httpd.conf: Basic Configuration Directives ServerName iti.rutgers.edu – The name of this server we use to respond to web clients with. If the server does not have a real internet name, use the IP address instead. ServerType standalone - We always set this to standalone.

Web Technology – Web Server Setup : Chris Uriarte httpd.conf: Basic Configuration Directives User nobody, Group nobody - For security reasons, we usually run Apache assumes the identity of a non-root user and group on the system. A lot of times we run Apache as the nobody user/group. ServerAdmin - A contact address to report problems – returned to the web client when an error occurs.

Web Technology – Web Server Setup : Chris Uriarte httpd.conf: Basic Configuration ServerRoot /home/itiXXXX/apache - Where Apache keeps all its essential files. DocumentRoot /usr/local/apache/htdocs - Where the actual Web pages reside. ErrorLog /home/itiXXXX/apache/logs/error_log – The location of the Apache error log PidFile /home/itiXXXX/apache/logs/httpd.pid - Process id for the Apache parent process. Used with the kill command to stop Apache.

Web Technology – Web Server Setup : Chris Uriarte httpd.conf: Virtual Directories Sometime you want to create a Virtual Directory, where a document directory may not exist under your htdocs directory, but you want web clients to have access to it. This is configured using the Alias directive in the httpd.conf, usage: Alias

Web Technology – Web Server Setup : Chris Uriarte Virtual Directories, con’t. For example, if your Document Root is the default htdocs directory and you want web client to access a directory that contains Icons (/home/itiXXXX/apache/icons), you can create a Virtual Virtual Directory called myicons like this: Alias /myicons /home/itiXXXX/apache/icons Now web clients can access this virtual directory by going to to view the files in the icons directory.

Web Technology – Web Server Setup : Chris Uriarte httpd.conf: Redirects The Redirect directive allows web clients to access a URL on your system and be re-directed to a remote URL somewhere else. Usage: Redirect /localpath Example: Redirect /photos Redirects all request to to Useful when you move portions of a webpage

Web Technology – Web Server Setup : Chris Uriarte Giving Web Access to Users on the System Individual users on your system may wan the ability to post web content. The UserDir Apache directive, allows each user on the system to create an special directory used to contain web content. Usage: UserDir public_html Now system users can place all of their web documents in a directory called public_html under their home directory. These documents can be accessed via the URL

Web Technology – Web Server Setup : Chris Uriarte Access Control Files Per directory configuration files can be used to supplement or override settings set on the server level. Most commonly used to password-protect a directory. Allows for “on-the-fly” changes. No need to restart the server. Generally referred to as.htaccess files even though the actual name of the file can be set in httpd.conf: AccessFileName.htaccess

Web Technology – Web Server Setup : Chris Uriarte Access Restrictions by Location Access to directory contents can be granted or denied by IP address, network, hostname or name. order deny,allow deny from all allow from rutgers.edu iti.rutgers.edu Best to control access by IP address rather than hostname to avoid require DNS lookups for every attempted connection. You can place these blocks access control blocks in the httpd.conf file or in an.htaccess file.

Web Technology – Web Server Setup : Chris Uriarte The Index File When a web browser points to a directory, rather than a particular file (e.g. vs. Apache looks for an index file, which is the default web page for a particular directory. You can specify the name of acceptable index files by using the DirectoryIndex directive in the httpd.conf file. Usage: DirectoryIndex filename filename… Apache will look for the index file names specified when a request is made to a directory.

Web Technology – Web Server Setup : Chris Uriarte Indexing What happens if you type a URL into a browser that points to a directory rather than a specific file? –Will load the index file if directory includes any of the files specified with DirectoryIndex in httpd.conf: DirectoryIndex index.html index.htm If no index file exists and indexing has been enabled, will get a directory listing. If no index file exists and indexing has been disabled, will get an error message. Advisable to leave indexing disabled for security reasons unless there is a specific need for it.

Web Technology – Web Server Setup : Chris Uriarte Indexing, con’t. To enable indexing in httpd.conf: Options Indexes Fancy indexing generates listing that includes representative icon, name, last modified, size, and description: IndexOptions FancyIndexing Indexing requires module mod_autoindex, which is installed by default.

Web Technology – Web Server Setup : Chris Uriarte Access Control Files, con’t. Level of overrides allowed should also be set in httpd.conf: AllowOverride None|All|Options|Indexes| FileInfo|AuthConfig|Limit Default is “All”. Access control file is placed in root of directory for which configuration is being modified.

Web Technology – Web Server Setup : Chris Uriarte Downloading a Binary Distribution The Apache Foundation has pre-built binary distributions that are built for specific operating systems. You can download binary distributions at –Look for the folder that contains your operating system –Download the current version. The file has a name similar to this: apache_ i686-whatever- linux2.tar.gz apache_ i686-whatever- linux2.tar.gz

Web Technology – Web Server Setup : Chris Uriarte Sample Linux Apache Installation with RPM Download apache-.i386.rpm from ftp://ftp.redhat.com/pub/redhat/current/i386/R edHat/RPMS or from one of Red Hat mirrors. ftp://ftp.redhat.com/pub/redhat/current/i386/R edHat/RPMS In download directory type: –rpm -ivh apache i386.rpm Apache is included with most Linux distributions (RedHat, Mandrake, SuSE, etc.) and can be selected for inclusion during installation

Web Technology – Web Server Setup : Chris Uriarte Linus RPM Install of Apache: What’s Installed and Where /usr/sbin/httpd - Apache binary /etc/httpd/conf - Apache configuration files /var/log/httpd - Apache log files /home/httpd - Website content files /usr/lib/apache - Apache modules /etc/rc.d/init.d/httpd - Script to start Apache automatically at boot time. To see full list of installed files type: rpm --query - l apache

Web Technology – Web Server Setup : Chris Uriarte Graphical Tools for Managing Apache Apache Only Graphical Tools –Comanche –TkApache –ServerConfig/2 General Graphical Tools that Support Apache –Linuxconf (comes with Red Hat Linux) –Webmin Download information available at

Web Technology – Web Server Setup : Chris Uriarte Commanche – GUI install Commanche available at nload.html nload.html Demo…