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
- Update your system packages
sudo apt update && sudo apt upgrade -yEnsure your system is up-to-date to avoid compatibility issues.
- Install necessary dependencies
sudo apt install -y lighttpd php php-cgi php-mysql mysql-server unzip wgetThis installs the web server, PHP, MySQL, and other tools needed for WordPress.
- Configure MySQL for WordPress
sudo mysql_secure_installationFollow prompts to set a root password and secure your database server.
Then, log in to MySQL:sudo mysql -u root -pCreate 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; - Download and set up WordPress
wget https://wordpress.org/latest.tar.gz tar -xzf latest.tar.gz sudo mv wordpress /var/www/html/wordpressAdjust permissions:
sudo chown -R www-data:www-data /var/www/html/wordpress sudo chmod -R 755 /var/www/html/wordpress - Configure PHP for Lighttpd
sudo nano /etc/lighttpd/lighttpd.confEnsure these modules are enabled:
server.modules += ("mod_fastcgi", "mod_access", "mod_alias", "mod_rewrite")Configure FastCGI:
sudo nano /etc/lighttpd/conf-available/15-fastcgi.confUncomment 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 - Configure Lighttpd for WordPress
sudo nano /etc/lighttpd/conf-available/10-wordpress.confAdd rewrite rules for permalinks:
$HTTP[Related
- How to Import Bookmarks from Edge to Edge Browser Easily
- How to Import an Excel Spreadsheet into InDesign Easily
- How to Hide Your Number During Calls on Android
How to Install WordPress with Lighttpd on Ubuntu 24.04