Apache Setup Guide Beginner

This guide walks you through setting up the Billiard Scoreboard on an Apache web server, step by step. No prior server experience required.

What you will need:
What is Apache? Apache is a web server - software that serves web pages to browsers. When you type an address like http://192.168.1.50 into your browser, Apache receives the request and sends back the web page. PHP is a programming language that runs on the server and powers the scoreboard logic. SQLite is a simple database stored as a single file.

1 Linux (Ubuntu / Debian)

This section covers setup on Ubuntu 22.04, 24.04 or Debian 12. If you're using a Raspberry Pi with Raspberry Pi OS, these steps also apply.

1.1 — Open the Terminal

On your server or desktop, open a terminal window:

1.2 — Update the system

First, make sure your system is up to date:

sudo apt update && sudo apt upgrade -y
What does this do? sudo runs the command as administrator. apt update refreshes the list of available software. apt upgrade installs updates. -y automatically confirms.

1.3 — Install Apache, PHP and SQLite

sudo apt install apache2 php libapache2-mod-php php-sqlite3 -y

This installs:

PackageWhat it does
apache2The Apache web server
phpPHP programming language
libapache2-mod-phpConnects PHP to Apache
php-sqlite3PHP extension for SQLite databases

1.4 — Verify the installation

Check that everything was installed correctly:

apache2 -v
php -v
php -m | grep sqlite3

You should see version numbers for Apache and PHP, and sqlite3 in the module list.

Tip: If php-sqlite3 is not found, try sudo apt install php8.3-sqlite3 (replace 8.3 with your PHP version).

1.5 — Copy the scoreboard files

Apache serves files from /var/www/html/ by default. Copy all scoreboard files there:

# Remove the default Apache test page
sudo rm /var/www/html/index.html

# Copy all scoreboard files to the web directory
sudo cp -r /path/to/your/scoreboard-files/* /var/www/html/
Replace /path/to/your/scoreboard-files/ with the actual path where you extracted the scoreboard files. For example, if they are on a USB drive: /media/username/USB/billard/*

Alternatively, if you want the scoreboard in a subfolder:

# Create a subfolder
sudo mkdir -p /var/www/html/billard

# Copy files into the subfolder
sudo cp -r /path/to/your/scoreboard-files/* /var/www/html/billard/

1.6 — Set file permissions

Apache runs as the user www-data. PHP needs permission to read and write files (for the database and OBS text files):

sudo chown -R www-data:www-data /var/www/html
sudo chmod -R 775 /var/www/html
Why is this important? The scoreboard creates and writes to billiard_data.db (the database) and the /obs/ folder (text files for OBS). Without write permissions, you will get HTTP 500 errors.

1.7 — Restart Apache

sudo systemctl restart apache2

1.8 — Test it

Open a browser and navigate to:

Find your server IP: Run hostname -I in the terminal. The first address shown is your local IP (e.g. 192.168.1.50).

You should see the Billiard Scoreboard application. If you see "403 Forbidden" or a blank page, check the troubleshooting section below.

1.9 — Enable Apache at startup (optional)

To make Apache start automatically when the server boots:

sudo systemctl enable apache2

2 Windows (XAMPP)

On Windows, the easiest way to run Apache + PHP is with XAMPP, a free all-in-one package.

2.1 — Download XAMPP

  1. Go to https://www.apachefriends.org
  2. Download the Windows version (choose the latest PHP 8.x version)
  3. Run the installer

2.2 — Install XAMPP

  1. Run the downloaded installer
  2. When asked which components to install, make sure Apache and PHP are checked (you can uncheck MySQL, FileZilla, Mercury, Tomcat — they are not needed)
  3. Install to the default location: C:\xampp
  4. Finish the installation

2.3 — Copy the scoreboard files

XAMPP serves files from C:\xampp\htdocs\. Copy the scoreboard files there:

  1. Open C:\xampp\htdocs\ in File Explorer
  2. Delete the existing files (index.php, etc.) — these are XAMPP's default test pages
  3. Copy all scoreboard files into C:\xampp\htdocs\

Your folder should look like this:

C:\xampp\htdocs\ ├── index.php ├── api.php ├── config.php ├── monitor_de.php ├── monitor_en.php ├── help_de.html ├── help_en.html ├── /assets/ │ ├── /css/ │ ├── /js/ │ └── /lang/ ├── /logos/ ├── /EO/ └── /regeln/
Subfolder alternative: You can also create a subfolder C:\xampp\htdocs\billard\ and put the files there. The URL will then be http://localhost/billard/.

2.4 — Enable SQLite in PHP

SQLite should be enabled by default in XAMPP. To verify:

  1. Open C:\xampp\php\php.ini in a text editor (e.g. Notepad)
  2. Press Ctrl + F and search for sqlite3
  3. Find the line ;extension=sqlite3
  4. If there is a semicolon (;) at the beginning, remove it to enable the extension:
    ;extension=sqlite3    ← disabled (has semicolon)
    extension=sqlite3     ← enabled (no semicolon)
  5. Also check that extension=pdo_sqlite is enabled (no semicolon)
  6. Save the file

2.5 — Start Apache

  1. Open the XAMPP Control Panel (search for "XAMPP" in the Start Menu)
  2. Click Start next to Apache
  3. The status should turn green
Port conflict? If Apache won't start, another program (often Skype or IIS) may be using port 80. Click "Config" next to Apache in XAMPP, open httpd.conf, and change Listen 80 to Listen 8080. Then access the scoreboard at http://localhost:8080/.

2.6 — Test it

Open your browser and go to:

Access from other devices: To access the scoreboard from phones or tablets on the same network, use your PC's IP address instead of "localhost". Find it by opening Command Prompt (cmd) and typing ipconfig. Look for "IPv4 Address" (e.g. 192.168.1.100). Then access http://192.168.1.100/ from other devices.

2.7 — Auto-start XAMPP (optional)

To have Apache start automatically with Windows:

  1. Open the XAMPP Control Panel
  2. Click Config (top right)
  3. Check "Autostart of modules: Apache"
  4. Save

To start XAMPP itself on login, place a shortcut to C:\xampp\xampp-control.exe in your Windows Startup folder (Win + R, type shell:startup, press Enter).

3 macOS (XAMPP or MAMP)

Option A: XAMPP for macOS

  1. Download XAMPP from https://www.apachefriends.org (macOS version)
  2. Install and open the XAMPP application (it installs to /Applications/XAMPP/)
  3. Copy scoreboard files to /Applications/XAMPP/htdocs/
  4. Open the XAMPP manager and start Apache
  5. Open http://localhost/ in your browser

Option B: Built-in Apache (advanced)

macOS has Apache pre-installed. To use it:

# Start Apache
sudo apachectl start

# Enable PHP (edit the Apache config)
sudo nano /etc/apache2/httpd.conf

Find and uncomment (remove the #) this line:

#LoadModule php_module /usr/local/opt/php/lib/httpd/modules/libphp.so

Copy scoreboard files to /Library/WebServer/Documents/ and restart Apache:

sudo apachectl restart

4 Raspberry Pi

A Raspberry Pi makes an excellent dedicated scoreboard server. Follow the Linux (Ubuntu/Debian) steps above — Raspberry Pi OS is Debian-based, so all commands are identical.

Recommended Pi models

ModelSuitability
Raspberry Pi 4/5Excellent — plenty of power
Raspberry Pi 3Good — works fine for a few tables
Raspberry Pi Zero 2 WAcceptable — may be slow with many simultaneous users
Tip: For a permanent setup, assign a static IP to the Raspberry Pi so the scoreboard URL stays the same. Edit /etc/dhcpcd.conf or configure it in your router's DHCP settings.

5 Configuration

After the files are in place, open config.php in a text editor to customize the settings:

SettingDefaultDescription
MASTER_PIN '123456' PIN for admin actions (manage players, delete stats)
OBS_INTERVAL 15 How often OBS text files are updated (seconds)
MAX_HISTORY 100 Maximum number of game history entries
ICON_STYLE 'square' Button style: 'round' or 'square'
ICON_3D true 3D shadow effect on buttons
SHOW_LEGAL true Show legal notice / privacy policy in sidebar
REQUIRE_LOGIN false Require login on the start page
LOGIN_USER 'admin' Admin username (only if login is enabled)
LOGIN_PASS 'billard' Admin password (only if login is enabled)
Change the MASTER_PIN! The default PIN is 123456. Anyone who knows this PIN can manage players and delete statistics. Change it to something unique.

6 URL Overview

Once the server is running, these URLs are available (replace [IP] with your server's IP address):

PageURLDescription
Scoreboard http://[IP]/ Main application
Monitor (DE) http://[IP]/monitor_de.php Live display of all tables (German)
Monitor (EN) http://[IP]/monitor_en.php Live display of all tables (English)
OBS Overlays http://[IP]/obs_big.php?Tisch=1 OBS browser source overlays
Help (DE) http://[IP]/help_de.html Full documentation (German)
Help (EN) http://[IP]/help_en.html Full documentation (English)

7 Network Access & Firewall

To access the scoreboard from other devices (phones, tablets, other PCs), the web server port must be open.

Linux (UFW Firewall)

# Allow HTTP traffic (port 80)
sudo ufw allow 80/tcp

# Check firewall status
sudo ufw status

Windows Firewall

XAMPP usually configures the firewall automatically. If other devices cannot connect:

  1. Open Windows Defender Firewall (search in Start Menu)
  2. Click "Allow an app through firewall"
  3. Click "Change settings", then "Allow another app"
  4. Browse to C:\xampp\apache\bin\httpd.exe
  5. Check both Private and Public
  6. Click OK

8 Troubleshooting

ProblemCauseSolution
HTTP 500 Internal Server Error PHP cannot write to the database or OBS folder Linux: Run sudo chown -R www-data:www-data /var/www/html && sudo chmod -R 775 /var/www/html
Windows: Make sure the htdocs folder is not read-only (right-click → Properties → uncheck "Read-only")
403 Forbidden Apache cannot read the files Check file permissions and make sure index.php exists in the correct directory
Blank white page PHP error (often missing SQLite extension) Linux: Run sudo apt install php-sqlite3 and restart Apache
Windows: Enable extension=sqlite3 in php.ini (see step 2.4)
Page shows PHP code as text PHP module not loaded in Apache Linux: Run sudo apt install libapache2-mod-php and restart Apache
Windows: Reinstall XAMPP
Cannot access from other devices Firewall blocking port 80 See step 7 (Firewall) above
Apache won't start (port in use) Another program using port 80 Windows: Open cmd as admin, run netstat -ano | findstr :80 to find the process. Common culprits: Skype, IIS, World Wide Web Publishing Service
Alternative: Change Apache port to 8080
OBS text files not generated Write permissions on /obs/ folder Linux: sudo chmod -R 775 /var/www/html/obs
Windows: The obs folder will be created automatically; ensure htdocs is writable

Checking the Apache error log

Error logs are the best way to diagnose issues:

# Linux
sudo tail -f /var/log/apache2/error.log

# Windows (XAMPP)
# Open: C:\xampp\apache\logs\error.log

Test PHP manually

Create a test file to verify PHP is working:

# Linux
echo "<?php phpinfo(); ?>" | sudo tee /var/www/html/test.php

# Windows: Create C:\xampp\htdocs\test.php with content: <?php phpinfo(); ?>

Then open http://localhost/test.php. You should see a purple PHP information page. Check that SQLite3 and PDO SQLite appear in the list.

Security: Delete test.php after testing! It reveals server configuration details.

9 Apache vs. Nginx

The main documentation (help_en.html) describes setup with Nginx. Here are the key differences:

AspectApacheNginx
Config file /etc/apache2/sites-available/000-default.conf /etc/nginx/sites-available/default
Web root /var/www/html/ /var/www/html/ (same)
PHP integration Built-in module (libapache2-mod-php) Separate PHP-FPM process
Restart command sudo systemctl restart apache2 sudo systemctl restart nginx
Beginner-friendly Easier — PHP works out of the box Requires additional PHP-FPM setup
Tip: For the Billiard Scoreboard, both web servers work equally well. Apache is recommended for beginners because PHP works immediately after installation without extra configuration.

10 Quick Reference (Cheat Sheet)

Linux Commands

ActionCommand
Start Apachesudo systemctl start apache2
Stop Apachesudo systemctl stop apache2
Restart Apachesudo systemctl restart apache2
Check statussudo systemctl status apache2
View error logsudo tail -f /var/log/apache2/error.log
Find server IPhostname -I
Fix permissionssudo chown -R www-data:www-data /var/www/html

Windows (XAMPP) Paths

ItemPath
Web filesC:\xampp\htdocs\
PHP configC:\xampp\php\php.ini
Apache configC:\xampp\apache\conf\httpd.conf
Error logC:\xampp\apache\logs\error.log
Control PanelC:\xampp\xampp-control.exe

Pro Billiard Scoreboard System v4.5 | Apache Setup Guide

For full feature documentation, see help_en.html | help_de.html (German)