Deploying a website on a 3HCloud server using LAMP and Wordpress

March 31, 2025

How to Launch a WordPress Site on 3HCloud Using LAMP

Follow these steps to configure a LAMP stack, install WordPress, and publish your website on a 3HCloud server.

The LAMP stack (Linux, Apache, MySQL, PHP) is a popular open-source software stack for building web applications. Linux is the OS, Apache the web server, MySQL the database, and PHP the scripting language.

WordPress is a popular content management system (CMS) that allows users to create, manage, and publish content on the web with ease. It offers extensive customization through themes and plugins, making it a versatile choice for websites of various types and sizes.

3HCloud is a cloud server provider that offers scalable and reliable hosting solutions. By launching your site on the virtual server, you can leverage its flexibility, cost-effectiveness, and high-performance infrastructure to accommodate the needs of your growing website.

Together, these technologies create a powerful synergy that allows you to build and deploy a functional, dynamic, and secure website with ease.

Step 0: Create 3HCloud account

Sign up for a 3HCloud Control panel and create an account.

Step 1: Create virtual server and connect via SSH

In the Control panel create a new virtual server. 

Select a suitable server size, location, and Linux distribution. Learn more about virtual servers.

Once your server is up and running, connect to it via SSH using an SSH client like PuTTY on Windows or the built-in terminal on macOS and Linux:

ssh root@your_server_ip

Next, update your server's package list and upgrade existing packages:

sudo apt-get update
sudo apt-get upgrade

Step 2: Install the LAMP stack

Install the LAMP stack components:

sudo apt-get install apache2
sudo apt-get install mysql-server
sudo apt-get install php libapache2-mod-php php-mysql

Step 3: Install MySQL and create database for WordPress

Run the MySQL security script and follow the prompts:

sudo mysql_secure_installation

Log in to MySQL, create a new database, and a user for WordPress:

sudo mysql -u root -p
CREATE DATABASE wordpress_db;
CREATE USER 'wordpress_user'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON wordpress_db.* TO 'wordpress_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Step 4: Download and configure WordPress

Download the latest WordPress package, extract it, and move it to the Apache web directory:

wget https://wordpress.org/latest.tar.gz
tar xf latest.tar.gz
sudo mv wordpress /var/www/html/wordpress

Copy the sample configuration file and update the database connection details:

cd /var/www/html/wordpress
sudo cp wp-config-sample.php wp-config.php
sudo nano wp-config.php

Update the following lines with your database information:

define('DB_NAME', 'wordpress_db');
define('DB_USER', 'wordpress_user');
define('DB_PASSWORD', 'your_password');
define('DB_HOST', 'localhost');

Step 5: Set permissions and configure Apache

Set the correct ownership and permissions for the WordPress directory:

sudo chown -R www-data:www-data /var/www/html/wordpress
sudo find /var/www/html/wordpress -type d -exec chmod 750 {} \;
sudo find /var/www/html/wordpress -type f -exec chmod 640 {} \;

Create a new Apache configuration file for your WordPress site and enable the site.

Add the following content, replacing your email and domain:

<VirtualHost *:80>    
ServerAdmin [email protected]    
DocumentRoot /var/www/html/wordpress    
ServerName your_domain.com    
ServerAlias www.your_domain.com   
<Directory /var/www/html/wordpress/>        
AllowOverride All    
</Directory>    
ErrorLog ${APACHE_LOG_DIR}/error.log    
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Enable the configuration and restart Apache:

sudo a2ensite wordpress
sudo a2enmod rewrite
sudo systemctl restart apache2

Step 6: Point the domain to 3HCloud server

Update your domain's DNS settings to point to your 3HCloud server's IP address. 

After the changes propagate, open your domain (http://your_domain.com) in a browser to complete the WordPress setup. Follow the prompts to create an administrator account and access the dashboard.

Follow the on-screen instructions to create an administrator account and log in to your WordPress dashboard.

Congratulations! You have successfully deployed a LAMP stack, installed WordPress, and launched your site on the 3HCloud cloud server. You can now customize your WordPress site, install themes and plugins, and begin creating content. We hope that this guide has been helpful to you in your web development journey.

Горячие предложения

Получите скидку до 80% на весь срок аренды сервера