Administrator – Rewardmaniaplay. https://rewardmaniaplay.org/ Your daily briefing for knowledge Wed, 29 May 2024 14:44:30 +0000 en-US hourly 1 https://wordpress.org/?v=6.6.1 Basic UFW Firewall Configuration on Ubuntu 24.04 – Easy Steps https://rewardmaniaplay.org/basic-ufw-firewall-configuration-on-ubuntu-24-04-easy-steps/ https://rewardmaniaplay.org/basic-ufw-firewall-configuration-on-ubuntu-24-04-easy-steps/#respond Wed, 29 May 2024 14:44:30 +0000 https://rewardmaniaplay.org/?p=72368

This guide intends to teach you a Basic UFW Firewall Configuration on Ubuntu 24.04. UFW (Uncomplicated Firewall) is a user-friendly tool for managing firewall rules in Ubuntu. It is designed to be a simple firewall configuration. It is more accessible and easy to use for users rather than iptables.

Here are some key Features of the UFW Firewall:

Simplicity: UFW provides an easy-to-use interface for managing firewall rules.Default Deny Policy: By default, UFW denies all incoming connections and allows all outgoing connections.Predefined Profiles: UFW includes predefined application profiles for common services like SSH, HTTP, and HTTPS.Logging: UFW supports logging, enabling users to monitor and record firewall activity.IPv4 and IPv6 Support: UFW supports both IPv4 and IPv6.

UFW firewall is a great option for those who need to perform basic firewall rules rather than using comprehensive iptables rules. It provides an easy way to increase the security of your Ubuntu OS by controlling incoming and outgoing traffic.

Now you can proceed to the following steps to start setting up a firewall with UFW on Ubuntu 2404.

Learn Basic UFW Firewall Configuration on Ubuntu 24.04

At this point, you need to log in to your system as a root or non-root user with sudo privileges. Then, follow the steps below to start Basic UFW Firewall Configuration on Ubuntu 24.04.

Step 1 – Enable UFW on Ubuntu 24.04

First, you must open your terminal and run the system update with the following command:

sudo apt update

By default, UFW is installed on Ubuntu 24.04. If you don’t have it, you can use the following command to install UFW:

sudo apt install ufw

Then, check your UFW status on Ubuntu 24.04 with the following command:

sudo ufw status

You should see that, your UFW status is inactive:

Example Output
status: inactive

To enable the UFW firewall, you can easily run the command below:

sudo ufw enable

Next, verify your UFW status again, and in your output, you must see the active status:

Example Output
status: active

Now proceed to the next step to learn Basic UFW Firewall Configuration on Ubuntu 24.04.

Step 2 – Allow Connections Through UFW Firewall on Ubuntu 24.04

At this step of Basic UFW Firewall Configuration on Ubuntu 24.04, you will learn to allow traffic through your UFW firewall.

Allow a specific service: To allow a predefined service like SSH, OpenSSH, HTTP, etc, you can use the following syntax:

sudo ufw allow service-name

For example, to allow SSH, you can easily run the following command:

sudo ufw allow ssh

Allow TCP and UDP Ports: Also, you can easily allow TCP and UDP ports through your UFW firewall by using the following syntax:

sudo ufw allow port/tcp-or-udp

For example, open port 80 and 443 in Ubuntu 24.04 with the following commands:

# sudo ufw allow 80/tcp
# sudo ufw allow 443/tcp

For UDP ports, you can use the same syntax, for example:

sudo ufw allow 1194/udp

Also, you can allow port ranges through the UFW firewall with TCP and UDP connections. The syntax looks like:

sudo ufw allow port-range/tcp-or-udp

For example:

# sudo ufw allow 3000:4000/tcp
# sudo ufw allow 3000:4000/udp

Allow All Connections from Specific IP Addresses: You can easily allow all connections from an IP address by using the command below:

sudo ufw allow from your-ip

Note: After changing your UFW rules, you must reload your UFW firewall. To do this, you can run the command below:

sudo ufw reload

After you have added your rules, you may want to know how I check my firewall configuration in Ubuntu. To do this, you can easily, run the following command:

sudo ufw statusStep 3 – Deny and Delete Connections From UFW Firewall on Ubuntu 24.04

At this point of Basic UFW Firewall Configuration on Ubuntu 24.04, if you plan to deny a connection, you can easily use the following syntax on Ubuntu 24.04:

sudo ufw deny service-or-port

For example, to deny port 80, you can run the command below:

sudo ufw deny 80/tcp

Or, to deny a service, you can run the following command:

sudo ufw deny ssh

Also, you can deny all connections from a specific IP address by using the following command:

sudo ufw deny from ip-address

Remember to reload your firewall after any changes by using the command below:

sudo ufw reload

You can use the numbered option to delete a rule from UFW on Ubuntu 24.04 completely. This will list your firewall rules and you can easily delete them by using the rule numbers. For this purpose, you can run the following command:

sudo ufw status numberedExample Output
Status: active

To Action From
— —— —-
[ 1] 22/tcp ALLOW IN Anywhere
[ 2] OpenSSH ALLOW IN Anywhere
[ 3] 80/tcp ALLOW IN Anywhere
[ 4] 1194/udp ALLOW IN Anywhere
[ 5] 22/tcp (v6) ALLOW IN Anywhere (v6)
[ 6] OpenSSH (v6) ALLOW IN Anywhere (v6)
[ 7] 80/tcp (v6) ALLOW IN Anywhere (v6)
[ 8] 1194/udp (v6) ALLOW IN Anywhere (v6)

Then, you can easily use the line number to delete a rule. For example, delete rule number 1 by using the following command:

sudo ufw delete 1

This will ask you for confirmation, if you are sure, press y to continue.

Next, check your firewall configuration, your rule must be deleted from the firewall rules.

Reset and Back to Default Firewall Config in Ubuntu 24.04

At this step of Basic UFW Firewall Configuration on Ubuntu 24.04, you will learn to reset your firewall settings and back to the default config. To do this, you can easily run the following UFW reset command:

sudo ufw reset

This will ask you to reset all rules to installed defaults, if you are sure, press y to continue.

Note: By default, all UFW entries are logged into /var/log/ufw.log file. You can view this file by using the command below:

# sudo more /var/log/ufw.log
# sudo tail -f /var/log/ufw.log

Note: You can visit this guide on Essential UFW Firewall Commands and Rules to learn more advanced usage of UFW. Also, if you are looking for a GUI version of UFW, you can check this link.

Conclusion

At this point, you have learned Basic UFW Firewall Configuration on Ubuntu 24.04 including enabling UFW, allowing and denying connections, deleting rules by using numbered options, resetting rules, and back to default settings. UFW is an easy-to-use tool that you can improve your Ubuntu security by knowing the rules. Hope you enjoy using it.

To get more information, you can visit the official page.

]]>
https://rewardmaniaplay.org/basic-ufw-firewall-configuration-on-ubuntu-24-04-easy-steps/feed/ 0
Easily Create a Sudo User on Ubuntu 24.04 From Terminal – Best Practices https://rewardmaniaplay.org/easily-create-a-sudo-user-on-ubuntu-24-04-from-terminal-best-practices/ https://rewardmaniaplay.org/easily-create-a-sudo-user-on-ubuntu-24-04-from-terminal-best-practices/#respond Wed, 29 May 2024 14:40:36 +0000 https://rewardmaniaplay.org/?p=72365

This guide intends to teach you to Create a Sudo User on Ubuntu 24.04 From Terminal. In Ubuntu 24.04, a sudo user is a regular user who has access to administrative privileges for running commands with root privileges. This can be done by running commands with sudo, “superuser do.” You can use sudo for many tasks, such as installing software, modifying system configurations, and managing users, without logging in as the root user.

Here are some tasks you can do with a sudo user on Ubuntu 24.04:

Get Admin Points: A sudo user can temporarily get root privileges to run commands that need higher permissions.Security: Using sudo reduces the security risks instead of using root users.Accountability: Sudo logs all commands executed with high-score privileges. It provides an audit trail for administrative actions.

To see how to Create a Sudo User on Ubuntu 24.04, you can follow the steps below.

Simple Guide Steps To Create a Sudo User on Ubuntu 24.04

To Create a Sudo User on Ubuntu 24.04, you need to log in to your server, open a terminal CLI, and follow the steps below. You can SSH to your server as a root user. Here we log in as a non-root user with sudo privileges.

First, you must run the system updates with the command below:

sudo apt updateAdd a New Sudo User on Ubuntu 24.04

You can easily use the adduser command to Create a Sudo User on Ubuntu 24.04. The syntax command looks like this:

adduser username

For example, we create a user named noble with the following command:

sudo adduser noble

You must set a password for your user and other information. You can leave the other information blank by pressing enter. Your output should look like this:

Then, you can add your user to the sudoers for getting admin privileges. For this purpose, you can use the usermod command. This will help you to add your users to the sudoers group. The syntax command looks like this:

usermod -aG sudo username

For example, for adding the noble user to the sudoers, we can use the command below:

sudo usermod -aG sudo noble

Note: All users’ details are stored in a file named the /etc/passwd file. To verify that the user was created, you can view this file using the cat command or view more details with the id command:

# cat /etc/passwd | grep noble
# id noble

In your output, you will see:

Check User details on Ubuntu 24.04

Next, you can switch to your new user account from the terminal by using the following command:

su – noble

You must enter the user password and try to run the commands by using the sudo. For example, run the system update:

Test Sudo user on Ubuntu 24.04

Note: It is recommended to consider the following practices for sudo user:

Only use sudo when necessary to reduce potential security risks.After completing admin tasks, log out of the sudo session to reduce the risk of accidental system changes.Regularly check the sudo logs in /var/log/auth.log to monitor the usage of sudo privileges.

Also, if you plan to remove the users, you can proceed to the next step.

Delete Users on Ubuntu 24.04

At this point, if you would like to delete and remove your user, you can use the following syntax:

deluser username

For example, to delete the noble user, we can execute the following command:

sudo deluser noble

Also, you can delete the user with its home directory by using the following command:

sudo deluser noble –remove-home

That’s it, you are done.

Conclusion

A sudo user in Ubuntu 24.04 is a regular user who can execute commands with root privileges using the sudo command. This user setup allows users to do admin tasks without logging in as the root user. As you can see, you can easily Create a Sudo User on Ubuntu 24.04 From Terminal CLI. Also, you can easily remove and delete a user with its home directory with the deluser command.

Hope you enjoy it. If you are interested in Ubuntu 24.04, you can also check the following articles:

Basic UFW Firewall Configuration on Ubuntu 24.04

Set a Static IP Address on Ubuntu 24.04 Via GUI

Ubuntu 24.04 LTS Desktop Installation

]]>
https://rewardmaniaplay.org/easily-create-a-sudo-user-on-ubuntu-24-04-from-terminal-best-practices/feed/ 0
Secure Ubuntu 24.04 with AppArmor – Complete Setup Tutorial https://rewardmaniaplay.org/secure-ubuntu-24-04-with-apparmor-complete-setup-tutorial/ https://rewardmaniaplay.org/secure-ubuntu-24-04-with-apparmor-complete-setup-tutorial/#respond Wed, 29 May 2024 14:36:36 +0000 https://rewardmaniaplay.org/?p=72362

In this guide, you will learn a complete setup tutorial to Secure Ubuntu 24.04 with AppArmor. AppArmor which stands for Application Armor is a Linux Kernel security module. It is used to increase the security of the operating system by limiting the access that applications have to the system’s resources. Also, it uses profiles to define the restrictions for each application.

AppArmor acts in two modes which are:

Enforcement Mode: Actively enforces the restrictions defined in the profiles.Complain Mode: Logs policy violations without enforcing them. It is useful for testing and refining profiles.

Now follow the steps below to Secure Ubuntu 24.04 with AppArmor.

Easily Learn to Secure Ubuntu 24.04 with AppArmor

By default, AppArmor comes pre-installed on Ubuntu 24.04 and can be easily enabled and configured. You must log in to your Ubuntu 24.04 as a root or a non-root user with sudo privileges. To create a sudo user, you can check this guide on Create a Sudo User on Ubuntu 24.04 From Terminal.

Step 1 – Enabling and Checking AppArmor Status on Ubuntu 24.04

As we said, AppArmor is installed by default on Ubuntu 24.04 and must be enabled. To verify AppArmor is enabled, you can run the following command:

cat /sys/module/apparmor/parameters/enabled

In your output, you should get Y which means your AppArmor is enabled. But, if you don’t get the Y output, you can easily enable AppArmor using the Linux kernel command line in the bootloader. To do this, run the following commands:

# sudo mkdir -p /etc/default/grub.d

# echo ‘GRUB_CMDLINE_LINUX_DEFAULT=”$GRUB_CMDLINE_LINUX_DEFAULT apparmor=1 security=apparmor”‘
| sudo tee /etc/default/grub.d/apparmor.cfg

# sudo update-grub
# sudo reboot

At this point, you can check your current AppArmor profile status for each app on Ubuntu 24.04. To do this, run the following command:

sudo aa-status

In your output, you will see something similar to this:

As you can see from the output, 134 profiles are loaded and 45 profiles are in enforce mode.

Step 2 – Change AppArmor Profile Modes on Ubuntu 24.04

In this step of Secure Ubuntu 24.04 with AppArmor, if you plan to change your profile modes, you can easily follow the steps below.

To set your profile to complain mode, you can use the following command:

sudo aa-complain your-profile

For example, to set the /usr/bin/man profile to the complain mode, you can run the command below:

sudo aa-complain /usr/bin/man

To set your profile to enforce mode, you can easily use the following command:

sudo aa-enforce your-profile

For example, to set the /usr/bin/man profile to the enforce mode, you can run the command below:

sudo aa-enforce /usr/bin/man

Also, you can modify changes to all profiles. You can set all profiles to enforce or complain mode. To do this, you can use the following commands:

sudo aa-complain /etc/apparmor.d/* #complain-mode

sudo aa-enforce /etc/apparmor.d/* #enforce-mode

Note: If you get any command not found error with AppArmor commands, you must install the AppArmor Utils to fix it. To do this, run the following command:

sudo apt install apparmor-utilsStep 3 – How To Create a New Profile with AppArmor on Ubuntu 24.04?

In this step of setup to secure Ubuntu 24.04 with AppArmor, you will learn to create a new profile. First, you must find the applications that need security they haven’t any profile in AppArmor. For this purpose, you can run the following command:

sudo aa-unconfined

In your output, you will see something similar to this:

Secure Ubuntu 24.04 with AppArmor - Create a new profile

Once you find the applications that are not confined, you can use the following command to create a profile for them:

sudo aa-genprof unconfined-app

It will start to create your profile. During the process, press F to finish your setup. By default, it will created as the enforce mode. You can easily change the profile mode like the previous step.

Next, you must reload your AppArmor service to apply the changes:

sudo systemctl reload apparmor.service

At this point, you have learned to Secure Ubuntu 24.04 with AppArmor, let’s see how you can delete a profile and disable AppArmor.

Step 4 – Delete a Profile and Disable AppArmor on Ubuntu 24.04

If you plan to delete a profile from AppArmor, you can navigate to your AppArmor directory with the command below:

cd /etc/apparmor.d/

Then, display all profiles by using the command below:

ls

Now you can easily use the command below to delete an AppArmor profile on Ubuntu 24.04:

rm your-desired profile

If you want to disable your AppArmor service, you can stop the service and disable it by using the following commands:

# sudo systemctl stop apparmor
# sudo systemctl disable apparmor

Also, you can remove the AppArmor completely from your server with the command below:

sudo apt remove –assume-yes –purge apparmor

That’s it, you are done. To get more information, you can visit the official Ubuntu website.

Conclusion

At this point, you have learned to Secure Ubuntu 24.04 with AppArmor. You can easily enable AppArmor, change the profile modes, and create a new profile for unconfined applications. This will help you to increase your system security and reduce potential attacks. Hope you enjoy using it.

Also, you may interested in the following articles:

UFW Firewall Setup on Ubuntu 24.04

Install and Use Metasploit on Ubuntu 22.04

Set up AIDE on Ubuntu 22.04

]]>
https://rewardmaniaplay.org/secure-ubuntu-24-04-with-apparmor-complete-setup-tutorial/feed/ 0
Ubuntu 24.04 XAMPP Setup – Ultimate Easy Guide https://rewardmaniaplay.org/ubuntu-24-04-xampp-setup-ultimate-easy-guide/ https://rewardmaniaplay.org/ubuntu-24-04-xampp-setup-ultimate-easy-guide/#respond Wed, 29 May 2024 14:32:19 +0000 https://rewardmaniaplay.org/?p=72359

This guide intends to teach you Ubuntu 24.04 XAMPP Setup Installation and Configuration. XAMPP is a free, open-source, and cross-platform web server stack package. It includes Apache, MariaDB, PHP, and Perl programming languages. Also, it includes other useful tools like phpMyAdmin for managing MySQL databases, FileZilla FTP server, and Mercury Mail Transport System for email. XAMPP is designed to be user-friendly with easy installation and pre-configured. You can use XAMPP for your web development, testing, and learning.

Now you can proceed to the following steps to start the Ubuntu 24.04 XAMPP Setup installation.

Step-by-step Guide for Ubuntu 24.04 XAMPP Setup

Before you begin your Ubuntu 24.04 XAMPP setup, you must log in to your server as a non-root user with sudo privileges. Then, open your terminal and follow the steps below to complete this guide.

Step 1 – Download and Install the XAMPP on Ubuntu 24.04

First, you must run the system update and upgrade with the following command:

sudo apt update && sudo apt upgrade -y

Then, you must visit the official downloads page and download the latest package for Linux with the latest PHP version. In this case, you can use the following wget command:

sudo wget https://sourceforge.net/projects/xampp/files/XAMPP%20Linux/8.2.12/xampp-linux-x64-8.2.12-0-installer.run

Once your download is completed, you must make your file executable by using the following command:

sudo chmod 755 xampp-linux-x64-8.2.12-0-installer.run

This will launch the XAMPP setup wizard on Ubuntu 24.04. Follow the instructions and install XAMPP.

Start XAMPP From Terminal on Ubuntu 24.04

Note: Uncheck if you don’t want to launch XAMPP from the setup wizard. Then, you can start XAMPP from the terminal command line by using the following command:

sudo /opt/lampp/lampp restart

With this command, your XAMPP must be opened and started. If you get the following error with the above command, it means that your Net Tools package is not installed on your Ubuntu 24.04.

Fix XAMPP Failed to start - netstat command not found

To fix this error, you can easily install the net-tools package with the command below:

sudo apt install net-tools

Then, rerun the XAMPP command to restart your service.

Step 2 – Allow All To Access XAMPP on Ubuntu 24.04

To allow everyone to access XAMPP, you must open the /opt/lampp/etc/extra/httpd-xampp.conf file and add a line ” Require all granted” and comment out or delete the line “Require local“.

You can use your favorite text editor like Vi editor or Nano editor to open the file:

sudo vi /opt/lampp/etc/extra/httpd-xampp.conf

Your file must look like this:

Allow All To Access XAMPP on Ubuntu 24.04

Once you are done, save and close the file. Then, restart XAMPP to apply the changes:

sudo /opt/lampp/lampp restartStep 3 – Verify XAMPP Installation – Access it via Web Browser

At this point, you can access your XAMPP via the web interface by typing localhost or server’s IP address in your web browser:

http://localhost

You will see the welcome page means that your XAMPP is successfully installed. Also, you can click on the phpMyAdmin tab to open it. Or you can use the following URL:

http://localhost/phpmyadminVerify XAMPP installation Ubuntu 24.04Step 4 – Stop and Uninstall XAMPP From Ubuntu 24.04

Now you have learned Ubuntu 24.04 XAMPP Setup installation and configuration. If you want to uninstall XAMPP from your server, you can follow the steps below.

First, use the following command to stop the service:

sudo /opt/lampp/lampp stop

Then, navigate to the XAMPP installation directory with the following command:

cd /opt/lampp

Next, run the uninstall program command:

sudo ./uninstall

You will be asked to delete XAMPP and all the modules, if you are sure, press yes. Wait until the process is completed and press OK.

Uninstall XAMPP from Ubuntu

Finally, remove the XAMPP directory with the following command:

sudo rm -r /opt/lamppConclusion

XAMPP is a powerful tool for anyone looking to set up a local web server environment quickly and easily. At this point, you have learned a complete Ubuntu 24.04 XAMPP Setup installation and configuration. Hope you enjoy using it.

Also, you can increase your Ubuntu system security by using AppArmor. For this purpose, you can visit this guide on AppArmor Setup on Ubuntu 24.04.

]]>
https://rewardmaniaplay.org/ubuntu-24-04-xampp-setup-ultimate-easy-guide/feed/ 0
Best Ubuntu 24.04 PHP Setup – Default Version and Install Older Versions https://rewardmaniaplay.org/best-ubuntu-24-04-php-setup-default-version-and-install-older-versions/ https://rewardmaniaplay.org/best-ubuntu-24-04-php-setup-default-version-and-install-older-versions/#respond Wed, 29 May 2024 14:12:12 +0000 https://rewardmaniaplay.org/?p=72356

In this guide, we want to discuss Ubuntu 24.04 PHP Setup including what is the default version, how to install it, and if you need older PHP versions, you will learn how to set it up. As you must know, PHP is a popular, free, open-source, and cross-platform scripting language. PHP is known for its ease of use, flexibility, and ability to be embedded directly into HTML.

Default PHP Version in Ubuntu 24.04

Let’s start with the default PHP version on Ubuntu 24.04. You must access your server as a root or non-root user with sudo privileges. Then, open a terminal and follow the steps below.

Ubuntu 24.04 ships with the latest PHP version which is PHP 8.3. You can read more about this current stable version of PHP on Introducing PHP 8.3.

First, you need to run the system update and upgrade by using the following command:

sudo apt update && sudo apt upgrade -y

Then, you can easily use the following command to install the default PHP:

sudo apt install php -y

Once your installation is completed, you can verify your Ubuntu 24.04 PHP Setup:

php -v

You must see that your default PHP version is PHP 8.3:

Also, if you want to install PHP extensions, you can use the command below to install the most common PHP extensions:

sudo apt install libapache2-mod-php php8.3-common php8.3-cli php8.3-mbstring php8.3-bcmath php8.3-fpm php8.3-mysql php8.3-zip php8.3-gd php8.3-curl php8.3-xml -yTest PHP 8.3 Installation on Ubuntu 24.04

At this point, you can create a test PHP file in the Web root to see if PHP working correctly. First, you need to install Apache and enable it by using the following commands:

# sudo apt install apache2 -y
# sudo systemctl start apache2
#sudo systemctl enable apache2

Then, you need to create a php.info file in the web root directory. You can use Vi Editor or Nano Editor:

sudo vi /var/www/html/info.php

Add the following PHP code to the file:

<?php
phpinfo();
?>

Once you are done, save and close the file. Then, restart Apache to apply the changes:

sudo systemctl restart apache2

Now you can open your desired web browser and follow the URL below to read your PHP info file:

http://localhost-or-ip/info.php

You should see the following screen:

Verify PHP Installation Ubuntu 24.04

It means that you have successfully finished Ubuntu 24.04 PHP Setup.

Ubuntu 24.04 PHP Setup – Older PHP Versions

At this point, if you plan to use the older PHP versions on Ubuntu 24.04, you need to remove the PHP version installed on your server, then, add the PPA Odrenj repo, and install other PHP versions. To do this, follow the steps below.

First, remove the PHP version installed on your server with the following command:

# sudo apt purge php8.* -y
# sudo apt autoclean
# sudo apt autoremove

Then, install the following required packages:

sudo apt -y install lsb-release apt-transport-https ca-certificates

Next, you need to add the PPA repository with the following command on Ubuntu 24.04:

sudo add-apt-repository ppa:ondrej/php

Once you are done, run the system update to apply the changes:

sudo apt updateInstall PHP 8.2 / PHP 7.4 on Ubuntu 24.04

At this point, you can easily use the following commands to install your desired PHP version.

For PHP 8.2, you can run the following command:

sudo apt install php8.2 -y

For PHP 7.4, you can easily run the command below:

sudo apt install php7.4 -y

Then, you can verify your PHP installation by checking its version.

That’s it, you are done. For more information, you can visit the official website.

Conclusion

At this point, you have learned Ubuntu 24.04 PHP Setup. As you saw, Ubuntu 24.04 ships with the latest PHP version which is PHP 8.3. Also, if you need older PHP versions for specific apps, you can easily add the PPA repo and install older versions of PHP on Ubuntu 24.04.

Hope you enjoy it. Also, you may like to read the following articles:

Upgrade Default PHP to PHP 8.3 in Debian / Ubuntu

Install PHP 8.3 on Centos 7

Best Way To Get PHP 7.4 on Debian 12 Bookworm

]]>
https://rewardmaniaplay.org/best-ubuntu-24-04-php-setup-default-version-and-install-older-versions/feed/ 0
Caddy Web Server on Ubuntu 24.04: Easy Setup Tutorial https://rewardmaniaplay.org/caddy-web-server-on-ubuntu-24-04-easy-setup-tutorial/ https://rewardmaniaplay.org/caddy-web-server-on-ubuntu-24-04-easy-setup-tutorial/#respond Wed, 29 May 2024 14:08:12 +0000 https://rewardmaniaplay.org/?p=72353

In this guide, you will learn to Install and Configure Caddy Web Server on Ubuntu 24.04. Caddy is a powerful and user-friendly web server. It is known for its flexibility, ease of use, and security. By default, Caddy comes with automatic HTTPS, making it a great choice for those looking for security. Also, it has an easy configuration to configure your web server via a Caddy Config file.

Now you can proceed to the following steps to set up Caddy Web Server on Ubuntu 24.04.

Beginner’s Guide to Caddy Web Server on Ubuntu 24.04

To complete Caddy Web Server Setup on Ubuntu 24.04, you must log in to your server as a non-root user with sudo privileges. Also, you need a valid domain name that is pointed to your server’s IP address.

Then, follow the steps below to begin your Caddy installation setup on Ubuntu 24.04.

Step 1 – Install Caddy on Ubuntu 24.04 Noble Numbat

By default, the Caddy package is available on the Ubuntu 24.04 default repository. So you can easily install Caddy. First, run the system update with the following command:

sudo apt update

Then, use the following command to install Caddy on Ubuntu 24.04:

sudo apt install caddy -y

Once your installation is completed, verify it by checking its version:

caddy versionOutput
2.6.2

At this point, you must allow the Caddy binary to connect to privileged ports like 80 and 443 with the following command:

sudo setcap ‘cap_net_bind_service=+ep’ /usr/bin/caddyStart and Enable Caddy on Ubuntu 24.04

After your installation is completed, you must start and enable Caddy Web Server on Ubuntu 24.04. To do this, you can use the following commands:

# sudo systemctl start caddy
# sudo systemctl enable caddy

Next, you can verify your Caddy web server is active and running on Ubuntu 24.04:

sudo systemctl status caddy

In your output, you should see:

Now proceed to the following step to configure PHP for Caddy setup.

Step 2 – Configure PHP for Caddy on Ubuntu 24.04

At this point, you must install PHP and the required PHP extensions on your server. Ubuntu 24.04 ships with the PHP 8.3. So you can use the following command to install PHP and the required extensions:

sudo apt install php php-fpm php-mysql php-curl php-gd php-mbstring php-common php-xml php-xmlrpc -y

Note: You can read more by visiting PHP Setup on Ubuntu 24.04.

Next, you must edit the PHP-FPM config file and set the default user to the Caddy user. To do this, open the PHP-FPM config file with your desired text editor like Vi Editor or Nano Editor:

sudo vi /etc/php/8.3/fpm/pool.d/www.conf

Find the following lines and set them to Caddy as shown below:

user = caddy
group = caddy
listen.owner = caddy
listen.group = caddy

Once you are done, save and close the file.

Then, restart the PHP-FPM service to apply the changes with the command below:

sudo systemctl restart php8.3-fpmStep 3 – Set up the Caddy Virtual Host File on Ubuntu 24.04

The Caddy default virtual host configuration file is located at /etc/caddy/Caddyfile. You can easily edit this file and make your changes. Open the file with the command below:

sudo vi /etc/caddy/Caddyfile

You can remove or comment on the lines, and add the following lines to the file:

your-domain-name:80 {
root * /usr/share/caddy/
encode gzip zstd
php_fastcgi unix//run/php/php8.3-fpm.sock
}

Once you are done, save and close the file. Then, create a sample PHP file for Caddy with the following command:

sudo vi /usr/share/caddy/info.php

Add the following content to the file:

<?php
phpinfo();
?>

When you are done, save and close the file.

Finally, restart the Caddy Web Server on Ubuntu 24.04 to apply the changes:

sudo systemctl restart caddy

Now you can open the following URL in your web browser and see that your Caddy is working correctly:

http://your-domain-name/info.php

You must see the PHP info page and other information.

When you have finished reading your PHP info, it’s better to remove your PHP file for more security.

sudo rm -rf /usr/share/caddy/info.php

For more information, you can check the official documentation.

Conclusion

At this point, you have learned to easily install and configure the Caddy Web Server on Ubuntu 24.04. It is an easy-to-use, secure, and flexible web server. The default automatic HTTPs option and its easy configuration make it a great option for users. Hope you enjoy using it.

Also, you may like to read the following articles:

Install and Configure XAMPP on Ubuntu 24.04

Install Caddy Web Server on AlmaLinux 9

Lighttpd Web Server Installation on Debian 12

]]>
https://rewardmaniaplay.org/caddy-web-server-on-ubuntu-24-04-easy-setup-tutorial/feed/ 0
Disk Space Ubuntu 24.04: Find Amount of Free Space in Easy Steps https://rewardmaniaplay.org/disk-space-ubuntu-24-04-find-amount-of-free-space-in-easy-steps/ https://rewardmaniaplay.org/disk-space-ubuntu-24-04-find-amount-of-free-space-in-easy-steps/#respond Wed, 29 May 2024 14:05:07 +0000 https://rewardmaniaplay.org/?p=72350

This guide intends to teach you how to find the Disk Space Ubuntu 24.04. As you must know, Disk Space is the storage available on the hard drive or SSD. This space stores the operating system, applications, files, and data. You can use different methods such as a desktop disk usage analyzer or various Linux commands like df and du. You can easily follow the steps below and see how you can find disk space Ubuntu 24.04.

Steps To Check Disk Space Ubuntu 24.04

Before you start checking Disk Space Ubuntu 24.04, you must log in to your server as a root or non-root user with sudo privileges. To learn how to create a sudo user, you can check this guide on Creating a New Sudo User on Ubuntu 24.04. Then, follow the steps below to complete this guide.

Method 1 – Disk Usage Analyzer (Baobab) on Ubuntu 24.04

The Disk Usage Analyzer also known as Baobab, is a graphical tool that helps analyze disk usage on Ubuntu 24.04. It provides a user-friendly interface to check how disk space is allocated and identify large files and directories that take up space.

By default, Baobab is preinstalled on Ubuntu 24.04. If it’s not installed, you can install it using the following command:

sudo apt install baobab

To access the Disk usage analyzer, from the Activities, type disk usage analyzer. Then, open the application. Then, click on Scan Folder and select the desired directory or filesystem you want to scan. It will start scanning and display the results in a graphical format. From there, you can click on segments to explore large directories and files.

As you can see, the disk usage analyzer provides a graphical display of disk usage. it helps you to check and clean up large files and directories. To learn more about Baobab, you can visit this link from Gnome.

Now you can proceed to the next step to see how you can check disk space Ubuntu 24.04 from the terminal command line.

Method 2 – Display Disk Space on Ubuntu 24.04 From Terminal

If you are interested in using Linux commands and check your disk space from terminal, you can follow the steps below.

The first comamnd that you can use is df comamnd. It is used for displaying the amount of disk space used by Linux file systems. You can easily open your terminal and run the follwoing comamnd to see your results in human readable format:

df -h

The second comamnd is du comamnd. It will show the amount of disk space used by directories and files. To do this, you can simpky run the command below:

du -h

The results should somthing similar to this:

Display Disk Space on Ubuntu 24.04 From Terminal

Also, you can use the df command with the T option to display other information:

df -T

With the du command, you can specify the path of directory you want to check. It will display the total disk space usage of the specified directory.

du -h path/to/directory

Note: To list information about all available or the specified block devices, you can use the lsblk command.This can show you the size of your disk partitions.

lsblkConclusion

At this point, you have learned various methods for cheking Disk Space Ubuntu 24.04. As you saw, n Ubuntu 24.04, you have both graphical tools and command-line utilities to check your disk space. Remember to regularly check disk usage and clean up unnecessary files for optimal performance.

Hope you enjoy it. Also, you may like to read the follwoing articles:

12 Commands to Check Linux System and Hardware Information

Create RAM Disk on Linux Command Line Terminal

Completely Remove a Package From Ubuntu

Uninstall MySQL Server from Ubuntu Completely

]]>
https://rewardmaniaplay.org/disk-space-ubuntu-24-04-find-amount-of-free-space-in-easy-steps/feed/ 0
A Comprehensive Guide To Wireshark Setup on Ubuntu 24.04 https://rewardmaniaplay.org/a-comprehensive-guide-to-wireshark-setup-on-ubuntu-24-04/ https://rewardmaniaplay.org/a-comprehensive-guide-to-wireshark-setup-on-ubuntu-24-04/#respond Wed, 29 May 2024 14:04:16 +0000 https://rewardmaniaplay.org/?p=72347

In this guide, you will learn Wireshark setup on Ubuntu 24.04. Wireshark is a powerful option if you are looking for a network protocol analyzer tool. It is used for network troubleshooting, analysis, software and protocol development, and education. Wireshark offers a graphical user interface that makes it easier to navigate through captured data.

Ubuntu 24.04 ships with the latest versions of Wireshark. You can easily use the default repository and install Wireshark on Ubuntu 24.04. Follow the steps below to get a complete Wireshark setup on Ubuntu 24.04.

Easy Steps To Wireshark Setup on Ubuntu 24.04

To complete Wireshark Setup on Ubuntu 24.04, you must log in to your server as a non-root user with sudo privileges. Then, open a terminal and follow this instruction to install Wireshark on Ubuntu 24.04.

Step 1 – Installing Wireshark on Ubuntu 24.04 From Terminal

First, you must run the system update and upgrade by using the following command:

sudo apt update && sudo apt upgrade -y

Then, you can use the following command to install Wireshark on Ubuntu 24.04:

sudo apt install wireshark -y

This will install all the required packages and dependencies.

Note: During the installation, you will be asked if you want non-superusers to be able to run Wireshark. It depends on you, if you select No, you must add each user individually to the ‘wireshark’ user group.

Get Wireshark Command Line Utility (Optional)

Wireshark provides a command line utility for those who want to work with it from the terminal. The Wireshark command line utility is called tshark. To install it, you can run the following command:

sudo apt install tshark -y

To learn how to work with the command line utility, you can use the help command:

tshark –help

In your output, you should see:

Wireshark Command Line UtilityStep 2 – Access Wireshark Network Protocol Analyzer on Ubuntu 24.04

Once your installation is completed, you can easily launch your app from a terminal or desktop. From your terminal command line, you can run the command below to launch Wireshark:

wireshark

Or, from your Activities, you can search for Wireshark and open the app.

These will launch your Wireshark app. It will look like this:

Access Wireshark Network Protocol Analyzer on Ubuntu 24.04

Once Wireshark is up and running, you can start capturing packets by selecting the network interface you want to monitor. You need to do the following steps:

Select an Interface: Click on the interface you want to capture traffic from.Start Capture: Click the “Shark Fin” icon or press Ctrl+E to start capturing.Apply Filters: Use the filter bar at the top to apply display filters.

For more information and to learn to use Wireshark, you can visit the Wireshark Documentation.

Step 3 – Manage Wireshark – Update and Uninstall

At this point, you have completed Wireshark Setup on Ubuntu 24.04. Now you can easily update your app from the terminal by using the command below:

sudo apt update && sudo apt upgrade -y

Also, if you no longer need Wireshark, you can easily remove it by using the following command:

# sudo apt remove wireshark
# sudo apt remove tshark

You can run the auto-clean command to remove the unused packages:

# sudo apt autoclean
# sudo apt autoremoveConclusion

At this point, you have learned Wireshark Setup on Ubuntu 24.04 From the APT repository. With Ubuntu 24.04, you get the latest version with all the enhancements and features that make network monitoring and packet analysis more efficient and comprehensive. Wireshark provides the detailed info you need to understand your network protocols.

If you have any specific questions about using Wireshark or network analysis on Ubuntu 24.04, feel free to ask. Hope you enjoy it. Also, you may like to read the following articles:

Find the Amount of Free Space in Ubuntu 24.04

Darkstat Web-Based Linux Network Traffic Analyzer

Configure Network Bridge on AlmaLinux 9

Network Monitoring in Debian With Sniffnet Tool

Installing bmon on Ubuntu 22.04

]]>
https://rewardmaniaplay.org/a-comprehensive-guide-to-wireshark-setup-on-ubuntu-24-04/feed/ 0