Active 2024-05-10

Apache PHP Build

Automated Apache and PHP compilation and installation toolkit for building custom web server environments from source.

apache php build-automation web-server linux
Quickstart
Get started instantly
git clone https://github.com/MHaggis/notes.git && cd notes/utilities/ApachePHPBuild && ./build.sh

⚠ The Problem

Building Apache and PHP from source requires managing complex dependencies, configuration options, and compilation steps. Package managers don't always provide the latest versions or specific compile-time options needed for custom environments.

✓ The Solution

Apache PHP Build automates the entire process of downloading, configuring, compiling, and installing Apache and PHP from source. It handles dependencies, applies optimal compile flags, and sets up a production-ready environment.

⚡ Impact

Enables security researchers and developers to quickly spin up custom web server environments with specific versions and configurations for testing, research, or production use.

Features

Automated Build Process

  • Downloads and verifies Apache and PHP source
  • Manages build dependencies
  • Applies optimal compilation flags
  • Configures modules and extensions

Customizable Configuration

  • Select specific Apache/PHP versions
  • Choose which modules to compile
  • Configure PHP extensions
  • Set custom installation paths

Production Ready

  • Security-hardened defaults
  • Performance optimizations
  • Proper file permissions
  • Service configuration

Use Cases

Security Research

Build specific vulnerable versions for testing and research.

Custom Environments

Create tailored web server stacks with exact version requirements.

Testing & Development

Quickly spin up isolated environments for testing.

Performance Tuning

Compile with specific optimizations for your hardware.

Requirements

  • Linux system (tested on Ubuntu/Debian/CentOS)
  • Root or sudo access
  • Build essentials (gcc, make, etc.)
  • Internet connection for downloads

Configuration

Customize the build by editing configuration variables:

  • Apache version
  • PHP version
  • Module selections
  • Installation paths
  • Compile flags

Post-Installation

The script configures:

  • Apache service
  • PHP-FPM (if selected)
  • Virtual host templates
  • Log rotation
  • Security settings

Build your custom web server

Related Modules