Mets Minor League Blog

Music theory, instruments and musicians

Mets Minor League Blog

Music theory, instruments and musicians

How to Install WordPress with Lighttpd on Ubuntu 24.04

How to Install WordPress with Lighttpd on Ubuntu 24.04

Setting up WordPress with Lighttpd on Ubuntu 24.04 allows you to create a lightweight, efficient, and secure website hosting environment. Lighttpd is known for its speed and low resource consumption, making it an excellent choice for small to medium websites or development environments. This guide walks you through the process step-by-step, ensuring you can deploy WordPress quickly and reliably on your Ubuntu 24.04 server. Before starting, ensure you have a fresh Ubuntu 24.04 server with root or sudo privileges, a domain name pointed to your server IP, and basic familiarity with Linux command line operations.

What You’ll Need

  • Ubuntu 24.04 server with root or sudo access
  • Domain name pointed to your server’s IP address
  • Basic knowledge of Linux command line
  • Optional: SSL certificate for HTTPS (recommended but not covered here)

Step-by-Step

  1. Update your system packages
    sudo apt update && sudo apt upgrade -y

    Ensure your system is up-to-date to avoid compatibility issues.

  2. Install necessary dependencies
    sudo apt install -y lighttpd php php-cgi php-mysql mysql-server unzip wget

    This installs the web server, PHP, MySQL, and other tools needed for WordPress.

  3. Configure MySQL for WordPress
    sudo mysql_secure_installation

    Follow prompts to set a root password and secure your database server.
    Then, log in to MySQL:

    sudo mysql -u root -p

    Create a database and user for WordPress:

    CREATE DATABASE wordpress_db DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    CREATE USER 'wp_user'@'localhost' IDENTIFIED BY 'your_secure_password';
    GRANT ALL PRIVILEGES ON wordpress_db.* TO 'wp_user'@'localhost';
    FLUSH PRIVILEGES;
    EXIT;
  4. Download and set up WordPress
    wget https://wordpress.org/latest.tar.gz
    tar -xzf latest.tar.gz
    sudo mv wordpress /var/www/html/wordpress
    

    Adjust permissions:

    sudo chown -R www-data:www-data /var/www/html/wordpress
    sudo chmod -R 755 /var/www/html/wordpress
  5. Configure PHP for Lighttpd
    sudo nano /etc/lighttpd/lighttpd.conf

    Ensure these modules are enabled:

    server.modules += ("mod_fastcgi", "mod_access", "mod_alias", "mod_rewrite")

    Configure FastCGI:

    sudo nano /etc/lighttpd/conf-available/15-fastcgi.conf

    Uncomment or add the following:

    fastcgi.server += (".php" => ("localhost" => ("socket" => "/var/run/lighttpd/php.socket")))

    Enable the configuration:

    sudo lighty-enable-mod fastcgi fastcgi-php
    sudo systemctl restart lighttpd
  6. Configure Lighttpd for WordPress
    sudo nano /etc/lighttpd/conf-available/10-wordpress.conf

    Add rewrite rules for permalinks:

    $HTTP[

    Related

    How to Install WordPress with Lighttpd on Ubuntu 24.04
Scroll to top