Biblioteca de cunoștințe

Installing WordPress Tipărire

  • wordpress, cms, php, website
  • 0

Overview

WordPress is the most widely used content management system for websites and blogs. You can install it manually on any ALYPOD Pod that runs a web server and PHP, or use a one-click install in cPanel, Plesk or CWP. This article covers the manual method, which works everywhere.

Before you begin

  • A CPU Pod with Apache or Nginx, PHP 8.1+ and MySQL/MariaDB installed.
  • A database and database user for WordPress.
  • A domain or subdomain pointing to the Pod.
  • SSH and sudo/root access (or an SFTP client).

Steps

  1. Install the required PHP extensions for WordPress:

```bash

Debian / Ubuntu

sudo apt install -y php php-mysql php-curl php-gd php-mbstring php-xml php-zip php-imagick

RHEL family

sudo dnf install -y php php-mysqlnd php-gd php-mbstring php-xml php-zip ```

  1. Create the database and user:

sql CREATE DATABASE wordpress CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'strong-password-here'; GRANT ALL PRIVILEGES ON wordpress.* TO 'wpuser'@'localhost'; FLUSH PRIVILEGES;

  1. Download WordPress into your web root and set ownership:

bash cd /var/www curl -O https://wordpress.org/latest.tar.gz tar xzf latest.tar.gz mv wordpress example.com chown -R www-data:www-data example.com # use apache:apache on RHEL

  1. Copy the sample config and generate security keys:

bash cd example.com cp wp-config-sample.php wp-config.php curl -s https://api.wordpress.org/secret-key/1.1/salt/

  1. Edit wp-config.php to set DB_NAME, DB_USER, DB_PASSWORD, DB_HOST, and paste the generated salts.

  2. Create an Apache vhost (or Nginx server block) for the domain, then reload the web server:

bash sudo systemctl reload apache2 # or: nginx -s reload

  1. Visit https://example.com and complete the five-minute install (site title, admin user, email).

Troubleshooting

  • Problem: "Error establishing a database connection". Solution: Re-check the credentials in wp-config.php and that MySQL is running.
  • Problem: Cannot upload files or install plugins. Solution: Fix ownership and permissions: directories 755, files 644, owner matching the web user.
  • Problem: Permalinks return 404. Solution: Enable mod_rewrite (Apache) or add try_files $uri $uri/ /index.php?$args; to the Nginx block.

Related articles

  • [Securing WordPress]
  • [Installing MySQL and MariaDB]
  • [Setting up a free Let's Encrypt SSL certificate]

Răspunsul a fost util?

« înapoi