bookmark_borderInstalling WordPress on Ubuntu 23.10

Hello,

In this week’s feature highlight, we look at Install WordPress on Ubuntu 23.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.

Prerequisites:

Creating Database

Log into MySQL with the following command.

mysql -u root -p

First, we’ll create a new database.

CREATE DATABASE wordpress_db;

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';

Note: Replace “password” with a safe and secure password when creating the wordpress_user

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 using,

exit

Output:

root@crown:~# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 81
Server version: 10.6.7-MariaDB-2ubuntu1 Ubuntu 23.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.003 sec)

MariaDB [(none)]> CREATE USER 'wordpress_user'@'localhost' IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.005 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON wordpress_db.* to wordpress_user@'localhost';
Query OK, 0 rows affected (0.003 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.003 sec)

MariaDB [(none)]> exit
Bye

Download and Install WordPress

Download WordPress.

wget -O /tmp/wordpress.tar.gz https://wordpress.org/latest.tar.gz

Untar the downloaded WordPress file.

tar -xzvf /tmp/wordpress.tar.gz -C /var/www/html

Change the permission of the site directory.

chown -R www-data:www-data /var/www/html/wordpress

Navigate to your browser.

http://IP_ADDRESS/wordpress

images

Start the WordPress installation by clicking on the Continue button.

images

Enter the Database information that was setup earlier,

images

Click on Run the Installation button to proceed next,

images

Enter the Site’s Name and create a new Admin account,

images

Once completed, login with the newly created Admin account and you’ll be greeted to Dashboard page.

images

This concludes the topic of installing the latest WordPress on Ubuntu 23.10 server.

bookmark_borderInstalling Bagisto on Ubuntu 23.10

Hello,

In this week’s feature highlight, we look at How to Install Bagisto on Ubuntu 23.10

Bagisto is an eCommerce ecosystem designed for all to build and scale your business. It’s a free and open-source eCommerce framework that offers you a wide range of functionality and lets you have total control of your store. Built on top of the Laravel stack, it is coupled with easy product information management and fast time to market the product. Besides, the framework is very flexible and easy to use even for non-tech savvies. In this article, we are going to learn how to install Bagisto on Ubuntu 23.04. So, let’s get started.

Pre-requisites :

  • A system with Ubuntu 23.10 installed and running.
  • root access to the system.

Login to the Ubuntu 23.10 server and update the package repository information.

apt update 
apt upgrade

Install Apache

You can install and configure Apache web server using the following command.

apt update 

apt install apache2  

systemctl start apache2

systemctl enable apache2

Install PHP 8.2

You can install PHP 8.2 using the following command.

apt-get install -y php8.2 php8.2-{common,gmp,curl,soap,bcmath,intl,mbstring,xmlrpc,mysql,gd,xml,cli,zip} libapache2-mod-php8.2

To Enable the Apache php8.2 module, run the following command and restart the Apache Web server

a2enmod php8.2

a2enmod rewrite

systemctl restart apache2

Install Node.js

To install nvm, you can use the following command in your terminal:

wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.39.3/install.sh | bash

Output:

root@ubuntu23:~# wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.39.3/install.sh | bash
=> Downloading nvm from git to '/root/.nvm'
=> Cloning into '/root/.nvm'...
remote: Enumerating objects: 360, done.
remote: Counting objects: 100% (360/360), done.
remote: Compressing objects: 100% (306/306), done.
remote: Total 360 (delta 41), reused 167 (delta 28), pack-reused 0
Receiving objects: 100% (360/360), 220.29 KiB | 2.16 MiB/s, done.
Resolving deltas: 100% (41/41), done.
* (HEAD detached at FETCH_HEAD)
  master
=> Compressing and cleaning up git repository

=> Appending nvm source string to /root/.bashrc
=> Appending bash_completion source string to /root/.bashrc
=> Close and reopen your terminal to start using nvm or run the following to use it now:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
root@ubuntu23:~#

Update your shell ~/.profile by running following command

source ~/.profile

List out the all available Node.js versions. you can see all Node.js versions from the first version to the latest version.

nvm ls-remote

To install a specific Node.js version, use the following command. Here, we are installing v21.0.0. If you want to install another version, replacing v21.0.0 with the version number you want:

nvm install 21.0.0

And check the version of the Node.js once the installation is done

node -v

Output:

root@ubuntu23:~# node -v
v21.0.0
root@ubuntu23:~#

Install the Composer

apt install composer

composer -V

output:

root@ubuntu23:~# composer -V
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]? yes
Composer version 2.5.8 2023-06-09 17:13:21
root@ubuntu23:~#

SSH User creation

Add the user using the following command that will run the bagisto application.

adduser bagisto

You will receive a prompt to input a new “password” after executing the provided command. Enter a password, your complete name, and any necessary details. Then, confirm by selecting “Y” for verification.

After that, we will add the recently created user “bagisto” to the “sudo” group using the “usermod” command:

usermod -aG sudo bagisto

Now Switch to bagisto

su - bagisto

Download Bagisto

You can downlaod Bagisto, using the following command.

composer create-project bagisto/bagisto

cd bagisto/public

Apache configuration

Now, we need to configure Bagisto with Appache web server by updating `000-default.conf’ configuration file.

sudo nano /etc/apache2/sites-enabled/000-default.conf

You will find the following lines as shown below, after executing the above command.

Now, change this to

DocumentRoot    /home/bagisto/bagisto/public/

Configure the envvars

sudo nano /etc/apache2/envvars

Configure file apache2.conf

sudo nano /etc/apache2/apache2.conf

Change it to the following code :

<Directory/home/bagisto/bagisto/public/>
    Options FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

Create Database

Now Switch to root user back,

su root

Intall MySQL server using the following command if it is not installed on your server

apt-get install mysql-server

Access mysql server using the following command,

mysql -u root

Create database,

CREATE DATABASE bagisto;

Create database user with secure password,

CREATE USER 'bagistouser'@'localhost' IDENTIFIED BY 'YOUR-PASSWORD-HERE';

Replace YOUR-PASSWORD-HERE with a Secure Strong Password

Assign a required permission to created database user

GRANT ALL ON bagisto.* TO 'bagistouser'@'localhost' WITH GRANT OPTION
FLUSH PRIVILEGES;
EXIT

Make some changes to php.ini file.

nano /etc/php/8.2/apache2/php.ini

Edit the file using below config

file_uploads = On
allow_url_fopen = On
short_open_tag = On
memory_limit = 256M
upload_max_filesize = 100M
max_execution_time = 360
date.timezone = America/Chicago

Bagisto configuration

Go to the root directory for bagisto

cd /home/bagisto/bagisto

Now Edit the .env file with the mysql database

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=bagisto
DB_USERNAME=bagistouser
DB_PASSWORD=testuser@123
DB_PREFIX=

Replace the database password with your set database password.

Access the MySQL and run the following command

mysql -u root -p
SET GLOBAL log_bin_trust_function_creators = 1;

Install Bagisto

php artisan bagisto:install

Once it is succefully installed, you will get the following message in last with username and password details.

Output:

-----------------------------
Congratulations!
The installation has been finished and you can now use Bagisto.
Go to http://localhost/admin and authenticate with:
Email: admin@example.com
Password: admin123
Cheers!

Setting up File Permissions

chmod -R 755 /home/bagisto/bagisto

chown -R bagisto:bagisto /home/bagisto/bagisto

systemctl restart apache2

Install SSL Certificate

Let us install the SSL Certificate from Let’s Encrypt. For this, you will need to install certbot via snapd.

To installing snapd,

apt install snapd

Check the snapd for updates,

snap install core; sudo snap refresh core

Install Certbot

snap install --classic certbot

ln -s /snap/bin/certbot /usr/bin/certbot

Since we’re using Apache web server, run the below command to get the certificate,

certbot --apache

The Certbot will take care of your renewal automatically before they expire, you would have to run the certbot again only if you make changes to your configuration.

You can perform a test run with below command,

certbot renew --dry-run

Next, reload the page on the browser and it should then redirect and load the HTTPS site https://bagisto.domainhere.info.

Accessing Bagisto

You can manage the Bagisto through the admin panel from the following URL

https://bagisto.domainhere.info/

Replace the bagisto.domainhere.info with the actual IP or domain configured on the server.

Enter the username and password which you have got at installation time.

You can access and view Bagisto using the following URL,

https://bagisto.domainhere.info/

Replace the bagisto.domainhere.info with the actual IP or domain configured on the server.

Now you have successfully installed Bagisto on Ubuntu 23.10.

bookmark_borderPHP 8.3 is now available on cPanel and DirectAdmin Shared and Reseller Hosting Plans

Hello,

We’re thrilled to share some fantastic news for all our web developers and website owners. We’ve just rolled out an exciting update – PHP 8.3 is now available for use with our cPanel and DirectAdmin hosting plans! This latest PHP version brings a host of improvements, features, and optimizations to enhance your web development experience.

To initiate the upgrade to PHP 8.3, please follow the steps outlined below:

For cPanel Users:
1. Log in to your cPanel account.

2. Navigate to the “Software” or “Software/Services” section.

3. Look for the “MultiPHP Manager” or “PHP Selector” option.

4. Select PHP 8.3 from the available versions. Save your changes.

For DirectAdmin Users:
1. Log in to your DirectAdmin control panel.

2. Navigate to “Account Manager” or “Domain Setup.”

3. Find the “Select PHP Version” option.

4. Choose PHP 8.3 from the list of available versions. Save your changes.

bookmark_borderProtecting SSH With Fail2Ban on Ubuntu 23.04

Hello,

In this week’s feature highlight, How to Protect SSH With Fail2Ban on Ubuntu 23.04

Fail2Ban is an intrusion prevention framework written in the Python programming language. It works by reading SSH, ProFTP, Apache logs, etc. And uses iptables profiles to block brute-force attempts.

Installing the Fail2Ban package

Check for system updates and install them.

apt update -y

apt upgrade -y

Command to install the Fail2Ban

apt install fail2ban -y

Start the fail2ban using below command,

systemctl start fail2ban

Enable fail2ban, run the following command.

systemctl enable fail2ban

Check the status of the service, run the following command.

systemctl status fail2ban

Output:

root@ubuntu:~# systemctl status fail2ban
● fail2ban.service - Fail2Ban Service
     Loaded: loaded (/lib/systemd/system/fail2ban.service; enabled; preset: enabled)
     Active: active (running) since Mon 2023-04-24 19:54:31 UTC; 6s ago
       Docs: man:fail2ban(1)
   Main PID: 3064 (fail2ban-server)
      Tasks: 5 (limit: 3386)
     Memory: 34.4M
        CPU: 1.439s
     CGroup: /system.slice/fail2ban.service
             └─3064 /usr/bin/python3 /usr/bin/fail2ban-server -xf start

Apr 24 19:54:31 ubuntu systemd[1]: Started fail2ban.service - Fail2Ban Service.
Apr 24 19:54:31 ubuntu fail2ban-server[3064]: 2023-04-24 19:54:31,842 fail2ban.configreader   [3064]: WARNING 'allowipv6' no>
Apr 24 19:54:32 ubuntu fail2ban-server[3064]: Server ready

Configuring Fail2Ban

Jail.conf contains a section in which Configuration settings can be done for the fail2ban, we are not going to edit this file because package upgrades can overwrite this file.

Jail.local contains the same sections where “jail.conf” file contains and it can override these values.

Command to create a jail.local configuration file by copying the default jail.conf file.

cp /etc/fail2ban/jail.{conf,local}

Open file to configure.

nano /etc/fail2ban/jail.local

Whitelisting IP addresses

Find the following line in the config file /etc/fail2ban/jail.local and uncomment it to whitelist the IP address.

#ignoreip = 127.0.0.1/8 ::1 

Once you uncomment it, add your IP address at the last of the command For ex.

ignoreip = 192.168.0.100 192.168.1.0/24

Multiple IP address can be whitelisted with the above configuration, they have to be separated with a single white space. You can also white list an IP block as shown above.

Ban settings

3 main options in these settings,

  • bantime: is the number of sec/hours/day that an IP address is banned.
  • findtime: is the window that fail2ban will pay attention to when looking for repeated failed authentication attempts.
  • maxretry: is the maximum try which will be given before blocking.

Find these lines in the config file /etc/fail2ban/jail.local and change as you required.

Default values of the option are,

bantime  = 10m

findtime  = 10m

maxretry = 5

Note: If you want to block IP address permanently use a negative value in the bantime option.

Get e-mail notifications

Note: To receive email alerts, you need to have an SMTP installed on your server.

To receive email alerts with relevant logs, find the following line in the config file /etc/fail2ban/jail.local and make sure that the following line is present.

# ban & send an e-mail with whois report and relevant log lines
# to the destemail.
action_mwl = %(action_)s
             %(mta)s-whois-lines[sender="%(sender)s", dest="%(destemail)s", logpath="%(logpath)s", chain="%(chain)s"]

Configure sending and receiving email addresses.

Find the following line in the config file /etc/fail2ban/jail.local and update the details.

Example:

destemail = admin@xyz.com

sender = root@xyz.com

Fail2ban Client

To interact with the Fail2ban service there is a command-line tool called fail2ban-client.

Check its available options enter the following command.

fail2ban-client -h

Here is a few examples that can be performed by using this tool,

Check the jail status.

fail2ban-client status sshd

To unban an IP.

fail2ban-client set sshd unbanip "IP address here"

To Ban an IP.

fail2ban-client set sshd banip "IP address here"

bookmark_borderInstalling Nextcloud for Ubuntu 23.10 using Snap

Hello,

In this week’s feature highlight, we look at How to Install Nextcloud for Ubuntu 23.10 using Snap

Login to ubuntu 23.10 sever.

Run the following command to download and install Nextcloud.

snap install nextcloud

Output:

root@crown:~# sudo snap install nextcloud
nextcloud 23.0.2snap1 from Nextcloud✓ installed

Now type your IP address in the URL to launch the Nextcloud.

http://server_IP

You will have to create an admin account — Enter the username and password which you want to set.

images

bookmark_borderInstalling and Configure Bitwarden on Ubuntu 23.10

Hello,

In this week’s feature highlight, we look at How to Install and Configure Bitwarden on Ubuntu 23.10

Bitwarden is an open-source password management platform that empowers individuals and organizations to securely store, manage, and share sensitive information, such as passwords, credit card details, and secure notes. With growing concerns about online security and data breaches, Bitwarden provides a reliable and user-friendly solution to the complex problem of password management.

Features of Bitwarden

  • Secure Password Storage: Bitwarden uses end-to-end encryption to safeguard your passwords, ensuring that only you can access your sensitive data.
  • Self-Hosting Option: In addition to Bitwarden’s cloud-hosted services, you have the option to self-host Bitwarden on your own server. This provides you with complete control over your data and enhances your privacy.
  • Two-Factor Authentication (2FA): Bitwarden supports 2FA, adding an extra layer of security to your account.
  • Secure Sharing: Share passwords and other items securely with trusted individuals or groups while maintaining control over who has access.
  • Password Generator: Bitwarden can generate strong, unique passwords for your accounts, reducing the risk of password-related security breaches.

By self-hosting Bitwarden on your Ubuntu server, you can ensure that your sensitive information is stored securely and accessed only by you and trusted individuals. This article will guide you through the installation process, helping you harness the full potential of Bitwarden for your personal or organizational needs.

Pre-requisites:

  • Ubuntu 23.10 installed with root access.
  • A domain with DNS recording pointing to the server’s IP address.
  • Minimum of 2GB RAM available on the server.

Update the System

We will first update the server to latest.

apt-get update

apt-get upgrade

Install Docker and Docker Compose

Bitwarden will be deployed and run on your server, below are the steps to install:

Install docker.io,

apt install docker.io

Once the install is complete, Enable the service so it can auto-start upon reboot,

systemctl enable docker --now

Check the status of the docker service,

systemctl status docker

Confirm that the docker service is running and now we will proceed to install docker compose,

curl -L "https://github.com/docker/compose/releases/download/v2.22.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

At the time of writing this article, Docker compose version 2.22.0 was the latest stable available.
Visit the Docker Compose repository to find the latest version and use that instead.

Next, set the correct permissions so that the docker-compose command is executable.

chmod +x /usr/local/bin/docker-compose

To verify that the installation was successful, you can run the following command.

docker-compose --version

Create a group called docker,

groupadd docker

Add an user into the docker user group,

usermod -aG docker $USER

If you want to add a different user, replace $USER with existing username.

View running docker apps on the server with,

docker ps

example:

root@server:~# docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES

Since no apps are running, you will see an empty list.

Create Bitwarden User and Directory

It is recommend configuring your server with a dedicated bitwarden service account, from which to install and run Bitwarden. Doing so will isolate your Bitwarden instance from other applications running on your server.

Create a Bitwarden user,

adduser bitwarden

Add Bitwarden user to the docker group,

usermod -aG docker bitwarden

Create a Bitwarden directory,

mkdir /opt/bitwarden

Update permissions for the /opt/bitwarden directory,

chmod -R 700 /opt/bitwarden

Update the ownership of the /opt/bitwarden directory,

chown -R bitwarden:bitwarden /opt/bitwarden

Download and Install Bitwarden

Bitwarden provides a script that can be downloaded and executed, which would install the service.

From this point on, we will switch over to the newly created bitwarden user.

su -l bitwarden

output:

root@server:~# su -l bitwarden
bitwarden@server:~$

Change the directory to /opt/bitwarden,

cd /opt/bitwarden

Download the installation script,

curl -Lso bitwarden.sh "https://func.bitwarden.com/api/dl/?app=self-host&platform=linux" && chmod 700 bitwarden.sh

Run the installation script,

./bitwarden.sh

After this, you will be prompted to configure the installation,

  • Enter the domain name for your Bitwarden instance: Enter the domain name that has a DNS record pointing to the server.
  • Do you want to use Let’s Encrypt to generate a free SSL certificate?: Enter y so SSL certificate would be issued.
  • Enter your email address: Enter your email address, this will be used to send certificate expiration notifications.
  • Enter the database name for your Bitwarden instance: Enter a valid database name of your choice.

For the next steps, you will need to register yourself at Bitwarden site with your email address. You will be provided with Installation ID and a Key which will be used below.

images
  • Enter your installation id: Enter the ID here.
  • Enter your installation key: Enter the Key here.
  • Enter your region: Enter the region that was selected at the time of the request.

Output:

$ ./bitwarden.sh install
 _     _ _                         _
| |__ (_) |___      ____ _ _ __ __| | ___ _ __
| '_ \| | __\ \ /\ / / _` | '__/ _` |/ _ \ '_ \
| |_) | | |_ \ V  V / (_| | | | (_| |  __/ | | |
|_.__/|_|\__| \_/\_/ \__,_|_|  \__,_|\___|_| |_|

Open source password management solutions
Copyright 2015-2023, 8bit Solutions LLC
https://bitwarden.com, https://github.com/bitwarden

===================================================

bitwarden.sh version 2023.9.1
Docker version 24.0.5, build 24.0.5-0ubuntu1
Docker Compose version v2.22.0

(!) Enter the domain name for your Bitwarden instance (ex. bitwarden.example.com): bit.domainhere.info

(!) Do you want to use Let's Encrypt to generate a free SSL certificate? (y/n): y

(!) Enter your email address (Let's Encrypt will send you certificate expiration reminders): user@example.com
...
(!) Enter the database name for your Bitwarden instance (ex. vault): bit_vault
...
(!) Enter your installation id (get at https://bitwarden.com/host): YOUR INSTALLATION ID

(!) Enter your installation key: YOUR INSTALLATION KEY

(!) Enter your region (US/EU) [US]: US
...
Installation complete

If you need to make additional configuration changes, you can modify
the settings in `./bwdata/config.yml` and then run:
`./bitwarden.sh rebuild` or `./bitwarden.sh update`

Next steps, run:
`./bitwarden.sh start`

Start Bitwarden

Run the following command to start Bitwarden,

./bitwarden start

Post-Install Configuration

Before you start the Bitwarden service, we have SMTP configuration that can be done.
If you use your own SMTP mail server for sending mails, the following can be configured.

If you do not have your SMTP mail server, you can skip this step.

Edit the file ./bwdata/env/global.override.env,

nano ./bwdata/env/global.override.env

Update the below lines that contain REPLACE with actual SMTP values,

...
globalSettings__mail__smtp__host=REPLACE
globalSettings__mail__smtp__port=587
globalSettings__mail__smtp__ssl=false
globalSettings__mail__smtp__username=REPLACE
globalSettings__mail__smtp__password=REPLACE
globalSettings__disableUserRegistration=false
globalSettings__hibpApiKey=REPLACE
adminSettings__admins=
...

The above configuration will be used to connect to the SMTP mail server that will be used to send verification emails to new users and invitations to organizations.
Adding an email address to adminSettings__admins= will provision access to the admin portal.

Run the following command to apply your changes,

./bitwarden.sh restart

Create your Bitwarden Account

Once the installation and configuration is complete, launch your browser and navigate to your website.

Click on the Create Account,

images

Input the required details in the registration form,

images

Once the account has been created, login using the same.

images

Additional Information

Below are some of the additional commands that are used to manage Bitwarden.

CommandDescription
./bitwarden.sh startStart all containers.
./bitwarden.sh restartRestart all containers (same as start).
./bitwarden.sh stopStop all containers.
./bitwarden.sh updateUpdate all containers and the database.
./bitwarden.sh uninstallStops containers, deletes the bwdata directory and all its contents, and removes ephemeral volumes.

This concludes our topic of installing Bitwarden on Ubuntu 23.10 server.

bookmark_borderInstalling MediaWiki on Ubuntu 23.10

Hello,

In this week’s feature highlight, we look at How to Install MediaWiki on Ubuntu 23.10

MediaWiki is the free open-source wiki software used to power Wikipedia and thousands of other wikis. The contributions of hundreds of individual developers have helped make it a feature-rich, secure and scalable platform capable of powering some of the largest collaboratively edited reference projects in the world.

Update the System

apt update -y

apt upgrade -y 

Install LAMP Stack

Install Linux(Apache, PHP, and MySQL) on system using below command,

apt-get install apache2 mariadb-server php php-mysql libapache2-mod-php php-xml php-mbstring php-intl

Once the installation is complete, enable Apache, (to start automatically upon system boot), start the webserver, and verify the status using the commands below.

systemctl enable apache2

systemctl start apache2 

systemctl status apache2        

also, Enable the MariaDB server using below command,

systemctl enable mariadb

systemctl start mariadb

systemctl status mariadb

Download the MediaWiki

Check out MediaWiki’s Official Site to download the latest version,

cd /tmp/

wget https://releases.wikimedia.org/mediawiki/1.40/mediawiki-1.40.1.tar.gz

Extract the file in your Web Directory,

tar -xvzf /tmp/mediawiki-*.tar.gz

mkdir /var/lib/mediawiki

mv mediawiki-*/* /var/lib/mediawiki

Configuring Apache vHost

Now, create a new Apache configuration file dev.domainhere.info.conf for MediaWiki with the following command.

Replace dev.domainhere.info with the domain name of your own for all the below code examples:

vi /etc/apache2/sites-available/dev.domainhere.info.conf

Now, press i to go to INSERT mode and add the following configuration in the dev.domainhere.info.conf file.

<VirtualHost *:80>

    ServerName dev.domainhere.info
    ServerAlias dev.domainhere.info
    ServerAdmin admin@dev.domainhere.info
    DocumentRoot /var/www/html/mediawiki

    ErrorLog ${APACHE_LOG_DIR}/dev.domainhere.info_error.log
    CustomLog ${APACHE_LOG_DIR}/dev.domainhere.info_access.log combined

    <Directory /var/www/html/mediawiki/>
        Options FollowSymlinks
        AllowOverride All
        Require all granted
    </Directory>

</VirtualHost>

Enable SSL and Rewrite:

a2enmod rewrite

a2ensite dev.domainhere.info

a2enmod rewrite ssl

Restart Apache:

systemctl restart apache2

Enable http and https ( 80/443 )

To enable http and https connection through the firewall, follow the commands:

ufw allow 80/tcp

ufw allow 443/tcp    

Configure MySQL

Create the MySQL user, database using below command,

mysql -u root -p 

CREATE DATABASE my_wiki;

CREATE USER 'mysql_user'@'localhost' IDENTIFIED BY 'Strong_Password';

GRANT ALL ON my_wiki.* TO 'mysql_user'@'localhost';

FLUSH PRIVILEGES;

EXIT

Replace Strong_Password with an actual password.

Configure PHP

Edit the PHP configuration file, php.ini. It is located at /etc/php/8.*/apache2/php.ini, depending on exact version of PHP,

Change the Maximum Upload File Size to 20 M

upload_max_filesize = 20M

To run the PHP script without errors change the Memory Limit to 128M,

memory_limit = 128M

If it is already set to 128M or more, Save the file and exit.

Configure MediaWiki

Create a symlink on /var/lib/mediawiki with the following command,

ln -s /var/lib/mediawiki /var/www/html/mediawiki

It will give you the issue like mbstring and xml are missing even you have to installed them, activate them using below command,

phpenmod mbstring

phpenmod xml

Restart the Apache Service using below command,

systemctl restart apache2.service

Navigate your browser to http://dev.domainhere.info, you’ll get the installation screen like below,

Replace dev.domainhere.info with your actual domain name

images

Select your language and click on continue,

images

Click on Continue to proceed to next,

images

Enter the Database information that was setup earlier on, Database name, username and password.

images

In this case, we want to use the same Database account for the installation, tick the checkbox and click on Continue.

images

Enter the Name of the Wiki site, followed by creating a new Administratot account.

images

Click on Continue to install MediaWiki,

images
images

Next, MediaWiki will provide the settings that was configured so far in the form of a php file. The file with settings should be placed into the web root directory, /var/www/html/meddiawiki/.
Click on the Download LocalSettings.php link, a file will be downloaded to your local system.

Open it with a notepad or similar application.

Copy the contents of the file and Switch over to the server, paste the contents into the file mentioned below:

nano /var/www/html/mediawiki/LocalSettings.php

After pasting the contents to the file, save and exit.

images

Once completed, Click on Enter your Wiki and you will get the MediaWiki Dashboard Page,

images

This concludes the topic of installing MediaWiki on the latest Ubuntu 23.10.

bookmark_borderChristmas Greetings

Hey There!

‘Tis the season to be jolly, and at CrownCloud, we’re filled with gratitude for our wonderful community. 🎁✨ As we celebrate the magic of Christmas, we want to express our deepest thanks for your continued support.

During this festive season, our support team will be online throughout the week, ready to assist you.

May your holiday be filled with the warmth of family, the laughter of friends, and the joy that comes from cherished moments.

Here’s to a Merry Christmas filled with hope, happiness, and success. Wishing you and your loved ones a festive and joyful holiday season!

Warm regards,
Team CrownCloud

bookmark_borderInstalling PHP 8.3 on Debian 12

Hello,
In this week’s feature highlight, we look at How to Install PHP 8.3 on Debian 12

PHP 8.3 is a major update of the PHP language. It contains many new features, such as explicit typing of class constants, deep-cloning of readonly properties and additions to the randomness functionality. As always it also includes performance improvements, bug fixes, and general cleanup.

To install a specific version of PHP on Debian 12, you can use the ondrej/php repository, which provides up-to-date PHP versions. Below are the steps to install PHP 8.3 on Debian 12

Add the Ondrej PHP Repository

Install curl,

apt install curl -y

Add Repository Source and Key,

apt install apt-transport-https

curl -sSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/php/apt.gpg

sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'

apt update

Install PHP 8.3

Install PHP and Extensions and extensions,

apt install php8.3 php8.3-cli php8.3-{bz2,curl,mbstring,intl}

Install FPM or Apache Module,

apt install php8.3-fpm

Check PHP Version using below command,

php -v

Output:

root@vps:~# php -v
PHP 8.3.0 (cli) (built: Nov 25 2023 14:38:38) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.0, Copyright (c) Zend Technologies
    with Zend OPcache v8.3.0, Copyright (c), by Zend Technologies

You have successfully installed PHP 8.3 on Debian 12, unlocking the latest features and improvements in PHP development.