Has your website grown a large following recently, perhaps receiving a lot more web traffic and visitors than before? Well, congratulations!
Now comes the important step of ensuring your website keeps growing and remains accessible to your new visitors, often websites hosted on shared hosting services have limits set on them by their web host, while some web hosts might be generous with their limits, most tend to restrict memory usage, IOps (Input output operations per second) and other variables like Entry processes which ultimately limit the number of people who can access your website at a given time.
Using a control panel like cPanel or DirectAdmin gives a sense of comfort and easy accessibility to various features like creating/managing databases, accessing webmail and other features like adding users, new domains and email accounts.
Moving to a VPS from Shared Hosting is the step often taken by most growing website owners to ensure that your website has more resources available for it, but this often brings along a few doubts about managing your website via the command line, while setting up a LAMP stack or LEMP stack isn’t difficult, but combined with managing things like a mail server and databases for multiple users or websites, it gets rather complex quickly.
Let’s take a look at 5 free to use control panels that make managing your website on a VPS just like it was on your shared hosting service,
VestaCP is the popular and free-to-use control panel, with a nice UI and packed with features that make it super simple to manage your websites hosted on the VPS.
myVesta is a fork of vestaCP with similar UI and features, but it is designed with a few additional features to improve performance and give end users more control such as limiting the maximum number of sent emails (per hour) per mail account and per hosting account.
In this week’s feature highlight, we look at How to Install GCC on Ubuntu 22.10
The default Ubuntu repositories contain a meta-package named “build-essential” that includes the GNU compiler collection, GNU debugger, and other development libraries and tools required for compiling software.
Update System
apt update
Install the GCC package dependencies.
apt install build-essential
To check GCC version
gcc --version
Output:
root@crown:~# gcc --version
gcc (Ubuntu 12.2.0-3ubuntu1) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
That’s it. GCC tools and libraries have been installed on your Ubuntu system.
Compiling a Hello World Example
Compiling a basic C or C++ program using GCC is pretty easy. For example let’s create a hello world C program. Save the following code as hello.c text file:
Try this wiki on our VPS. Starting at just $5/month with 24×7 In-house customer support.
Pre-requisites
A system with AlmaLinux 9 installed and running.
root access to the system.
Docker installed and running, for this, you can refer to one of our guides on installing Docker on AlmaLinux 9.
Docker-Compose installed and running, for this, you can refer to one of our guides on installing Docker-Compose on AlmaLinux 9.
Once you’re all set, we’ll proceed with Planka installation and configuration.
Install Planka with Docker
The following instructions use Docker-Compose and Docker service to install Planka using the Planka Docker Image. First, download the docker-compose configuration,
In this week’s feature highlight, we look at How to Install WordPress with LEMP Stack on Ubuntu 22.10
WordPress is one of the most popular website-building tools available out there. It is a simple way to get your online presence and perfect for those who do not know how to code and want a simple and effective way to share and build your story on the internet.
Next, create a new MySQL user account that we will use to operate on WordPress’s new database, with the username “wordpress_user”.
CREATE USER 'wordpress_user'@'localhost' IDENTIFIED BY 'password';
Link the user and DB together by granting our user access to the database.
GRANT ALL PRIVILEGES ON wordpress_db.* to wordpress_user@'localhost';
Flush the privileges so that MySQL knows about the user permissions we just added.
FLUSH PRIVILEGES;
Exit out of the MySQL command prompt by typing.
exit
Output:
root@crown:~# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 42
Server version: 10.6.9-MariaDB-1 Ubuntu 22.10
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> CREATE DATABASE wordpress_db;
Query OK, 1 row affected (0.001 sec)
MariaDB [(none)]> CREATE USER 'wordpress_user'@'localhost' IDENTIFIED BY 'crown@';
Query OK, 0 rows affected (0.003 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON wordpress_db.* to wordpress_user@'localhost';
Query OK, 0 rows affected (0.001 sec)
MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.002 sec)
MariaDB [(none)]> exit
Bye
We are happy to announce that our NL1 datacenter is now located at the BiT datacenter in Ede, The Netherlands.
All existing customers of our NL1 setup are now located in the BiT datacenter, and any new order directed to the NL1 datacenter will be provisioned at this datacenter.
Datacenter Information:
Address: BIT datacenter Galileïlaan 19, 6716 BP Ede, Netherlands
Datacenter Feature
Information
Fire detection
an independent, certified very early warning system with automatic notification to fire brigade
Fire extinguishing
certified Argonite (Ar+N2) installation
Cooling installation
N+1 computairs N+1 cooling machines
Cooling power output
1500 W/m²
Temperature
25 ℃ (+/- 2 ℃) in cold paths
Lightning protection
certified according to NEN norms
Electrical installation
two incoming feeds into rack separate UPS for every feed
Emergency power supply
N+1 diesel aggregates
Diesel supply
48 hours
Power per rack
up to 96 A
Information security
ISO/IEC 27001 and NEN 7510 certified
Physical security
VEC certified safety class 4*
Alarm
redundant connection to control centre
Surveillance
two independent surveillance services
Cameras
inside and outside the data centers
Access control
two factor authentication biometric iris scanners RFID access passes
In this week’s feature highlight, we look at How to Install LAMP Stack (MariaDB) on Ubuntu 22.10
A LAMP stack is a group of open-source software that is typically installed together to enable a server to host dynamic websites and web apps. This term is actually an acronym which represents the Linux operating system, with the Apache web server. The site data is stored in a MySQL or MariaDB database, and dynamic content is processed by PHP.
First, check for any pending system upgrades.
apt update
apt upgrade
Install Apache
Command to install Apache along with its utilities.
apt install -y apache2 apache2-utils
Next, check the Status of Apache.
systemctl status apache2
Output:
root@crown:~# systemctl status apache2
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; preset: enabled)
Active: active (running) since Sat 2022-10-15 20:18:49 UTC; 10s ago
Docs: https://httpd.apache.org/docs/2.4/
Main PID: 3121 (apache2)
Tasks: 55 (limit: 2227)
Memory: 4.9M
CPU: 43ms
CGroup: /system.slice/apache2.service
├─3121 /usr/sbin/apache2 -k start
├─3123 /usr/sbin/apache2 -k start
└─3124 /usr/sbin/apache2 -k start
If Apache is not active can start using the following command.
systemctl start apache2
Use the following command to auto-start Apache at boot time.
systemctl enable apache2
You can confirm the Apache2 version with the below command,
apache2 -v
Output:
root@crown:~# apache2 -v
Server version: Apache/2.4.54 (Ubuntu)
Server built: 2022-07-21T19:38:00
Use the following command to auto start MariaDB at boot time.
systemctl enable mariadb
Next, MariaDB database security.
NOTE: In this step, you will be prompted with several questions.
mysql_secure_installation
Output:
root@crown:~# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
haven't set the root password yet, you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password or using the unix_socket ensures that nobody
can log into the MariaDB root user without the proper authorisation.
You already have your root account protected, so you can safely answer 'n'.
Switch to unix_socket authentication [Y/n] y
Enabled successfully!
Reloading privilege tables..
... Success!
You already have your root account protected, so you can safely answer 'n'.
Change the root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] y
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] y
... Success!
By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] y
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
To login to MariaDB.
mariadb -u root -p
To exit from MariaDB.
exit
To check MariaDB Version.
mariadb --version
Output:
root@crown:~# mariadb --version
mariadb Ver 15.1 Distrib 10.6.9-MariaDB, for debian-linux-gnu (x86_64) using EditLine wrapper
Install PHP
PHP 8.1 is the default version of PHP that would be installed on Ubuntu 22.10.
Enable the Apache PHP module and restart the Apache Web server.
a2enmod php
systemctl restart apache2
To check PHP Version.
php --version
Output:
root@crown:~# php --version
PHP 8.1.7-1ubuntu3 (cli) (built: Sep 13 2022 14:02:34) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.7, Copyright (c) Zend Technologies
with Zend OPcache v8.1.7-1ubuntu3, Copyright (c), by Zend Technologies
To test PHP scripts we need to add the info.php file in the document.
nano /var/www/html/info.php
Add the following to the file.
<?php phpinfo(); ?>
To verify enter the following link in a web browser.
NOTE: Replace with your server IP address below.
http://ip-address/info.php
Run PHP-FPM with Apache [Optional]
FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation with some additional features useful for heavy-loaded sites.
NOTE: This is an optional step, PHP 8.1 is used to run the PHP code but if you want to run PHP code with PHP-FPM follow the below steps.
First, Let us disable PHP,
a2dismod php
Next, Install PHP-FPM.
apt install php8.1-fpm
Enable proxy_fcgi and setenvif module.
a2enmod proxy_fcgi setenvif
Output:
root@crown:~# a2enmod proxy_fcgi setenvif
Considering dependency proxy for proxy_fcgi:
Enabling module proxy.
Enabling module proxy_fcgi.
Module setenvif already enabled
To activate the new configuration, you need to run:
systemctl restart apache2
To enable php8.1-fpm file.
a2enconf php8.1-fpm
Restart the Apache.
systemctl restart apache2
To enable php-fpm.
systemctl enable php8.1-fpm
To start php-fpm.
systemctl start php8.1-fpm
To check the status of php-fpm.
systemctl status php8.1-fpm
Output:
root@crown:~# systemctl status php8.1-fpm
● php8.1-fpm.service - The PHP 8.1 FastCGI Process Manager
Loaded: loaded (/lib/systemd/system/php8.1-fpm.service; enabled; preset: enabled)
Active: active (running) since Sat 2022-10-15 20:26:13 UTC; 58s ago
Docs: man:php-fpm8.1(8)
Main PID: 16630 (php-fpm8.1)
Status: "Processes active: 0, idle: 2, Requests: 0, slow: 0, Traffic: 0req/sec"
Tasks: 3 (limit: 2227)
Memory: 9.5M
CPU: 75ms
CGroup: /system.slice/php8.1-fpm.service
├─16630 "php-fpm: master process (/etc/php/8.1/fpm/php-fpm.conf)"
├─16631 "php-fpm: pool www"
└─16632 "php-fpm: pool www"
Now you have successfully installed the LAMP stack (Apache, MariaDB, and PHP8.1) on Ubuntu 22.10.