05 July 2023

What Is OwnCloud & How To Install In Ubuntu 20.04

What Is OwnCloud?

Individuals and organizations can securely store, access, and share their files and documents using the self-hosted file synchronization and sharing platform known as OwnCloud. In contrast to cloud storage services like Dropbox, Google Drive, or OneDrive, it offers customers complete control over their data, serving as an alternative.

With OwnCloud, you may construct a private cloud storage solution on your own server or by using a hosting company. It offers capabilities like file synchronization between several devices, file sharing, group document editing, and data backup. The platform provides clients for many operating systems, such as Windows, macOS, Linux, Android, and iOS, enabling smooth file access from numerous devices.

One of OwnCloud’s main benefits is that you can store your data on your own servers or those of a reputable hosting company, guaranteeing that you will always have ownership and control over your files. Additionally, it offers options for encryption to increase security during file transfers and storage.

OwnCloud provides a number of extensions and plugins to enhance its functionality in addition to the essential file synchronization and sharing features. Task management, music streaming, calendar and contact synchronization, and interaction with other services like Microsoft Office Online or Collabora Online for group editing are a few of them.

Overall, OwnCloud offers a versatile and adaptable cloud storage option that enables people and organizations to manage their files, share information, and collaborate while still having complete control over their data.

How To Install OwnCloud In Ubuntu 20.04?

1 System Packages Update:-

Use the apt command below to update the system packages and repositories before you begin.

# apt update -y && apt upgrade -y

2 Install  Apache, MariaDB, And PHP Packages:-

How to install MariaDB and use MariaDB redhat

( 1 ) Apache:-  Apache Server is a free and open-source web server software that allows websites to be hosted on the Internet. An Apache server is a software program that is based on one computer and provides access to devices and websites on that computer to other computers on the Internet.

( 2 ) MariaDB:- Similar to MySQL, MariaDB is made to use tables, columns, and rows to store and manage structured data. It provides several programming interfaces and connectors for various computer languages, as well as SQL (Structured Query Language) for querying and modifying data.

( 3 ) PHP:- PHP is used to create OwnCloud, which is normally accessed through a web interface. To serve Owncloud files, as well as PHP  and other PHP modules required for OwnCloud to run efficiently, we will install the Apache webserver for this reason.

# apt install -y \
  apache2 libapache2-mod-php \
  mariadb-server openssl redis-server wget php-imagick \
  php-common php-curl php-gd php-gmp php-bcmath php-imap \
  php-intl php-json php-mbstring php-mysql php-ssh2 php-xml \
  php-zip php-apcu php-redis php-ldap php-phpseclib

3 By using the dpkg command after the installation is finished, you can check to see if Apache was installed:- 

# dpkg -l apache2

4 Run the commands to launch Apache and allow it to start automatically:-

( 1 ) Start:- Start Apache2 Service

# systemctl start apache2

( 2 ) Enable:- Use of this command  ” enable ”  automatically boot time. start Apache2 service

# systemctl enable apache2

( 3 ) Status:- Check service running

5 Check if PHP is installed. And version:-

# php -v

6 MariaDB Secure installation:-

MariaDB, just like MySQL is the default. secure Therefore, you must take another step and run the mysql_secure_installation script.

You are guided through a series of prompts by the Running command. You will need to create a root password first. The default root user unix socket authentication in MariaDB is insufficiently secure.

So, decline from using the Unix socket authentication by pressing  ” n ” and hitting

# 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
you haven’t set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): [Press Enter]

OK, successfully used password, moving on…

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n]  [ Press Y ]

New password:                  [ redhat@123 ]
Re-enter new password:   [ redhat@123 ]
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] [ press 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] [ Press 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] [ Press 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] [Press 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!

7 Create MariaDB Database:-

To store files both during and after installation, we must build a database for Owncloud. Therefore, log into MariaDB.

mysql -u root -p

Enter password: redhat@123

MariaDB [(none)]> CREATE DATABASE highsky_db;
MariaDB [(none)]> GRANT ALL ON highsky_db.* TO 'harry'@'localhost' IDENTIFIED BY 'redhat@123';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT

8 Download OwnCloud:-

wget https://download.owncloud.com/server/stable/owncloud-complete-latest.tar.bz2

9 Extract Directory:-

# tar -xjf owncloud-complete-latest.tar.bz2
# ls

10 Set Then permissions:-

# chown -R www-data:www-data owncloud
# chmod -R 755 owncloud

11 MV This Directory

mv owncloud /var/www/

12 Apache Configure for OwnCloud:-

We will set up Apache to serve OwnCloud’s files at this stage. To accomplish that, we will make the aforementioned Owncloud setup file.

# vim /etc/apache2/conf-available/owncloud.conf
Alias /owncloud "/var/www/owncloud/"

<Directory /var/www/owncloud/>
  Options +FollowSymlinks
  AllowOverride All

 <IfModule mod_dav.c>
  Dav off
 </IfModule>

 SetEnv HOME /var/www/owncloud
 SetEnv HTTP_HOME /var/www/owncloud

</Directory>

Save and close the file.

13 The next step is to run the commands listed below to activate all the necessary Apache modules and the newly added configuration:

# a2enconf owncloud

# a2enmod rewrite

# a2enmod headers

# a2enmod env

# a2enmod dir

# a2enmod mime

14 Restarting the Apache web server will make the modifications effective:-

systemctl restart apache2

15 Completing The Installation Of OwnCloud

The only step left to do is to install OwnCloud on a browser once all relevant configurations have been completed. Therefore, open your browser and enter the address of your server, followed by the

Username = admin
Password = admin

Database User = harry
Database Password = redhat@123
Database name = highsky_db

Username = admin

Password = admin

Successfully Install

 

28 June 2023

What is Docker? And How To Install In Ubuntu 20.04

Containers are standardized, executable components that integrate application source code with the operating system (OS) libraries and dependencies necessary to run that code in any environment. Docker is an open-source platform that empowers developers to build, distribute, operate, update, and manage containers.

The magic bullet that permanently fixed the virtualization and software container issues was Docker. Yes, that is a bold statement! Other products had made an effort to address these issues, but Docker’s novel strategy and ecosystem had completely eliminated the competition. You will learn the fundamentals of Docker in this course so that you can start utilizing it for your own applications and incorporating it into your workflow.

 1  Installing Docker

What Is Docker? How To Install Rehal 9

It’s possible that the Docker installation package included in the official Ubuntu repository is out of date. We’ll install Docker from the official Docker repository to make sure we have the most up-to-date version. To accomplish that, we will first create a new package source, then install the package after adding the GPG key from Docker to confirm the downloads are legitimate.

Update your current list of packages first:.

apt update

Install the following prerequisites to enable apt to use packages through HTTPS:

apt install apt-transport-https ca-certificates curl software-properties-common

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Then add your system’s GPG key for the official Docker repository:

APT sources should include the Docker repository:

add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"

Additionally, this will add the Docker packages from the recently added repository to our package database.

Verify that you are about to install from the Docker repository rather than the standard Ubuntu repository:

The result will look like this, albeit Docker’s version number can be different:

Note that docker-cue is not installed, but Ubuntu 20.04 (focal)’s Docker repository is the installation candidate.

Install Docker lastly:

apt install docker-ce

Now that Docker has been set up, the daemon should be running and the process should be set to launch upon boot. Verify that it is operating:

To verify that the service is operational and operating, the output should resemble the following:

The Docker client as well as the Docker service (daemon) are now included with the installation of Docker. Later in this lesson, we’ll look at how to use the docker command.

Install docker in complete 

19 June 2023

What Is Laravel And How To Install Laravel On Ubuntu?

1. Known for its clean syntax, expressive syntax, and developer-friendly features, Laravel is an open-source PHP framework for building online applications. It makes it simple to construct dependable and scalable web applications since it adheres to the Model-View-Controller (MVC) architectural paradigm.

La Ravel’s salient characteristics include:

( 1 ) Routing: Laravel offers a straightforward and expressive method for defining web routes, making it simple to manage HTTP requests and specify the proper response logic.

( 2 ) Eloquent, Laravel’s ORM (Object-Relational Mapping), makes querying and manipulating database records simple by offering an intuitive syntax.

( 3 ) Laravel comes with a built-in templating engine called Blade that enables you to create dynamic, reusable views with capabilities like template inheritance, control structures, and simple data rendering.

( 4 ) Database migrations: The migration mechanism provided by Laravel enables you to easily make changes to the database structure while preserving your data and version control your database design.

( 5 ) User registration, login, and password reset functionality can be easily implemented because Laravel comes with a full authentication system preinstalled. Additionally, it provides strong authorization techniques for limiting access to different areas of your application.

( 6 ) Data Caching and Session Management: Laravel comes with built-in support for data caching, which can significantly enhance the performance of your application. It also offers a clear, uncomplicated interface for managing user sessions.

( 7 ) Task Scheduling: By specifying scheduled instructions, Laravel’s task scheduler enables you to automate monotonous operations within your application.

( 8 ) Testing: Laravel offers built-in support for testing, with capabilities like unit testing, integration testing, and browser testing, making it simpler to assure the quality and reliability of your application.

( 9 ) The sizeable and vibrant Laravel community helps to support its ongoing development, thorough documentation, and availability of several packages and extensions that may be simply incorporated into your applications.

Laravel provides a solid basis for developing cutting-edge online applications, with the overall goal of streamlining the development process and increasing developer productivity.

Apache Web Server installation

You will install the Apache2 web server on your Ubuntu system in this initial phase. You will be using the Apache web server and the Laravel web framework in this example.

To update and reload your Ubuntu repository, run the apt command below.

sudo apt update

The Apache2 web server package should then be installed using the following command.

sudo apt install apache2

Enter Y to confirm, then hit ENTER to launch the installation. It’s time to start installing Apache.

After installing Apache2, you must configure the UFW firewall to allow access to HTTP and HTTPS services.

The HTTP and HTTPS services can be added to the UFW firewall by using the ufw command listed below.

sudo ufw allow "Apache Full"

Input the server IP address (for example, http://192.168.1.11) in the address bar of your web browser after it has opened. The Apache2 web server’s default index.html page should now appear.

Installing PHP

The Ubuntu 20.04 computer will have PHP installed and configured after the Apache web server is set up. The PHP package for version 7.4 is available in the standard Ubuntu 20.04 repository, and it has good support for the Laravel web framework.

Install PHP packages for the Laravel web framework by running the apt command below.

sudo apt install php php-curl php-bcmath php-json php-mbstring php-xml php-tokenizer php-zip

Enter Y to approve the installation, then click ENTER to move on. The installation of PHP will start.

Use the Vim editor to make changes to the configuration file php.ini after the PHP installation is complete.

sudo vim /etc/php/8.1/apache2/php.ini

To make the PHP extensions file info, OpenSSL, and mastering available, uncomment the corresponding options.

extension=fileinfo
extension=mbstring
extension=openssl


When finished, save and close the file.

Restart the Apache2 service after that to make the latest PHP configuration modifications.

sudo systemctl restart apache2

Finally, run the following command to check and validate your PHP setup.

On your Ubuntu computer, check the PHP version installed.

php --version

You can see that PHP 7.4.3 is set up on the Ubuntu computer in the screenshot below.

MariaDB Server installation

PHP and the Apache2 web server packages have now been set up. On the Ubuntu 20.04 system, you will now be installing and setting up the MariaDB database server. For the Laravekl project, you will also be creating a fresh MariaDB database and user.

You can use the apt command listed below to install the MariaDB database on an Ubuntu computer.

sudo apt install mariadb-server

Enter Y to confirm, then hit ENTER to launch the installation.

 

Use the command below to log in as the root user to the MariaDB shell once the installation of MariaDB is complete

sudo mysql -u root -p

Run the MariaDB queries listed below to establish a brand-new database and user for the Laravel project. In this case, the user Laravel and the password “password” will be used to create the database laravel_db

CREATE DATABASE laravel_db;

Query OK, 1 row affected (0.001 sec)

CREATE USER laravel@localhost IDENTIFIED BY 'password';

Query OK, 0 rows affected (0.001 sec)

GRANT ALL PRIVILEGES ON laravel_db.* TO laravel@localhost;

Query OK, 0 rows affected (0.001 sec)

FLUSH PRIVILEGES;

Query OK, 0 rows affected (0.001 sec)

exit

Bye

To exit the MariaDB shell, run the query “EXIT” right away. You have now set up a new database and user for the Laravel project as well as installed the MariaDB database server.

Composer installation

Installing the Composer will be done in this section. It is package management for the PHP programming language, comparable to pip for Python, the gem for Ruby, npm for Node.js, and yarn for PHP.

There are several ways to install the Laravel web framework. In this example, Composer will be used to install the Laravel web framework.

To download the Composer installation, run the command listed below.

curl -sS https://getcomposer.org/installer -o composer-setup.php

To install the Composer, execute the installer script “composer-setup.php” right away. By doing this, the Composer will be installed in the /usr/local/bin directory.

sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer

This screenshot was taken during Composer installation.

Run the command shown below to check and validate the Composer installation when the installation is complete.

sudo -u www-data composer --version

Display the Composer help content.

sudo -u www-data composer --help

Start Installing Laravel

For the purposes of this example, you will need to establish three directories: “.cache” for the PHP package cache, “.config” for the additional Composer setup, and “laravelapp” for the Laravel project itself. The “/var/www” directory will contain all of those directories.

To create new directories for the Laravel installation, run the command below.

sudo mkdir -p /var/www/{.cache,.config,laravelapp}

Currently, give the user and group www-data ownership to the Composer and Laravel directories.

sudo chown -R www-data:www-data /var/www/{.cache,.config,laravelapp}

After that, use the following command to navigate to the /var/www/laravelapp directory.

cd /var/www/laravelapp/

then use the composer command listed below to install the Laravel web framework. The. at the end of the program will install Laravel in the /var/www/laravelapp working directory.

sudo -u www-data composer create-project laravel/laravel .

After the Laravel installation is complete, the outcome is shown below.

Next, use the Vim editor to make changes to the “.env” file when the installation is finished. This setting serves as Laravel’s immediate environment setup and contains information like the installation URL and database specifics.

vim .env

For the Laravel installation, replace the APP_URL configuration with your domain name. The domain name laravelapp.hwdomain.io.c will be used to host the laravel in this example.

APP_URL=http://laravel_db.hwdomain.io

As soon as you have modified your database configuration, modify the database details.

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel_db
DB_USERNAME=laravel
DB_PASSWORD=password

Save and close the file when you are done.

The MariaDB database server and Laravel web framework installation are now complete.

Setup Apache Virtual Host

The Apache2 virtual host for the Laravel web framework needs to be configured now. The Laravel project will be running in this illustration on the local domain laravel_db.hwdomain.io.

Create a new file “/etc/apache2/sites-available/laravel.conf” using Vim editor.

sudo vim /etc/apache2/sites-available/laravel.conf

The file should now have the following configuration. You can alter the domain if you are already using it. Additionally, be sure to modify the Laravel project’s Document root path.

<VirtualHost *:80>

    ServerAdmin admin@hwdomain.io
    ServerName laravel_db.hwdomain.io
    DocumentRoot /var/www/laravelapp/public

    <Directory />
            Options FollowSymLinks
            AllowOverride None
    </Directory>
    <Directory /var/www/laravelapp>
            AllowOverride All
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

Save and close the file when you are done.

The next step is to run the following command to enable the virtual host configuration laravel. conf and the Apache2 module rewriting.

sudo a2enmod rewrite
sudo a2ensite laravel.conf

Now make sure there are no errors in the Apache2 configuration.

sudo apachectl configtest

Apply the updated virtual host configuration for the Laravel project now by restarting the Apache2 service using the command listed below.

sudo systemctl restart apache2

You have now finished setting up Apache to serve Laravel’s virtual host.

On your machine, edit the /etc/hosts file using the nano/vim editor.

sudo vim /etc/hosts

Include the subsequent configuration. Make sure to update your detailed server’s domain name and IP address.

Save and close the file when you are done.

sudo systemctl restart mariadb.service
sudo systemctl enable mariadb.service
sudo systemctl restart apache2
sudo systemctl enable apache2

Finally, return to your web browser and type the URL for the Laravel installation (i.e., http://laravel_db.hwdomain.io) into the address bar. And you ought to see the Laravel web framework’s default index page. Additionally, you can see the PHP version you are currently using and the Laravel version you just installed at the bottom.

Congratulation! The Laravel web framework has now been successfully installed on Ubuntu 20.04. Additionally, you have learned how to set up the LAMP stack for the Laravel web farm.

WhatsApp chat