TPR5: Custom Configurations Steve Lewis, Web Manager, SUNY Brockport TPR5: Custom Configurations: Unlock the Power of Apache Steven Lewis Web Manager SUNY.

Slides:



Advertisements
Similar presentations
METALOGIC s o f t w a r e © Metalogic Software Corporation DACS Developer Overview DACS – the Distributed Access Control System.
Advertisements

DT211/3 Internet Application Development Active Server Pages & IIS Web server.
Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from
Report Distribution Report Distribution in PeopleTools 8.4 Doug Ostler & Eric Knapp 7264.
Website Development with PHP and MySQL Introduction.
How Clients and Servers Work Together. Objectives Learn about the interaction of clients and servers Explore the features and functions of Web servers.
Apache : Installation, Configuration, Basic Security Presented by, Sandeep K Thopucherela, ECE Department.
 Proxy Servers are software that act as intermediaries between client and servers on the Internet.  They help users on private networks get information.
APACHE SERVER By Innovationframes.com »
Linux Operations and Administration
Web Server Configuration Alokes Chattopadhyay Computer & Informatics Centre IIT Kharagpur.
OM. Brad Gall Senior Consultant
 2000 Deitel & Associates, Inc. All rights reserved. Chapter 24 – Web Servers (PWS, IIS, Apache, Jigsaw) Outline 24.1Introduction 24.2Microsoft Personal.
Web Servers Web server software is a product that works with the operating system The server computer can run more than one software product such as .
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Configuring a Web Server. Overview Overview of IIS Preparing for an IIS Installation Installing IIS Configuring a Web Site Administering IIS Troubleshooting.
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.
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.
Copyright (c) 2010, Dr. Kuanchin Chen1 The Client-Server Architecture of the WWW Dr. Kuanchin Chen.
Introduction to Internet Programming (Web Based Application)
Nic Shulver, Intro: Developing Server Applications What is a server? Many types of server – File server – file: networked file.
Troubleshooting Windows Vista Security Chapter 4.
Security Testing Case Study 360logica Software Testing Services.
1 In the good old days... Years ago… the WWW was made up of (mostly) static documents. –Each URL corresponded to a single file stored on some hard disk.
Set 13: Web Servers (configuration and security) (Chapter 21) IT452 Advanced Web and Internet Systems.
Apache and... Virtual Hosts ---- aliases mod_rewrite ---- htaccess AFNOG 11 Kigali, Rwanda May 2010 Dorcas Muthoni Courtesy: Hervey Allen.
ASP Introduction Y.-H. Chen International College Ming-Chuan University Fall, 2004.
COMP3121 E-Commerce Technologies Richard Henson University of Worcester November 2011.
Website Design Lecture 1. Outline Introduction to the module Outline of the Assessment Schedule Lecture Static XHTML, client side and server side Why.
SSL, Single Sign On, and External Authentication Presented By Jeff Kelley April 12, 2005.
Phone: Mega AS Consulting Ltd © 2007  CAT – the problem & the solution  Using the CAT - Administrator  Mega.
ColdFusion Security Michael Smith President TeraTech, Inc ColdFusion, Database & VB custom development
Lecture Note 1: Getting Started With ASP.  Introduction to ASP  Introduction to ASP An ASP file can contain text, HTML tags and scripts. Scripts in.
Apache Security Travis Jeffries. Introduction Authentication and Authorization Strict Access Methods Defending against Attacks Bad CGI Programs Apache.
Securing Internet Access Designing an Internet Acceptable Use Policy Securing Access to the Internet by Private Network Users Restricting Access to Content.
Hands-On Microsoft Windows Server Implementing Microsoft Internet Information Services Microsoft Internet Information Services (IIS) –Software included.
Web Design (1) Terminology. Coding ‘languages’ (1) HTML - Hypertext Markup Language - describes the content of a web page CSS - Cascading Style Sheets.
Cosc 4750 Configuring httpd, Mysql, And Samba. defaults By default httpd demean will startup and work User directories are turned off Default directory.
CSU - DEO Introduction to CGI - Fort Collins, CO Copyright © XTR Systems, LLC Introduction to the Common Gateway Interface (CGI) Instructor: Joseph DiVerdi,
Securing Sensitive Information Data Security Dashboards often contain the most important data in the company Securing that information makes business.
1 Apache and... Virtual Hosts ---- aliases mod_rewrite ---- htaccess AFNOG X Cairo, Egypt May 2009 Hervey Allen.
1 Session 1: Introduction to PHP & MySQL iNET Academy Open Source Web Development.
 Registry itself is easy and straightforward in implementation  The objects of registry are actually complicated to store and manage  Objects of Registry.
Intermediate CGI & CGI.pm Webmaster II - Fort Collins, CO Copyright © XTR Systems, LLC CGI Programming & The CGI.pm Perl Module Instructor: Joseph DiVerdi,
ASP. What is ASP? ASP stands for Active Server Pages ASP is a Microsoft Technology ASP is a program that runs inside IIS IIS stands for Internet Information.
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
ECMM6018 Enterprise Networking for Electronic Commerce Tutorial 7
Intro to Datazen.
1 Chapter Overview Creating Web Sites and FTP Sites Creating Virtual Directories Managing Site Security Troubleshooting IIS.
Web Technology – Web Server Setup : Chris Uriarte Meeting 4: Advanced Topics, Continued: Securing the Apache Server and Apache Performance Tuning Rutgers.
Unit 1 – Web Concepts Instructor: Brent Presley.
Web Server Administration Chapter 6 Configuring a Web Server.
(ITI310) By Eng. BASSEM ALSAID SESSIONS 10: Internet Information Services (IIS)
COSC 2328 – Web Programming.  PHP is a server scripting language  It’s widely-used and free  It’s an alternative to Microsoft’s ASP and Ruby  PHP.
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
Business Objects XIr2 Windows NT Authentication Single Sign-on 18 August 2006.
Web Server Administration Chapter 6 Configuring a Web Server.
University of Kansas Department of Electrical Engineering and Computer Science Dr. Susan Gauch April 21, 2005 I T T C Introduction to Web Technologies.
Server Performance, Scaling, Reliability and Configuration Norman White.
Authentication & Authorisation Is the user allowed to access the site?
ArcGIS for Server Security: Advanced
Introduction to Internet Programming (Web Based Application)
Intro to WordPress (Using XAMPP)
Apache and... Virtual Hosts ---- aliases mod_rewrite ---- htaccess
Authentication & .htaccess
Unix System Administration
Jerrell Jackson
PHP / MySQL Introduction
Database Driven Websites
Securing web applications Externally
Presentation transcript:

TPR5: Custom Configurations Steve Lewis, Web Manager, SUNY Brockport TPR5: Custom Configurations: Unlock the Power of Apache Steven Lewis Web Manager SUNY Brockport

TPR5: Custom Configurations Steve Lewis, Web Manager, SUNY Brockport Problem #1: Migrate from IIS to Apache without Losing ASP Inherited IIS from previous Webmaster Crashes, Viruses Unfamiliar Challenge: Case Awareness v. Case Sensitivity Major Obstacle: Installed Base of ASP Apps

TPR5: Custom Configurations Steve Lewis, Web Manager, SUNY Brockport Solution: Build new Solaris/Apache server Keep identical URLs Same account/FTP access method Keep NT server until ASP apps are moved (renamed to nt.web.brockport.edu) Proxy ASP requests to existing IIS server Time to migrate ASP apps to new infrastructure mod_speling [sic]

TPR5: Custom Configurations Steve Lewis, Web Manager, SUNY Brockport Code: httpd.conf: RewriteRule ^(.*\.[Aa][Ss][Pp])$  [P] CheckSpelling On

TPR5: Custom Configurations Steve Lewis, Web Manager, SUNY Brockport Notes on Security IIS machine can deny all requests not coming from new Web server  Limits attack vectors to.asp requests  Reduced machine load; Improves stability (Please note: author does not recommend running IIS under any circumstances, and assumes no responsibility for any consequences of your software decisions.)

TPR5: Custom Configurations Steve Lewis, Web Manager, SUNY Brockport Problem #2: Security for Administrative Functions or Internal Information over the Web https is set up as a mirror of http Certain tasks or information demand extra security  Passwords, Home Addresses, etc. No robust institution-wide internal document repository Need to restrict certain folders to https-only

TPR5: Custom Configurations Steve Lewis, Web Manager, SUNY Brockport Solution: Develop standard naming convention for Web app administrative functions  …/admin/… Place internal information and documents within one folder  /internal/… Add password restrictions to limit access

TPR5: Custom Configurations Steve Lewis, Web Manager, SUNY Brockport Code: httpd.conf: # admin only RewriteCond %{SERVER_PORT} ^80$ RewriteRule ^(.*/admin/.*)$  [R] # admin and internal RewriteCond %{SERVER_PORT} ^80$ RewriteRule  ^((.*/admin/.*)|(/internal.*))$  [R]

TPR5: Custom Configurations Steve Lewis, Web Manager, SUNY Brockport Problem 3: Too Many Passwords, No LDAP Using old system, no LDAP in place Need a source of passwords people will remember Debugging scenarios/special cases (e.g. Emeriti)

TPR5: Custom Configurations Steve Lewis, Web Manager, SUNY Brockport Solution: Mod_auth_external: run an arbitrary program to do authentication Write a Perl script to make a POP connection to server Write a program to do any check conceivable Works with any Web page – httpd authentication

TPR5: Custom Configurations Steve Lewis, Web Manager, SUNY Brockport Code: httpd.conf: AddExternalAuth brockport-pop  /web/auth/po-pop SetExternalAuthMethod brockport-pop pipe

TPR5: Custom Configurations Steve Lewis, Web Manager, SUNY Brockport More Code:.htaccess: AuthType Basic AuthName "SUNY Brockport NetID Login" AuthExternal brockport-pop # do authorization in-program/any user OK Require valid-user # limit to these two users only # Require user slewis jdoe

TPR5: Custom Configurations Steve Lewis, Web Manager, SUNY Brockport Still More Code: #!/usr/local/bin/perl use strict; use IO::Socket; # Grab username and password as passed by STDIN my $USER = <>; my $PASSWORD = <>; chomp $USER; chomp $PASSWORD; ## network connection ## or database query ## or anything else...

TPR5: Custom Configurations Steve Lewis, Web Manager, SUNY Brockport Problem 4: Preview/Test New SSI Templates Before Rollout No Content Management System Use SSI templates for common code Need to test/debug template upgrade for 10,000s of pages Make changes to smooth transition

TPR5: Custom Configurations Steve Lewis, Web Manager, SUNY Brockport Solution: Open new server port for test (e.g. 8080) Use same configuration, files as site Change only template folder with SSI data, so: and are the only differences.

TPR5: Custom Configurations Steve Lewis, Web Manager, SUNY Brockport Code: httpd.conf: #... Alias /templates/ /web/live/wwwroot/templates2/

TPR5: Custom Configurations Steve Lewis, Web Manager, SUNY Brockport Lots of Problems Problem 5: Bad Links to First Web Server Problem 6: CGI Web Page Counter Upgrade Problem 7: Web Reports’ HTML Code Like SSI – Produces Errors Problem 8: No Copyright Notice in Pages Problem 9: Adding CSS for SSI Template Upgrade

TPR5: Custom Configurations Steve Lewis, Web Manager, SUNY Brockport Common Solution: Dynamic Recoding of Pages Requires: Perl, mod_perl, Apache::Filter Perl module

TPR5: Custom Configurations Steve Lewis, Web Manager, SUNY Brockport Solution Code to Problem 5: # change server references in HTML to www only: s{ { s{ {

TPR5: Custom Configurations Steve Lewis, Web Manager, SUNY Brockport Solution Code to Problem 6: # change counter programs while ( m|/counter/counts40\.exe?([^"]+)"|i ) { #parameters of new counter my ($STYLE, $LINK, $PARAM) =("A","sample.dat",$1); my $URL = '/cgi-bin/counter/counter.cgi'; if ( $PARAM =~ m!style=([^"'|&]*)!i ) { $STYLE = $1; } if ( $PARAM =~ m!link=([^"'|&]*)!i ) { $LINK = $1; } s{/counter/counts40\.exe?([^"]+)"} {$URL?ft=0&pad=N&df=$LINK&dd=$STYLE"}i; }

TPR5: Custom Configurations Steve Lewis, Web Manager, SUNY Brockport Solution Code to Problem 7: # certain HTML comments looked like SSI -- delete if ( $ENV{ 'REQUEST_URI' } =~ m|^/its/web/reports/(\D+/)?\d+/| ) { s| ||; }

TPR5: Custom Configurations Steve Lewis, Web Manager, SUNY Brockport Solution Code to Problem 8: # after loop through file content: # print copyright notice in HTML comment print " \n";

TPR5: Custom Configurations Steve Lewis, Web Manager, SUNY Brockport Solution Code to Problem 9: my $cssdone = 0; # allow bypass mechanism if ( exists $ENV{SBT_VERSION} and $ENV{SBT_VERSION} == 2 ) { $cssdone = 1; } my $REPLACE = qq| <link href="/templates/css/print.css" rel="stylesheet" type="text/css" media=" print" /> |;

TPR5: Custom Configurations Steve Lewis, Web Manager, SUNY Brockport Problem 9 cont: while ( ) { if ( $cssdone ) { #s|(href="? print; } elsif ( m|/templates/css/| ) { $cssdone = 1; print; } else { if ( s| |$REPLACE|i ) { $cssdone = 1; } print; }

TPR5: Custom Configurations Steve Lewis, Web Manager, SUNY Brockport Problem 10: Activate PHP… but not for Everyone PHP is a server-wide technology  You either have it or not PHP is a programming language  Security risk by definition Installation without safeguards can expose server to problems Desire to use same server (ASP solution not viable)

TPR5: Custom Configurations Steve Lewis, Web Manager, SUNY Brockport Solution #1: Hard-code directories in httpd.conf Constant changes, increases in PHP use Server resets to take effect

TPR5: Custom Configurations Steve Lewis, Web Manager, SUNY Brockport Solution #2: Use an environment variable in.htaccess files Directory-level control of.htaccess  no better than wide open Did not resolve in time to work

TPR5: Custom Configurations Steve Lewis, Web Manager, SUNY Brockport Solution #3: Create a controlled file-system “hack” to enable PHP Careful use of a specialized directory prevents bypassing Configurable on-the-fly  Server stays online Invisible to the public

TPR5: Custom Configurations Steve Lewis, Web Manager, SUNY Brockport Requirements and Code: Requires: mod_rewrite, mod_php, UNIX/LINUX file system RewriteRule ^(.*\.php)$ /php-bin$1 [PT]

TPR5: Custom Configurations Steve Lewis, Web Manager, SUNY Brockport How does it work? User requests /admissions/openhouse/register.php Will work if:  /php-bin/admissions/openhouse/register.php is the real PHP file  /php-bin/admissions/openhouse/register.php is a symbolic link to the PHP file  /php-bin/admissions/openhouse/ is a symbolic link to /admissions/openhouse *  /php-bin/admissions/ is a symbolic link to /admissions/ * User requesting /php-bin/* will not work unless you want it to. It redirects internally to /php-bin/php-bin/ * = presumes PHP file resides as “advertised”

TPR5: Custom Configurations Steve Lewis, Web Manager, SUNY Brockport Where to get software discussed: Apache Web Server: PHP: Mod_ssl: Mod_auth_external: Perl: Mod_perl: Apache::Filter: Filter-1.024/ Filter-1.024/