Introduction
This site demonstrates different models for executing server-side code to generate dynamic web content. Each approach has different trade-offs in performance, complexity, and portability.
Server-Side Execution Models - Visual guide explaining the architectural differences between Fork/Exec, Server-Side Scripting, Embedded Native, and Code as Server approaches.
Fork/Exec (CGI)
Traditional Common Gateway Interface programs that run as separate processes spawned by the web server. For each request, the server forks and executes the script.
Perl
Python
Ruby
Node.js
Apache spawns a new Node.js process for each request. Sessions use file-based storage (/tmp). Simple but has process spawn overhead.
Server-Side Scripting
Server-side scripting embeds code directly in HTML pages, processed by the web server before sending to the client. The interpreter runs inside the server process (no fork-exec overhead).
SSI (Server Side Includes)
The oldest server-side technology (mid-1990s). Simple directives embedded in HTML for includes, variables, and basic conditionals. Limited but lightweight.
- SSI Demo - Includes, variables, conditionals
PHP
The most widely-used server-side scripting language. Runs as an Apache module (mod_php) for better performance than CGI. Powers WordPress, Wikipedia, and much of the web.
Other Technologies (Reference Only)
These historical server-side scripting technologies shaped web development but require specific server environments not available here. Static reference pages with code examples are provided.
- Classic ASP - Microsoft's original server-side scripting (1996), uses VBScript/JScript with IIS
- ColdFusion - Allaire/Macromedia/Adobe tag-based language (1995), pioneered rapid web development
- JSP - JavaServer Pages (1999), enterprise Java web development with servlet compilation
- ASP.NET - Microsoft's .NET web framework (2002), evolved from Web Forms to modern Core
Embedded Native (Apache Modules)
Custom code compiled directly into the web server as native modules. The code runs as part of the server process with full access to server internals. Maximum performance but requires recompilation for changes.
- Hello, World! - Simple response demo
- Environment Variables - Request/environment info display
- Form Handler - GET and POST form processing
Code as Server
The application runs its own HTTP server as a persistent process. Apache acts as a reverse proxy, forwarding requests to the application server. This is the dominant model for modern web applications.
Node.js (Express)
A persistent Express.js server runs continuously on port 3000. Sessions use in-memory storage (faster, but lost on restart). This is how Node.js is typically deployed in production.
Python (Flask)
A persistent Flask server runs continuously on port 5000. Sessions use in-memory storage. Flask is a popular micro-framework; larger projects might use Django or FastAPI.
Perl (Mojolicious)
A persistent Mojolicious server runs continuously on port 8080. Sessions use signed cookies. Mojolicious is a modern Perl web framework; alternatives include Dancer and Catalyst.
State Management
HTTP is stateless - each request is independent. Web applications need mechanisms to maintain state across requests for user sessions, shopping carts, and personalization.
State Management Overview - Comprehensive guide to maintaining state in stateless HTTP.
Core Mechanisms
- URL Parameters - Pass state in query strings and path segments
- Cookies - Browser-stored key-value pairs sent with each request
- Server Sessions - Server-side storage with session ID cookie
- Client Storage - localStorage and sessionStorage APIs
Advanced Topics
- Hidden Form Fields - Embed state in forms (ViewState pattern)
- JWT Tokens - Stateless authentication with signed tokens
- Security Patterns - CSRF protection, secure cookies, and best practices
PHP Overview
PHP is the most widely-used server-side scripting language, powering over 75% of websites with known server-side technology. It runs as an Apache module for optimal performance.
PHP Overview - Introduction to PHP: history, execution model, and why it matters.
Tutorial
- Tutorial Overview - Getting started with PHP
- Hello World - Basic syntax and output
- Form Handling - Processing GET and POST data
- Headers and Metadata - HTTP headers and request info
- Sessions - Server-side session management
Node.js Overview
Content coming soon. This section will cover event-driven JavaScript on the server, the Node.js runtime, and how it differs from traditional server-side languages.
REST Overview
Content coming soon. This section will cover RESTful API design principles, HTTP methods, resource naming, and stateless communication patterns.
MVC Overview
Content coming soon. This section will cover the Model-View-Controller architectural pattern and its application in web frameworks.
Analytics Overview
Content coming soon. This section will cover client-side analytics collection, user behavior tracking, and performance monitoring.
Data Visualization
Content coming soon. This section will cover data visualization techniques for analytics dashboards.