đ Project Overview
The Kernel Mirror Project is a comprehensive web platform designed to provide fast, reliable access to Linux kernel downloads with complete version history, PGP signature verification, and detailed changelogs.
Built with modern web technologies, this project serves as both a mirror distribution system and a complete kernel management platform, offering developers and system administrators a streamlined way to access, verify, and deploy Linux kernels.
Project Goals
- Reliability: 99.9%+ uptime with redundant mirror infrastructure
- Security: Built-in PGP signature verification for all downloads
- Performance: CDN-accelerated downloads with bandwidth optimization
- Transparency: Complete changelog access and version tracking
- Community: Open-source, community-driven development
Quick Stats
- đĻ Over 1.2M+ kernel downloads served
- đ 12 active global mirrors
- ⥠99.98% uptime in the last 30 days
- đ 100% PGP-verified downloads
⨠Key Features
Version Management
Browse and download all major kernel versions with complete version history and release notes.
PGP Verification
Every kernel download includes PGP signatures for cryptographic verification and security.
Changelog Access
View detailed changelogs for every kernel version with syntax highlighting and search.
Mirror Network
Global CDN with 12+ mirrors ensuring fast downloads from any geographic location.
Status Dashboard
Real-time monitoring of server health, bandwidth usage, and download statistics.
Responsive Design
Mobile-friendly interface that works seamlessly across all devices and screen sizes.
đī¸ System Architecture
Technology Stack
| Component | Technology | Version | Purpose |
|---|---|---|---|
| Backend | PHP | 8.1+ | Server-side logic and routing |
| Database | MariaDB/MySQL | 10.5+ | Data persistence and queries |
| Web Server | Nginx | 1.24+ | HTTP/HTTPS serving |
| Frontend | HTML5/CSS3/JS | ES6+ | User interface |
| Sync | Rsync | 3.2+ | Mirror synchronization |
Directory Structure
mirror/
âââ index.php # Main kernel listing page
âââ docs.php # This documentation page
âââ stats.php # Statistics dashboard
âââ mirror.php # Mirror setup guide
âââ contact.php # Contact information
âââ privacy.php # Privacy policy
âââ terms.php # Terms of service
âââ mission.php # About/mission page
â
âââ css/
â âââ style.css # Global stylesheet (1000+ lines)
â
âââ js/
â âââ helper.js # Utility functions
â
âââ backend/
â âââ db.php # Database connection (PDO)
â âââ init.php # Security & session initialization
â âââ userp.php # Helper classes (User, Stats)
â
âââ static/
â âââ nav.php # Navigation component
â âââ logo.php # Logo/branding component
â âââ footer.php # Footer component
â
âââ images/
âââ icons/ # Icon assets
âââ media/ # Media files
đĻ Installation Guide
System Requirements
- OS: Ubuntu 22.04 LTS / Debian 11+ / CentOS 8+
- PHP: 8.1 or higher (8.4+ recommended)
- Database: MariaDB 10.5+ or MySQL 8.0+
- Web Server: Nginx 1.24+ or Apache 2.4+
- Disk Space: Minimum 500GB (1TB recommended for mirror)
- RAM: 4GB minimum (8GB recommended)
Quick Installation
# 1. Clone or download the project
cd /var/www/html
sudo git clone https://github.com/yourusername/kernel-mirror.git mirror
# 2. Set proper permissions
sudo chown -R www-data:www-data mirror
find mirror -type d -exec chmod 755 {} \;
find mirror -type f -exec chmod 644 {} \;
# 3. Install PHP dependencies (if using Composer)
cd mirror
composer install --no-dev
# 4. Create database
mysql -u root -p
CREATE DATABASE kernel_mirror CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE USER 'mirror_user'@'localhost' IDENTIFIED BY 'secure_password';
GRANT ALL PRIVILEGES ON kernel_mirror.* TO 'mirror_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
# 5. Import database schema
mysql -u mirror_user -p kernel_mirror < database/schema.sql
# 6. Configure database connection
cp inc/db.example.php inc/db.php
nano inc/db.php # Edit with your credentials
Important Security Note
Never commit inc/db.php to version control. Always use environment variables or secure configuration management for production deployments.
âī¸ Configuration
Database Configuration
Edit inc/db.php with your database credentials:
<?php
// Database Configuration
define('DB_HOST', 'localhost');
define('DB_NAME', 'kernel_mirror');
define('DB_USERNAME', 'mirror_user');
define('DB_PASSWORD', 'your_secure_password');
define('DB_CHARSET', 'utf8mb4');
// PDO Connection
try {
$odb = new PDO(
"mysql:host=" . DB_HOST . ";dbname=" . DB_NAME . ";charset=" . DB_CHARSET,
DB_USERNAME,
DB_PASSWORD,
[
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::ATTR_EMULATE_PREPARES => false
]
);
} catch (PDOException $e) {
error_log("Database Connection Error: " . $e->getMessage());
die("Database connection failed. Please check configuration.");
}
?>
Nginx Configuration
server {
listen 80;
listen [::]:80;
server_name mirror.example.com;
root /var/www/html/mirror;
index index.php;
# Logging
access_log /var/log/nginx/mirror-access.log;
error_log /var/log/nginx/mirror-error.log;
# PHP Processing
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# Security headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
# Cache static assets
location ~* \.(css|js|jpg|jpeg|png|gif|ico|svg|woff|woff2|ttf|eot)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
# Deny access to sensitive files
location ~ /\. {
deny all;
}
}
Theme Customization
Customize colors in css/style.css:
:root {
--primary-color: #2563eb; /* Main brand color */
--primary-hover: #1d4ed8; /* Hover state */
--success-color: #10b981; /* Success messages */
--warning-color: #f59e0b; /* Warnings */
--danger-color: #ef4444; /* Errors */
--border-radius: 8px; /* Border radius */
--transition: all 0.3s ease; /* Animation speed */
}
đī¸ Database Schema
Kernel Table
Stores kernel version information and download links:
CREATE TABLE `kernel` (
`id` INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
`version` VARCHAR(50) NOT NULL,
`status` VARCHAR(20) NOT NULL DEFAULT 'stable',
`url` TEXT NOT NULL,
`pgp` TEXT,
`changelog` TEXT,
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
`updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
INDEX `idx_version` (`version`),
INDEX `idx_status` (`status`)
) ENGINE=InnoDB CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
Field Descriptions
| Field | Type | Description |
|---|---|---|
id |
INT | Auto-incrementing primary key |
version |
VARCHAR(50) | Kernel version number (e.g., "6.6.0") |
status |
VARCHAR(20) | Release status: stable, beta, deprecated |
url |
TEXT | Download URL for kernel tarball |
pgp |
TEXT | PGP signature file URL |
changelog |
TEXT | Changelog content for this version |
Users Table
CREATE TABLE `users` (
`ID` INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
`username` VARCHAR(100) NOT NULL UNIQUE,
`password` VARCHAR(255) NOT NULL,
`email` VARCHAR(255),
`rank` TINYINT DEFAULT 0, -- 0=user, 1=admin, 2=staff
`status` TINYINT DEFAULT 0, -- 0=active, 1=banned
`membership` TINYINT DEFAULT 0,
`expire` INT UNSIGNED,
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
đ Usage Guide
Adding a New Kernel Version
-- Insert new kernel version
INSERT INTO `kernel` (version, status, url, pgp, changelog)
VALUES (
'6.6.0',
'stable',
'https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.6.tar.xz',
'https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.6.tar.sign',
'Linux 6.6 Release Notes:\n- Feature 1\n- Feature 2\n- Bug fixes'
);
Updating Kernel Status
-- Mark kernel as deprecated
UPDATE `kernel` SET status = 'deprecated' WHERE version = '5.4.0';
-- Promote beta to stable
UPDATE `kernel` SET status = 'stable' WHERE version = '6.6.0';
User Management
-- Create admin user (remember to hash password!)
INSERT INTO `users` (username, password, email, rank)
VALUES ('admin', '$2y$10$hashed_password_here', 'admin@example.com', 1);
-- Ban a user
UPDATE `users` SET status = 1 WHERE username = 'spammer';
Password Hashing
Always use password_hash() in PHP for secure password storage:
$hash = password_hash($password, PASSWORD_BCRYPT);
đ ī¸ Helper Functions & Utilities
PGP Verification Helper
Automatically verify kernel downloads using GPG signatures to ensure authenticity and integrity.
View Example âStatistics Tracker
Track download counts, bandwidth usage, and user activity with built-in analytics functions.
View Example âMirror Sync Utility
Automated rsync scripts to keep mirrors synchronized with upstream kernel.org sources.
View Example âTheme Switcher
Dark/light mode support with automatic system preference detection and manual toggle.
View Example âEmail Notifications
Send automated alerts for new kernel releases, security updates, and system events.
View Example âSearch & Filter
Advanced search capabilities with filters for version, status, date range, and more.
View Example âUser Class Helper
The User class provides authentication and authorization helpers:
class User {
// Check if user is admin
public function isAdmin($odb): bool
// Check if user is staff
public function isStaff($odb): bool
// Check if user is logged in
public function LoggedIn(): bool
// Check if user has active membership
public function hasMembership($odb): bool
// Check if user is not banned
public function notBanned($odb): bool
}
đ Security Best Practices
Input Validation
// Always sanitize user input
$version = htmlspecialchars($_POST['version'], ENT_QUOTES, 'UTF-8');
// Validate URLs
$validURL = filter_var($url, FILTER_VALIDATE_URL) ? $url : null;
// Use prepared statements for database queries
$stmt = $odb->prepare("SELECT * FROM kernel WHERE version = :version");
$stmt->execute([':version' => $version]);
Security Checklist
Essential Security Measures
- â Always use prepared statements for SQL queries
- â Enable HTTPS with valid SSL certificates
- â Set secure session cookie parameters
- â Implement CSRF token validation
- â Use password_hash() for password storage
- â Validate and sanitize all user inputs
- â Keep PHP and dependencies updated
- â Disable error display in production
đ§ Troubleshooting
Common Issues
Database Connection Failed
Problem: "Database connection failed" error on page load.
Solution:
- Check database credentials in
inc/db.php - Verify MySQL/MariaDB service is running:
sudo systemctl status mysql - Test database connection:
mysql -u username -p database_name - Check PHP PDO extension is installed:
php -m | grep pdo
Blank Page / White Screen
Problem: Pages load but show blank/white screen.
Solution:
- Enable error display temporarily:
error_reporting(E_ALL); ini_set('display_errors', 1); - Check PHP error logs:
tail -f /var/log/php8.1-fpm.log - Verify file permissions are correct (644 for files, 755 for directories)
Slow Page Load Times
Problem: Pages take several seconds to load.
Solution:
- Enable PHP OPcache for better performance
- Add database indexes for frequently queried columns
- Implement caching (Redis, Memcached)
- Optimize images and static assets
Need More Help?
Visit our contact page or check the GitHub issues for community support.
đ¤ Contributing
We welcome contributions from the community! Here's how you can help:
How to Contribute
- Fork the repository on GitHub
- Create a new branch for your feature:
git checkout -b feature-name - Make your changes and commit:
git commit -m "Add feature" - Push to your branch:
git push origin feature-name - Submit a pull request with detailed description
Development Guidelines
- Follow PSR-12 coding standards for PHP
- Write meaningful commit messages
- Test your changes thoroughly
- Update documentation for new features
- Ensure backward compatibility
Code Review Process
All contributions go through code review before merging:
- Automated tests must pass
- Code must be reviewed by at least one maintainer
- Documentation must be updated if needed
- Security implications are evaluated
Thank You!
Your contributions help make this project better for everyone. We appreciate your time and effort!
Documentation Version: 1.0.0 | Last Updated: October 24, 2025
For questions or feedback, visit our contact page