Laravel | LinuxHostSupport https://linuxhostsupport.com/blog/category/laravel/ Linux Tutorials and Guides Mon, 08 May 2023 15:06:04 +0000 en-US hourly 1 https://wordpress.org/?v=6.6.1 How to Install Jenkins on AlmaLinux 9 https://linuxhostsupport.com/blog/how-to-install-jenkins-on-almalinux-9/ https://linuxhostsupport.com/blog/how-to-install-jenkins-on-almalinux-9/#respond Tue, 30 May 2023 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=1788 In this blog post, we will explain how to install Jenkins on AlmaLinux 9 OS. Jenkins is an open-sourced automation software used to automate the process of the developers. It is used for building, testing, and deploying the apps with the process of continuous integration and continuous delivery. Jenkins is written in Java programming language, […]

The post How to Install Jenkins on AlmaLinux 9 appeared first on LinuxHostSupport.

]]>
In this blog post, we will explain how to install Jenkins on AlmaLinux 9 OS.

Jenkins is an open-sourced automation software used to automate the process of the developers. It is used for building, testing, and deploying the apps with the process of continuous integration and continuous delivery. Jenkins is written in Java programming language, running in Java servlet containers such as Apache Tomcat. In this blog post, we will install Jenkins with Apache as a reverse proxy so that you can access it via domain.

Installing Jenkins on AlmaLinux 9 is a straightforward process that may take up to 10 minutes. Let’s get started!

Prerequisites

  • A server with AlmaLinux 9 as OS
  • Valid domain pointed to the servers IP address
  • User privileges: root or non-root user with sudo privileges

Step 1. Update the System

Before we start with the installation of Jenkins, we will update the system packages to the latest version available.

sudo dnf update -y && sudo dnf upgrade -y

Step 2. Install Java

To install Java execute the following command::

sudo dnf install java-11-openjdk java-11-openjdk-devel -y

To check the installed Java version, execute the following command:

java -version

You should receive the following output:

[root@host ~]# java -version
openjdk version "11.0.18" 2023-01-17 LTS
OpenJDK Runtime Environment (Red_Hat-11.0.18.0.10-2.el9_1) (build 11.0.18+10-LTS)
OpenJDK 64-Bit Server VM (Red_Hat-11.0.18.0.10-2.el9_1) (build 11.0.18+10-LTS, mixed mode, sharing)

Step 3. Install Jenkins

We need to add the Jenkins repo and the GPG key because they are not added by default in the AlmaLinux 9. To do that execute the following commands:

sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo

sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key

Once the repo and key are added, update the system.

sudo dnf update -y

After the update, we can install Jenkins with the following command:

sudo dnf install jenkins -y

To start and enable the Jenkins service to execute the following commands:

sudo systemctl start jenkins && sudo systemctl enable jenkins

To check the status of the Jenkins service, execute the following command:

sudo systemctl status jenkins

You should get the following output:

[root@host ~]# sudo systemctl status jenkins
● jenkins.service - Jenkins Continuous Integration Server
     Loaded: loaded (/usr/lib/systemd/system/jenkins.service; enabled; vendor preset: disabled)
     Active: active (running) since Tue 2023-03-14 02:53:37 CDT; 14s ago
   Main PID: 38472 (java)
      Tasks: 53 (limit: 24796)
     Memory: 1.2G
        CPU: 1min 41.195s
     CGroup: /system.slice/jenkins.service
             └─38472 /usr/bin/java -Djava.awt.headless=true -jar /usr/share/java/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8080

Jenkins is running on port 8080, and you can access it at http://YourIPAddress:8080 to finish the installation.

Step 4. Finish Jenkins Installation

After accessing http://YourIPAddress:8080, you will see this screen without entering a password:

As described in the picture, the initial password can be found by executing the following command on your server:

cat /var/lib/jenkins/secrets/initialAdminPassword

Enter it and hit on the Continue button.

In this window, you can choose to install the suggested plugins or select plugins on your own. We will choose to install the suggested plugins.

The installation will start, and you will need to allow some time to finish.

Once the installation is finished next you need to set up the administrator username, password and email:

The Jenkins URL will be displayed in the next window. Click on Save and Finish.

Now, Jenkins is ready for use. Click on the Start using Jenkins button.

The homepage of Jenkins will be displayed.

Congratulations! You successfully installed Jenkins on AlmaLinux 9. If you find this setup difficult, feel free to contact our technical support via live chat or ticket. We are available 24/7

If you liked this post on how to install Jenkins on AlmaLinux 9, please share it with your friends on social networks or simply leave a reply below. Thanks.

The post How to Install Jenkins on AlmaLinux 9 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-jenkins-on-almalinux-9/feed/ 0
How to Install Laravel on Ubuntu 18.04 https://linuxhostsupport.com/blog/how-to-install-laravel-on-ubuntu-18-04/ https://linuxhostsupport.com/blog/how-to-install-laravel-on-ubuntu-18-04/#comments Wed, 21 Apr 2021 16:50:11 +0000 https://linuxhostsupport.com/blog/?p=1378   1. Connect to your server To connect to your server via SSH as user root, use the following command: ssh root@IP_ADDRESS -p PORT_NUMBER and replace “IP_ADDRESS” and “PORT_NUMBER” with your actual server IP address and SSH port number. Once logged in, make sure that your server is up-to-date by running the following commands: apt-get […]

The post How to Install Laravel on Ubuntu 18.04 appeared first on LinuxHostSupport.

]]>
 

1. Connect to your serverinstalling laravel on ubuntu 18.04

To connect to your server via SSH as user root, use the following command:

ssh root@IP_ADDRESS -p PORT_NUMBER

and replace “IP_ADDRESS” and “PORT_NUMBER” with your actual server IP address and SSH port number. Once logged in, make sure that your server is up-to-date by running the following commands:

apt-get update
apt-get upgrade

2. Install the MySQL Database server

MySQL is an open-source database management system. To install MySQL, run the following command:

$ apt-get install mysql-server

This will install MySQL 5.7 on your server. In order to improve the security of your MySQL server, we recommend that you run the mysql_secure_installation script by typing the following command:

mysql_secure_installation

This script will help you to perform important security tasks like setting up a root password, disable remote root login, remove anonymous users, etc.

3. Create a database for Laravel

Now, we will create our MySQL database for our Laravel site. Login to your MySQL server with the following command and enter your MySQL root password:

mysql -u root -p

In this section, we will create a new MySQL database laravel and assign user access to it to a new user admin_user with password Strong_Password

CREATE DATABASE laravel;
GRANT ALL PRIVILEGES ON laravel.* TO 'admin_user'@'localhost' IDENTIFIED BY 'Strong_Password';
FLUSH PRIVILEGES;
exit;

Don’t forget to replace ‘Strong_Password’ with an actual strong password.

4. Install PHP and required PHP modules

To install the PHP and all necessary modules, run:

sudo apt-get install php-cli php-mcrypt php-mbstring php-zip php-opcache php-gd php-xml

5. Install Composer

A composer is a dependency manager for PHP and of course Laravel, which you can install packages with. The composer will pull all the required libraries you need for your project.

curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer

6. Install Laravel

Install the latest version of Laravel, using the composer create-project command:

sudo composer create-project --prefer-dist laravel/laravel my_project

If the installation is successful, you will see the following lines:

Writing lock file
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover
Discovered Package: fideloper/proxy
Discovered Package: laravel/tinker
Discovered Package: nesbot/carbon
Package manifest generated successfully.
> @php artisan key:generate
Application key [base64:NEu4D2s1Ai8HHZL3wPnrl+BVpSmcm7dMTStIBtMgSn0=] set successfully.

By default, Laravel is configured to use MySQL(MariaDB), but you need to give it the right information to connect to the database that you just set up. Next, go to the /var/www/Html/my_project/config directory, open the database.php file with your favorite text editor, for example:

nano database.php

And update the database settings, replacing them with your own details:

 'mysql' => [
            'driver' => 'mysql',
            'host' => env('DB_HOST', '127.0.0.1'),
            'port' => env('DB_PORT', '3306'),
            'database' => env('DB_DATABASE', 'yourDBName'),
            'username' => env('DB_USERNAME', 'yourUserName'),
            'password' => env('DB_PASSWORD', 'yourPassword'),
            'unix_socket' => env('DB_SOCKET', ''),
            'charset' => 'utf8mb4',
            'collation' => 'utf8mb4_unicode_ci',
            'prefix' => '',
            'strict' => true,
            'engine' => null,
        ],

7. Server your application with Artisan serve command

Once the installation is completed you can use the artisan serve command to serve your application:

php artisan serve

The output should be something like this:

Laravel development server started: <http://127.0.0.1:8000>

You can now open your browser and access your new Laravel installation at: http://127.0.0.1:8000

8. Install and configure Apache webserver

In this part of the tutorial, we will show you how to install and configure Apache to serve your Laravel application. Run the following command to install Apache webserver from the official Ubuntu repositories:

apt-get install apache2

Change the ownership of the Laravel directory to the webserver user:

chown -R www-data:www-data /path/to/laravel
chmod -R 755 my_project/storage/

Create a new Apache virtual host with the following content:

sudo nano /etc/apache2/sites-available/your_domain.com
<VirtualHost *:80>
ServerName your_domain.com

ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/my_project/public

<Directory /var/www/html/my_project>
AllowOverride All
</Directory>

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

Activate the virtual host by creating a symbolic link :

sudo ln -s /etc/apache2/sites-available/your_domain.com /etc/apache2/sites-enabled/your_domain.com
 

Your Laravel installation is now complete.  You have successfully installed Laravel on your Ubuntu 18.04 VPS. Visit the domain name with a web browser you will see the Laravel default page.   That’s it. If you followed all of the instructions properly now you should be able to access your Laravel installation on your Ubuntu 18.04 server.

 

installing laravel on ubuntu 18.04If you are one of our web hosting customers, and use our optimized Laravel Hosting, you don’t have to install Laravel on Ubuntu 18.04, our expert Linux admins will set up and optimize your Laravel VPS, for you. They are available 24×7 and will take care of your request immediately. As a Laravel developer, you should be focusing on Laravel development and improving your code and leave the server work to us. PS. If you liked this post, on how to install Laravel on Ubuntu 18.04, please share it with your friends on the social networks using the buttons below or simply leave a comment in the comments section. Thanks.

The post How to Install Laravel on Ubuntu 18.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-laravel-on-ubuntu-18-04/feed/ 3