DEV Community

Cover image for Web server, database and other important settings
schBenedikt for Technology Schächner

Posted on • Updated on • Originally published at technik.xn--schchner-2za.de

Web server, database and other important settings

In our third guide, we'll show you how to install & configure everything you'll need later for your own cloud & website!


Please also note that you have followed our previous tutorials to better understand this one.


So, let's go!


First, we needed elevated privileges—but fear not! Nothing can go wrong!

We'll get this
sudo su

First we install all available updates & upgrades using the command
apt update && apt upgrade -y

Now we can really get started; To install Apache2 we need this code. You may have to confirm this with a "y" for "yes"!
apt install apache2

To install PHP, we must first install, and then add the correct repository; that's what you do
apt install software-properties-common

add-apt-repository ppa:ondrej/php
You must press Enter to continue.

Then we update again:
apt update

Also, we need to install the following to make everything run smoothly:
apt install php libapache2-mod-php php-zip php-dompdf php-xml php-mbstring php-gd php-curl php-imagick libmagickcore-6.q16-6-extra php-intl php-bcmath php-gmp php-cli php-json php-mysql php-zip php-gd php-mbstring php-curl php-xml php-pear unzip nano php-apcu redis-server ufw php-redis
We confirm this again with 'y' .

Then we edit the php.ini file:
nano /etc/php/8.1/apache2/php.ini

You can search for the words with ctrl+w, please change the values so that the individual things are like this:

memory_limit = 1024M
upload_max_filesize = 20G
post_max_size = 20G
date.timezone = Europe/Berlin
output_buffering = Off
Enter fullscreen mode Exit fullscreen mode

You can save everything with ctrl+o and exit the editor with ctrl+x.

Then we install the Mariadb server
apt install mariadb-server

We confirm that again with 'j' for 'Yes'. This program is required for the database. So, so that you can log in with passwords, etc. However, this must be set up first!

The last thing we need is this code:
sudo mysql_secure_installation


But what can you do with it? You'll find out in the next article, which explains how to host a web server with WordPress!

Top comments (0)