Home Blog

How to Install Jenkins in Linux 7 | CentOS 7

0

Jenkins is an open source automation server or tools for continuous integration and continuous delivery (CI/CD) pipelines that are widely used in various sectors. It helps automate various aspects of software development, including building, testing, and deploying applications. Jenkins allows developers to define and execute workflows that facilitate integration of code changes into a shared repository such as a Git repository and subsequent deployment of the application.

Some key features of Jenkins:

1. Continuous Integration (CI): Jenkins helps developers to frequently save changes to the code they create in a shared repository. It can automatically trigger build processes whenever changes are pushed to the repository, allowing teams to identify integration issues early and fix them quickly. This reduces the ability of developers to work.

2. Continuous Delivery (CD): The Jenkins deployment process automatically supports continuous delivery of software. Jenkins can test and deploy applications in different environments, such as testing, staging and production, ensuring a streamlined and consistent release pipeline.

3. Extensibility: Jenkins has a huge ecosystem of plugins that automatically extend its functionality. These plugins can cover a wide range of areas including source code management, build tools, testing frameworks, deployment platforms and notification systems. Developers can customize Jenkins in various ways to suit their specific needs.

4. Distributed Architecture: Jenkins can distribute workloads across multiple machines simultaneously, allowing parallel execution of tasks. This feature helps improve resource utilization and build and deployment times properly.

5. Easy Configuration: Jenkins provides a web-based interface and a domain-specific language (DSL) called “jenkinsfile” for configuring and defining pipelines. Users can define their CI/CD workflows using a declarative syntax or a script-based approach.

6. Community and Integration: Jenkins has a large and active community that contributes plugins, provides support, and shares best practices. It integrates well with various version control systems, build tools, testing frameworks, and other software development tools.

Overall, Jenkins helps automate repetitive tasks in the software development lifecycle, promoting collaboration, efficiency, and the rapid delivery of high-quality software for software firms.

You can view the YouTube Video of Jenkins Installation in CentOS Linux 7

Jenkins Installation Steps:

To install Jenkins follow the below steps:
Step 1: Install Java
Update System Packages:
# yum update -y

Install Java Development Kit (JDK):
Java must require to run Jenkins. Install the Java OpenJDK package.
# yum install java-11-openjdk -y

Step 2: Setup Jenkins repository
Need to add Jenkins Repository and import the Jenkins repository key
# wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
# rpm –import https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key

Step 3: Install Jenkins
Before installing Jenkins need to install two language packages to overcome the error ‘Failed to start jenkins continuous integration server’. It will fix the the Jenkins start problem.

# yum install dejavu-sans-fonts -y
# yum install fontconfig -y

Install Jenkins:
# yum install jenkins -y

Reload the system daemon:
# systemctl daemon-reload

Enable and Start Jenkins Service:
# systemctl enable jenkins
# systemctl start jenkins

Check the Jenkins Server:
systemctl status jenkins

Step 4: Configure Firewalld
If you have the firewalld service enabled, allow inbound connections to Jenkins :
# firewall-cmd –permanent –zone=public –add-port=8080/tcp
# firewall-cmd –reload

Step 5: Access Jenkins Web Interface:
Open a web browser and visit http://172.22.10.20:8080. You should see the Jenkins setup page.

Step 6: Unlock Jenkins:
To retrieve the initial admin password, run the following command-
# cat /var/lib/jenkins/secrets/initialAdminPassword

Copy the password and paste it into the Jenkins setup wizard to unlock Jenkins. and Customize Plugin Installation (Optional): You can choose to install suggested plugins or select specific plugins based on your needs.

Step 7: Create an Admin User:
Provide the necessary details to create an administrator user for Jenkins.

Step 8: Start using Jenkins:
Once the setup is complete, Jenkins is ready to use. You can start creating your CI/CD pipelines and jobs.

Thanks for visiting my website. Please like my Technology Tips facebook fan page and subscribe my youtube channel Technology Tips. If you have any quarries please comment on the box below.

Q3: Managing Local Users and Groups | RHCSA Exam Questions and Solutions | EX200 RHCSA v9

0

The Red Hat Certified System Administrator (RHCSA) exam is a leading and recognized certification that helps candidates increase, develop and incorporate administrative skills and power used in Red Hat Linux distributions. This opens the door to a more advanced level of certification in the same sector that potential employers will need to meet specific organizational goals. RHCSA is an entry level of vendor examination of Red Hat that requires a candidate to clear the EX200 exam.

If you want to pass the RHCSA 9 EX200 Exam, you need to good practice with following the questions that shared in this website. This post is one of the similar RHCSA 9 EX200 exam questions. You can follow the previous questions from my previous posts Network configuration and yum local repository.

This post is one of the similar RHCSA 9 EX200 exam questions. You can follow the previous sample questions from my previous posts
Network configuration and yum local repository.

To solve the question you need to complete the the following topics-
1. Different User Types
2. Creating and Managing User Accounts
3. Creating and Managing Group Accounts
4. The following RHCSA exam objectives are covered in this chapter:
5. Create, delete, and modify local user accounts
6. Change passwords and adjust password aging for local user accounts
7. Create, delete, and modify local groups and group memberships
8. Configure superuser access

Question 03:
Create the following users, groups and group memberships:
• A group named admin
• A user harry who belongs to admin as a secondary group
• A user natasha who also belongs to admin as a secondary group
• A user peter who does not have access to an interactive shell on the system and who is not a member of admin.
• harry, natasha and peter should have the password redhat

Solution:
# groupadd admin
# useradd -G admin harry
# useradd -G admin natasha
# useradd -s /sbin/nologin peter
# passwd harry
# passwd natasha
# passwd peter

Checking:
# id <user-name>

# tail -4 /etc/group
admin:x:1003:harry,natasha
harry:x:1004:
natasha:x:1005:
peter:x:1006:

# tail -3 /etc/passwd
harry:x:1003:1004::/home/harry:/bin/bash
natasha:x:1004:1005::/home/natasha:/bin/bash
peter:x:1005:1006::/home/peter:/sbin/nologin

Next:
RHCSA Sample Question 04 – Controlling Access to Files.

Thanks for visiting my website. Please like my Technology Tips facebook fan page and subscribe my youtube channel Technology Tips. If you have any quarries please comment on the box below.

Q2: Installing and Updating Software Packages | RHCSA Exam Questions and Solutions | EX200 RHCSA v9

0

Today i will discuss question number two of Linux System Admin RHCSA EX200 Exam. This question usually asks to configure local yum repository with two long url. In the time of yum configuration need to copy-paste or write the url to the file which is very difficult to write in yum.repo file manually. Miss mass may happen while typing. So, there is a good idea to copy paste these lines in yum.repo file.

To do this you need to ssh to the system from base machine. But root login is disabled by default on both nodes. So, need to create a new user and password and need to login the system from base terminal. After that need to su user root properly. Now you can able to create yum.repo file and copy-paste the two lines in yum.repo file easily.

The reason for creating the user is that there is no need to change the ssh configuration file and restart the ssh service. That makes exam easier and saves time. You must solve the first question before starting the second question. So, visit our post to see the first question – Q1: Network Configuration and Hostname Set.

Now create a repo file yum.repo or a file with any name. Write the file as given in solution section and clean the repository and check the local yum repositories.

Question 02:
Configure your system to use this location as a default repository (public/local repo):
• http://content.example.com/rhel9.0/x86_64/dvd/BaseOS
• http://content.example.com/rhel9.0/x86_64/dvd/AppStream

Solution:
# vim /etc/yum.repos.d/yum.repo
[BaseOS]
name=BaseOS repo
baseurl=http://content.example.com/rhel9.0/x86_64/dvd/BaseOS
enabled=1
gpgcheck=0

[AppStream]
name=AppStram repo
baseurl=http://content.example.com/rhel9.0/x86_64/dvd/AppStream
enabled=1
gpgcheck=0

Checking:
# yum clean all
# yum repolist all

Next:
RHCSA Sample Question 03 – Managing Local Users and Groups.

Thanks for visiting my website. Please like my Technology Tips facebook fan page and subscribe my youtube channel Technology Tips. If you have any quarries please comment on the box below.

Q1: Network Configuration and Hostname Set | RHCSA Exam Questions and Solutions | EX200 RHCSA v9

0

All of us who work with IT Systems are familiar with Red Hat Linux. Nowadays no one cannot expect a job or promotion without vendor certification in a specific field. Red Hat Linux is one of the most popular vendor companies in the world. RHCSA is the first certification of Red Hat Linux Enterprise. Beginners are tries to get this certification any cost.

Those who are currently working with system and want to give Linux exam, will get a good idea if they will follow my posts and can take exam preparation from home. I have made this post based on the exam held on last May 2023. I hope you will get 100% success in EX200 v9 RHCSA exam.

Question 01:

Make ensure the network connectivity of your system using the following IP information:

• IPv4: 172.22.10.10

• Subnet Mask: 255.255.255.0

• Gateway: 172.22.10.2

• DNS server: 172.22.10.2

and also set the hostname servera.lab.example.com

Solution:

There are different ways to set static ip address in rhel 9. you can use any one of it.

• nmtui

• nmcli

Way 1: Static IP Address using nmtui utility

This is the text-based user interface for managing the networking on modern Linux systems. To set static ip address using nmtui, run the below command-

# nmtui

Using this tool, you can set ip address and hostname. Activate/Deactivate the interface easily. It will save your time in exam if you have any confusion on nmcli command.

100% mark you will get using this tool.

Way 2: Static IP Address using nmcli command

# nmcli connection modify “ens160” ifname ens160 ipv4.addresses 172.22.10.10/24 \

  > ipv4.gateway 172.22.10.254 ipv4.dns 172.22.10.2 ipv4.method manual ;

# nmcli connection up “ens160”

# hostnamectl set-hostname servera.example.com

# hostnamectl status

Checking:

Ping the gateway to make sure the ip configuration set correctly.

# ping172.22.10.2

Next:
RHCSA Sample Question 02 – Installing and Updating Software Packages.

Thanks for visiting my website. Please like my Technology Tips facebook fan page and subscribe my youtube channel Technology Tips. If you have any quarries please comment on the box below.

The Top 10 New Technology Trends 2023

0

The latest technology has had a significant impact on our lives in many ways, some of which include-

Increased connectivity: Latest technology, such as smartphones and social media, has enabled us to stay connected with friends, family, and colleagues from anywhere in the world. This has improved communication and collaboration, both in personal and professional settings.

Access to information: The latest technology has made it easier for people to access information on various topics. The internet, for example, provides instant access to a vast amount of information that was not available in the past.

Automation: The latest technology has enabled automation of many tasks that were previously done manually. This has led to increased efficiency and productivity in many industries.

Improved healthcare: Latest technology has made healthcare more accessible and efficient. Telemedicine, for example, allows doctors to diagnose and treat patients remotely, which can save time and money for patients and healthcare providers.

Entertainment: The latest technology has transformed the way we consume entertainment. Streaming services, for example, have made it easier for people to access movies and TV shows on demand.

Environmental impact: The latest technology has also had an impact on the environment. Advancements in renewable energy technology, for example, have made it possible to generate clean energy from sources such as wind and solar power.

Overall, the latest technology has had a profound impact on our lives, making it easier, more convenient, and more efficient in many ways. However, it also presents new challenges and ethical considerations that must be addressed as we continue to develop and integrate new technologies into our lives.

Listed Below Are the Top New Technology Trends, 2023

Listed Below Are The Top New Technology Trends in 2023

1. Robotic Process Automation (RPA)

2. Edge Computing

3. Quantum Computing

4. Virtual Reality and Augmented Reality

5. Blockchain

6. Internet of Things (IoT)

7. 5G

8. Cyber Security

1. Robotic Process Automation (RPA)

Robotic Process Automation (RPA) is a type of automation technology that uses software robots or “bots” to automate repetitive and routine tasks that are typically performed by humans. RPA is designed to mimic human interactions with digital systems and applications to perform tasks such as data entry, data extraction, and data processing.

RPA bots are programmed to follow predefined rules and instructions, and they can be trained to perform a wide range of tasks. They can also be integrated with other systems and applications, such as ERP systems, CRM systems, and web applications, to automate end-to-end business processes.

RPA is different from traditional automation technologies because it can be implemented quickly and does not require extensive programming skills. RPA bots can be configured through a user-friendly interface, and they can learn from human operators to improve their performance over time.

RPA has many benefits, including increased efficiency, accuracy, and cost savings. It can also free up human workers from repetitive and mundane tasks, allowing them to focus on more complex and strategic work. RPA is being used in many industries, including finance, healthcare, manufacturing, and logistics, to automate business processes and improve operational efficiency.

2. Edge Computing

Edge computing is a distributed computing paradigm that brings computation and data storage closer to the location where it is needed, in order to improve the performance and efficiency of data processing. Edge computing aims to reduce the latency and bandwidth requirements of cloud computing by processing data at or near the edge of the network, where the data is generated or consumed.

In edge computing, data processing and storage are done on local devices, such as smartphones, IoT devices, and network routers, rather than in a central location such as a cloud data center. This allows for faster response times and reduces the need for data to be sent back and forth between the device and the cloud, which can be particularly useful in applications that require real-time processing, such as autonomous vehicles, drones, and augmented reality.

Edge computing also offers other benefits, such as improved security, as data is processed locally rather than being sent over the network, and reduced network congestion, as less data is sent over the network. Additionally, edge computing can reduce the cost of cloud computing, as less data needs to be processed in the cloud, and can provide better privacy for users, as data is not stored on central servers.

Edge computing is being used in a variety of applications, such as smart cities, industrial IoT, and healthcare, where real-time data processing and low latency are critical. As more devices become connected to the internet, the demand for edge computing is expected to increase, driving further innovation in this field.

3. Quantum Computing

Quantum computing is an emerging field of computing that uses quantum-mechanical phenomena, such as superposition and entanglement, to perform operations on data. It is fundamentally different from classical computing, which relies on binary digits (bits) that can be either 0 or 1.

Quantum computers use quantum bits (qubits) that can be in a superposition of both 0 and 1 states at the same time, allowing for much faster processing and more complex calculations than classical computers. Quantum computing can solve certain types of problems exponentially faster than classical computers, such as factoring large numbers and simulating complex systems.

Quantum computing has many potential applications in areas such as cryptography, machine learning, drug discovery, and optimization. For example, quantum computers could break current encryption methods used to protect sensitive information, leading to the development of new quantum-resistant cryptographic algorithms. They could also accelerate the discovery of new drugs by simulating the behavior of molecules and proteins more accurately than classical computers.

However, quantum computing is still in its early stages, and many technical challenges must be overcome before it can become a practical technology. One of the main challenges is the issue of quantum decoherence, which causes qubits to lose their quantum state and become classical bits. There are also significant challenges in building and scaling up quantum hardware, developing software and algorithms that can run on quantum computers, and integrating quantum computing into existing computing infrastructure.

Despite these challenges, there has been significant progress in quantum computing in recent years, and the technology is expected to have a major impact on a wide range of industries in the future.

4. Virtual Reality and Augmented Reality

Virtual Reality (VR) and Augmented Reality (AR) are two related technologies that create immersive and interactive experiences for users.

Virtual Reality (VR) is a computer-generated simulation of a 3D environment that users can interact with using a headset and sometimes controllers. The user’s movement and actions are tracked by sensors, and the VR system adjusts the simulation accordingly to create a sense of presence in a virtual world. Users can move around and interact with objects in the virtual environment, which can be designed to simulate real-world scenarios or entirely fictional ones.

Augmented Reality (AR), on the other hand, overlays digital content onto the real world. AR is typically experienced through a mobile device or a headset that uses cameras and sensors to track the user’s surroundings and position. The digital content is then overlaid onto the real world in a way that appears to be part of the user’s environment. This can include information, images, or 3D objects that are superimposed onto the real world.

Both VR and AR have numerous applications in a variety of industries, including entertainment, education, healthcare, and manufacturing. For example, VR can be used for immersive gaming experiences, virtual training simulations for employees, or therapeutic treatments for mental health conditions. AR can be used for mobile gaming experiences, providing contextual information in real-time, or visualizing how a product would look in a real-world environment before making a purchase.

As technology continues to advance, VR and AR are expected to become more realistic and widespread, creating new possibilities for how we interact with digital content and the world around us.

5. Blockchain

Blockchain is a digital ledger technology that enables secure and decentralized transactions. It consists of a distributed database that records transactions in a secure and immutable way, using cryptography to ensure the integrity and authenticity of the data.

Blockchain technology has the potential to transform the economy in several ways. One of the most significant impacts is on the financial industry, where blockchain is being used to create new financial instruments, such as cryptocurrencies and digital tokens. Cryptocurrencies, such as Bitcoin and Ethereum, are decentralized digital currencies that use blockchain technology to securely record transactions and store value. They offer a new way to conduct financial transactions without relying on traditional financial institutions, such as banks.

Blockchain technology can also increase the efficiency and transparency of financial transactions by reducing the need for intermediaries and middlemen. This can lower transaction costs, reduce the time it takes to settle transactions, and eliminate the risk of fraud or manipulation.

Blockchain is a decentralized digital ledger technology that allows transactions to be recorded and verified without the need for a central authority or intermediary. It is a distributed database that maintains a continuously growing list of records called “blocks,” which are linked and secured using cryptography.

Each block in the chain contains a unique cryptographic hash that is generated based on the contents of the previous block, along with new transactions that are added to the current block. This ensures that the data in each block is immutable, meaning it cannot be altered once it has been recorded.

Blockchain technology enables secure and transparent transactions, as all participants in the network have access to the same information and can validate the authenticity of transactions. It has been used for a variety of applications, including cryptocurrency, supply chain management, and digital identity verification.

6. Internet of Things (IoT)

The Internet of Things (IoT) refers to a network of physical objects, devices, vehicles, buildings, and other items that are embedded with sensors, software, and connectivity, which allows them to connect and exchange data with other devices and systems over the internet.

IoT devices can collect and transmit data such as temperature, humidity, location, and other environmental conditions. This data can be analyzed and used to monitor and control the behavior of connected devices, improve efficiency, and enhance decision-making processes.

IoT technology is being used in a variety of industries, including healthcare, manufacturing, transportation, and agriculture, to create new products and services and optimize existing processes. For example, in healthcare, IoT devices can be used to monitor patient health and provide real-time alerts to healthcare professionals, while in manufacturing, IoT sensors can help optimize production processes and reduce waste.

7. 5G

5G (fifth generation) is the latest wireless network technology that is designed to provide faster data transfer rates, lower latency, and increased network capacity compared to previous generations of cellular networks such as 4G LTE. 5G networks are expected to support a large number of connected devices, enable high-speed internet access, and drive innovation in emerging technologies such as autonomous vehicles, virtual reality, and the Internet of Things (IoT).

5G networks use a combination of different technologies, including higher frequency bands, advanced antenna technologies, and network slicing. Higher frequency bands, such as millimeter waves, offer faster data transfer rates but have shorter ranges and require more infrastructure. Advanced antenna technologies, such as beamforming and massive MIMO, enable more efficient use of spectrum and better coverage. Network slicing allows different parts of the network to be optimized for specific use cases, such as low latency for autonomous vehicles or high bandwidth for video streaming.

The rollout of 5G networks has been ongoing, with many countries and telecommunication companies investing in infrastructure and devices that support 5G. As 5G networks continue to expand and mature, it is expected to enable new and innovative applications and services that were not possible with previous generations of wireless networks.

8. Cyber Security

Cybersecurity refers to the practices, technologies, and measures used to protect computer systems, networks, and data from unauthorized access, theft, damage, or other types of cyber threats. It involves the protection of computer systems, networks, and other electronic devices from theft, damage or unauthorized access.

Cybersecurity measures can include a range of tools and techniques such as firewalls, encryption, antivirus software, intrusion detection systems, and more. These measures are used to prevent, detect, and respond to security threats and breaches.

Cybersecurity is essential in today’s digital age as businesses, governments, and individuals rely heavily on computer systems and networks for communication, financial transactions, and other critical operations. Cyber threats can come in many forms, including malware, phishing attacks, ransomware, and other types of cyberattacks. By implementing effective cybersecurity measures, organizations can protect their systems and data from cyber threats and ensure the privacy and security of their customers and users.

How to update the System BIOS and ILOM Firmware using the ILOM CLI and Windows TFTP Software

0
Oracle SUN SPARC Server

Oracle Sun Server System Firmware updating is a schedule task for every system engineer. Oracle is releasing the newer version of firmware regularly and they provide the release note and bug fix information in their documentation. In that document they provide the several way to update the firmware. Most of the engineer follow the oracle documents step by steps. Basically System Firmware is the bundle of three version of different firmware which are ILOM, OBP and POST.

For example System Firmware 9.10.4.a includes the ILOM 5.0.2.3.a + OBP 4.43.8.a + POST 5.8.8 version.

ILOM firmware update will ensure bug fix and the better performance. The easiest way to update the firmware is the web browser interface, GUI. Sometimes the browser will not work due to java problem installed in client windows computer. Sometimes for internal server issue. Then most of the engineers are agreed to update the firmware using GUI.

When GUI windows does not work due to system issue like system unable to go maintenance mode, then the only way is console terminal. Using console terminal it is possible to update firmware. In the mean time need a few ways to access the firmware package which is downloaded to client computer earlier. These firmware package will be accessed through different protocol like as http, https, tftp and tftps etc.

A TFTP software is the easy way to make windows computer as tftp server and give the ilom to access the firmware pack. Check the below steps for firmware update using tftp server.

Connect the console terminal and login to ilom using ilom ip address:

SUN-T7-1-ILOM login: root
Password:
Detecting screen size; please wait...done

Oracle(R) Integrated Lights Out Manager
Version 3.2.6.2.c r110468
Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
Warning: HTTPS certificate is set to factory default.
Hostname: TESTDB-ILOM
->

Check the system firmware version which is running currently:

-> show /HOST status hypervisor_version sysfw_version

 /HOST
    Properties:
        status = Solaris running
        hypervisor_version = Hypervisor 1.20.6 2022/08/13 02:50
        sysfw_version = Sun System Firmware 9.10.3 2022/08/13 04:40

Windows TFTP software installation for tftp server:

After Windows TFTP software installation i added computer ip address 192.168.10.12 as Server interface and set TFTP Directory as current directory for TFTP server.

TFTP Software Interface.
TFTP Directory sun system firmware package (renamed as sunfirmware.pkg).
TFTP Software Settings

In the software current directory “TFTP Directory” which is the default directory of tftp server. Firmware package is uploaded in the directory with file renamed. After that firmware update will start via console terminal as below command:

->
-> load -source tftp://192.168.10.12/sunfirmware.pkg

NOTE: An upgrade takes several minutes to complete. ILOM
      will enter a special mode to load new firmware. No
      other tasks can be performed in ILOM until the
      firmware upgrade is complete and ILOM is reset.

Are you sure you want to load the specified file (y/n)? y
Preserve existing configuration (y/n)? y
...............................................................................................................................................................................................................................................................................................................................................................................

Firmware update is complete.
ILOM will now be restarted with the new firmware.
Screenshot of firmware update using tftp server with cli command.

After completing the process system will reset the SP and rebooted and also update with latest version.

SUN SPARC Server RAC

Instructions for firmware upgrade from Sun System Firmware older than 9.5.2.g:

All operations may be performed from the Oracle ILOM CLI, ILOM web interface, or OpsCenter unless specifically noted. All examples below are CLI operations.

1. Check current Sun System Firmware version

-> show /HOST sysfw_version

1. If current version is 9.5.2.g or later go directly to Step 10
2. If current version is before 9.5.2.g follow Steps 2 through 10

2. Turn off host power

-> stop /System
-> show /System power_state

3. Record current network settings if not using DHCP
-> show /SP/network

Note: If not using DHCP, you must have local serial connection before proceeding.

4. Backup current Service Processor configuration (only from CLI or web browser)
-> set /SP/config passphrase=
-> set /SP/config dump_uri=scp://@/XXXXXX.xml

5. Perform initial load of Sun System Firmware package

-> load -source http:///Sun_System_Firmware-X_X_X.pkg

6. Restore network settings if not using DHCP (from CLI only on local serial connection)

-> set /SP/config passphrase=
-> set /SP/config dump_uri=scp://@/XXXXXX.xml

7. Perform second load of Sun System Firmware package

-> load -source http:///Sun_System_Firmware-X_X_X.pkg

8. Restore Service Processor configuration (only from CLI or Web browser)

-> set /SP/config passphrase=
-> set /SP/config load_uri=scp://@/XXXXXX.xml

9. Load the fallback image

-> load /SP/firmware/host/miniroot -source http:///xxxxxxx-fallback_boot-sparc.pkg

10. Perform final load of Sun System Firmware package

-> load -source http:///Sun_System_Firmware-X_X_X.pkg

FTTP Software Download Link: Click for Download

Thanks for visiting my website. Please like my Technology Tips facebook fan page and subscribe my youtube channel Technology Tips. If you have any quarries please comment on the box below.

How to run Dynamic Content with CGI Script on Apache Server | Oracle Solaris 11

0

CGI, the Common Gateway Interface defines a way for a webserver to interact with external content-generating programs, which execute an external program/script, typically to process user requests. It is a simple way to put dynamic content on your web site from any external resources.

We can configure the apache server to run CGI script and pre-viewing the dynamic content in webpage by following the below steps. Here I’ve used Oracle Solaris 11 operating system for testing the dynamic content with CGI script. You can choose any operating system that you prefer. To configure apache web server, you need to know the basic knowledge on Solaris OS.

Check the Oracle Solaris 11 OS info:

# cat /etc/release
    Oracle Solaris 11.4 X86
    Copyright (c) 1983, 2018, Oracle and/or its affiliates.  All rights reserved.
    Assembled 16 August 2018

# pkg info entire | grep Version
     Version: 11.4 (Oracle Solaris 11.4.0.0.1.15.0)
# uname -a
    SunOS webhost 5.11 11.4.0.15.0 i86pc i386 i86pc

To start configuring apache server need to enable apache service. By default apache service is disabled on Solaris 11 OS. Check and enable the service by using the below command:

# svcs -a | grep apache
    disabled       19:28:36 svc:/system/apache-stats-24:default
    disabled       22:38:55 svc:/network/http:apache24

# svcadm enable svc:/network/http:apache24

# svcs -a | grep apache
    disabled       19:28:36 svc:/system/apache-stats-24:default
    online         22:52:25 svc:/network/http:apache24

Now if you check the web server with ip address, you will shown the webserver is running and default webpage is loading. This default page is basically index.html file which default location is “/var/apache2/2.4/htdocs/”. Check the file location and file content from bash terminal using the below command:

# ls -lrt /var/apache2/2.4/htdocs/index.html
    -r--r--r--   1 root     bin           45 Aug 17  2018 /var/apache2/2.4/htdocs/index.html

# cat /var/apache2/2.4/htdocs/index.html
    <html><body><h1>It works!</h1></body></html>

Check the apache webserver which is working fine using web browser:
http://192.168.10.121/
Output: It works!

Default webpage of apache webserver

Now configure httpd.conf file for CGI content which will have in “cgi-bin” directory here. You may changes this directory to any location if you need. Just replace the directory (/var/apache2/2.4/cgi-bin) in configuration file. Noted that default web root directory and CGI content directory are different here. The CGI content directory must have permission to access the CGI content.

Uncomment the both !prefork & pefork directory’s LoadModule.
Also add “Options +ExecCGI” and “AddHandler cgi-script .cgi .pl” lines in cgi-bin directory.

Note: Keep a httpd configuration file backup before any changes.

# cd /etc/apache2/2.4/

# cp -p httpd.conf httpd.conf_original

# vim /etc/apache2/2.4/httpd.conf
.....Output Skipped......
<IfModule !mpm_prefork_module>
<IfDefine !prefork>
	# Must need to uncomment the below line.
        LoadModule cgid_module libexec/mod_cgid.so
</IfDefine>
</IfModule>

<IfModule mpm_prefork_module>
<IfDefine prefork>
	# Must need to uncomment the below line.
        LoadModule cgi_module libexec/mod_cgi.so
</IfDefine>

<Directory "/var/apache2/2.4/cgi-bin">
    AllowOverride None
    #Options None
    Options +ExecCGI
    AddHandler cgi-script .cgi .pl
    Require all granted
</Directory>
.....Output Skipped......

Create a new .cgi file in allowed cgi content directory and give the execution permission to the file. Write a test bash script contents and execute the file for test purpose to show the script file is working.

# cd /var/apache2/2.4/cgi-bin

# touch test.cgi

# chmod a+x test.cgi
# ls -l *.cgi
	-rwxr-xr-x   1 root     root           0 Aug  5 23:16 test.cgi

# vim test.cgi
	#!/bin/bash
	echo "Content-type: text/html\n\n"
	echo "Welcome! to First CGI Script."

# sh test.cgi
	Content-type: text/html
	Welcome! to First CGI Script.

Check the CGI Content using any web browser:

http://192.168.10.121/cgi-bin/test.cgi
Content-type: text/html

Welcome! to First CGI Script.

Dynamic Content Checkup:
Now add the below line in test.cgi file for dynamic content check-up which will collect the log and show the system information on the webpage.

# vim test.cgi
	#!/bin/bash
	echo "Content-type: text/html\n\n"
	echo "Welcome! to First CGI Script."
	echo ""
	echo "<meta http-equiv="refresh" content="10">"
	echo "<html><head><title>Apache CGI Test </title></head><body>"
	echo "<h3>Now Time: $(date)</h3>"
	echo ""
	echo "<h3>Now The Current User: $(netstat -nuv|grep .2006|wc -l) </h3>"
	echo ""
	echo "<b>Last 2 Min interval User Statics: $(cat /var/tmp/userlist)</b>"
	echo ""
	echo "<h3>Now Time: $(date)</h3>"
	echo ""
	echo "<h3>Application Server Memory (GB):</h3>"
	echo "<h3><b><pre>$(top | grep Memory) </pre></b></h3>"
	echo ""
	echo "<h3>ZFS List Info:</h3>"
	echo "<pre> $(zfs list) </pre>"
	echo ""
	echo "<h3>Logged in User:</h3>"
	echo "<pre> $(w) </pre>"
	echo ""
	echo "<h3>Application Server Uptime:</h3>"
	echo "<b><pre> $(uptime) </pre></b>"
	echo ""
	echo "<h3><b>Oracle EM - DC:</b></h3>"
	echo "<a href="https://127.0.0.1:7803/em/" "target=_blank">Oracle Enterprise Manager (OEM)</a>"
	echo ""
	echo "<h3>*** End Here ***</h3>"
	echo "</body></html>"

Make sure that the cgi script file is working from bash terminal:

# sh test.cgi
	Content-type: text/html
	
	Welcome! to First CGI Script.
	
	<meta http-equiv=refresh content=10>
	<html><head><title>Apache CGI Test </title></head><body>
	<h3>Now Time: Fri Aug  5 23:29:06 +06 2022</h3>
	
	<h3>Now The Current User: 0 </h3>
	
	<b>Last 2 Min interval User Statics: Joe Biden, Obama, Putin, Jinping</b>
	
	<h3>Now Time: Fri Aug  5 23:29:06 +06 2022</h3>
	
	<h3>Application Server Memory (GB):</h3>
	
	<h3><b><pre>Memory: 2048M phys mem, 486M free mem, 1024M total swap, 1024M free swap </pre></b></h3>
	
	<h3>ZFS List Info:</h3>
	<pre> NAME                               USED  AVAIL  REFER  MOUNTPOINT
	rpool                             5.11G  14.2G  4.32M  /rpool
	rpool/ROOT                        3.05G  14.2G    31K  none
	rpool/ROOT/solaris                3.05G  14.2G  2.66G  /
	rpool/ROOT/solaris/var             330M  14.2G   190M  /var
	rpool/VARSHARE                    44.7M  14.2G  11.0M  /var/share
	rpool/VARSHARE/kvol               27.7M  14.2G    31K  /var/share/kvol
	rpool/VARSHARE/kvol/dump_summary  1.22M  14.2G  1.02M  -
	rpool/VARSHARE/kvol/ereports      10.2M  14.2G  10.0M  -
	rpool/VARSHARE/kvol/kernel_log    16.2M  14.2G  16.0M  -
	rpool/VARSHARE/pkg                  63K  14.2G    32K  /var/share/pkg
	rpool/VARSHARE/pkg/repositories     31K  14.2G    31K  /var/share/pkg/repositories
	rpool/VARSHARE/sstore             5.85M  14.2G  5.85M  /var/share/sstore/repo
	rpool/VARSHARE/tmp                33.5K  14.2G  33.5K  /var/tmp
	rpool/VARSHARE/zones                31K  14.2G    31K  /system/zones
	rpool/dump                        1.00G  14.2G  1.00G  -
	rpool/export                       136K  14.2G    32K  /export
	rpool/export/home                  104K  14.2G    33K  /export/home
	rpool/export/home/moni            35.5K  14.2G  35.5K  /export/home/moni
	rpool/export/home/shyamal         35.5K  14.2G  35.5K  /export/home/shyamal
	rpool/swap                        1.00G  14.2G  1.00G  - </pre>
	
	<h3>Logged in User:</h3>
	<pre>  11:29pm  up  4:01,  2 users,  load average: 0.00, 0.00, 0.00
	User     tty           login@  idle   JCPU   PCPU  what
	root     pts/1        10:41pm                      w
	root     pts/2        11:23pm     2                -bash </pre>
	
	<h3>Application Server Uptime:</h3>
	<b><pre>  11:29pm  up  4:01,  2 users,  load average: 0.00, 0.00, 0.00 </pre></b>
	
	<h3><b>Oracle EM - DC:</b></h3>
	<a href=https://127.0.0.1:7803/em/ target=_blank>Oracle Enterprise Manager (OEM)</a>
	
	<h3>*** End Here ***</h3>
	</body></html>

Browser Output: http://192.168.10.121/cgi-bin/test.cgi
	Welcome! to First CGI Script.
	Now Time: Fri Aug 5 23:39:18 +06 2022
	Now The Current User: 0
	Last 2 Min interval User Statics: Joe Biden, Obama, Putin, Jinping
	Now Time: Fri Aug 5 23:39:18 +06 2022
	Application Server Memory (GB):
	Memory: 2048M phys mem, 482M free mem, 1024M total swap, 1024M free swap 
	ZFS List Info:
	NAME                               USED  AVAIL  REFER  MOUNTPOINT
	rpool                             5.10G  14.2G  4.32M  /rpool
	rpool/ROOT                        3.05G  14.2G    31K  none
	rpool/ROOT/solaris                3.05G  14.2G  2.66G  /
	rpool/ROOT/solaris/var             330M  14.2G   190M  /var
	rpool/VARSHARE                    44.9M  14.2G  11.1M  /var/share
	rpool/VARSHARE/kvol               27.7M  14.2G    31K  /var/share/kvol
	rpool/VARSHARE/kvol/dump_summary  1.22M  14.2G  1.02M  -
	rpool/VARSHARE/kvol/ereports      10.2M  14.2G  10.0M  -
	rpool/VARSHARE/kvol/kernel_log    16.2M  14.2G  16.0M  -
	rpool/VARSHARE/pkg                  63K  14.2G    32K  /var/share/pkg
	rpool/VARSHARE/pkg/repositories     31K  14.2G    31K  /var/share/pkg/repositories
	rpool/VARSHARE/sstore             5.87M  14.2G  5.87M  /var/share/sstore/repo
	rpool/VARSHARE/tmp                33.5K  14.2G  33.5K  /var/tmp
	rpool/VARSHARE/zones                31K  14.2G    31K  /system/zones
	rpool/dump                        1.00G  14.2G  1.00G  -
	rpool/export                       136K  14.2G    32K  /export
	rpool/export/home                  104K  14.2G    33K  /export/home
	rpool/export/home/moni            35.5K  14.2G  35.5K  /export/home/moni
	rpool/export/home/shyamal         35.5K  14.2G  35.5K  /export/home/shyamal
	rpool/swap                        1.00G  14.2G  1.00G  - 
	Logged in User:
	11:39pm  up  4:11,  2 users,  load average: 0.01, 0.00, 0.00
	User     tty           login@  idle   JCPU   PCPU  what
	root     pts/1        10:41pm     3                -bash
	root     pts/2        11:23pm    12                -bash 
	Application Server Uptime:
	11:39pm  up  4:11,  2 users,  load average: 0.01, 0.00, 0.00 
	Oracle EM - DC:
	Oracle Enterprise Manager (OEM)
	*** End Here ***

A few second interval browser will refresh the page and shown the system information.

Check the below images for best result:

You can also check the YouTube video: How to run Dynamic Content with CGI Script on Apache Server – Oracle Solaris 11

Thanks for visiting my website. If you have any query please comment and i will response as soon as possible.

How to Configure Audit Logs in Oracle Solaris 11.4

1

In this tutorial I will show you how to configure audit for generating audit log. Basically this tutorial is for monitoring the user administrative task by the system administrator. For ensuring security most of the company use audit log for different purpose. There are lot of task have in audit configuration. Here, when a user is added and deleted in the Unix/Solaris machine then audit will generate audit log file. A script file will convert the file as human readable log file(.log) and cron will run the script file once a day to convert and store the log file in log directory.

Visit my another post Local IPS Server Configuration in Solaris 11.3 with NFS Share.

Step 1: Check the current flags:
# auditconfig -getflags
configured user default audit flags = fw,lo,ps(0x101002,0x101002)
active user default audit flags = fw,lo,ps(0x101002,0x101002)

Step 2: Set the flag for user add/delete log:
# auditconfig -setflags lo,ua
user default audit flags = lo,ua(0x41000,0x41000)

Step 3: check the current flugs:
# auditconfig -getflags
configured user default audit flags = lo,ua(0x41000,0x41000)
active user default audit flags = lo,ua(0x41000,0x41000)

Step 4: Enable the audit log:
# audit -s

Step 5: Reboot the system [Must needed]:
# init 6

Step 6: login to the System

Step 7: add user or delete user:
# useradd oracle
# passwd oracle
New Password:
Re-enter new Password:
passwd: password successfully changed for oracle

Step 8: Check the log from the system:
# auditreduce -c ua | praudit
file,2021-05-06 06:15:53.000+00:00,
header,214,2,add new user login to the system,,solaris,2021-05-06 06:15:59.595+00:00
subject,root,root,root,root,root,1154,3160793843,188 1 192.168.10.12
text,repository = files
user,103,oracle
group,10,staff
text,gecos =
text,homedir = /export/home/oracle
text,shell = /usr/bin/bash
return,success,0

header,135,2,passwd,,solaris,2021-05-06 06:16:12.683+00:00
subject,root,root,sys,root,root,1155,3160793843,188 1 192.168.10.12
user,103,oracle
use of authorization,solaris.passwd.assign
return,success,0
file,2021-05-06 06:16:12.000+00:00,

Step 9: Done!!!

From the above steps, primary configuration is completed. If you wish to configure more then follow the below steps.

Step 10: check the audit file:
# cd /var/audit/
# ls -lrt
-rw-r—– 1 root root 1358 May 6 06:16 20210506061518.not_terminated.solaris

Step 11: Generate audit log file:
# audit -n

Step 12: check the new file is generated
# ls -lrt
-rw-r—– 1 root root 1426 May 6 06:20 20210506061518.20210506062012.solaris
-rw-r—– 1 root root 124 May 6 06:20 20210506062012.not_terminated.solaris

Step 13: Check log from the file:
# auditreduce -c ua 20210506061518.20210506062012.solaris | praudit -l
file,2021-05-06 06:15:53.000+00:00,
header,214,2,add new user login to the system,,solaris,2021-05-06 06:15:59.595+00:00,subject,root,root,root,root,root,1154,3160793843,188 1 192.168.10.12,text,repository = files,user,103,oracle,group,10,staff,text,gecos = ,text,homedir = /export/home/oracle,text,shell = /usr/bin/bash,return,success,0
header,135,2,passwd,,solaris,2021-05-06 06:16:12.683+00:00,subject,root,root,sys,root,root,1155,3160793843,188 1 192.168.10.12,user,103,oracle,use of authorization,solaris.passwd.assign,return,success,0
file,2021-05-06 06:16:12.000+00:00,

Step 14: Done!!!

If you can configure more then follow the below steps.

Step 15: Make a script file to convert as a log file:

# cat /etc/security/newauditlog.sh

    #!/bin/bash
    #newauditlog.sh - Start a new audit file and expire the old logs #    
    AUDIT_EXPIRE=30 AUDIT_DIR="/var/audit" 
    LOG_DIR="/var/log/"
    /usr/sbin/audit -n
    cd $AUDIT_DIR
    FILES=$(ls -lrt | tr -s " " | cut -d" " -f9 | grep -v "not_terminated")
    lastFile=""
    for file in $FILES; do
    lastFile=$file
    done 
    echo "Beginning praudit of $lastFile" 
    praudit -l $lastFile > "$LOG_DIR$lastFile.log"
    echo "Done praudit, creating log file at: $LOG_DIR$lastFile.log"
    /usr/bin/find . $AUDIT_DIR -type f -mtime +$AUDIT_EXPIRE \ -exec rm {} > /dev/null 2>&1 \;
    # End script

Step 16: Give executable permission:
# chmod +x /etc/security/newauditlog.sh

Step 17: Run the script file:
# cd /etc/security/
# ./newauditlog.sh
Beginning praudit of 20210506102002.20210506102952.solaris
Done praudit, creating log file at: /var/log/20210506102002.20210506102952.solaris.log

Step 18: Check the log(.log) file:
# cd /var/log/
# ls -lrth
-rw-r–r– 1 root root 1296 May 6 16:33 20210506102002.20210506102952.solaris.log

Step 19: Human readable log file.
# cat 20210506102002.20210506102952.solaris.log

Step 20: Done!!!

Creating a cron job:

1.Type the following command to create a backup copy of your current cron file:
# crontab -l > cronfile

2. Type the following command to edit the cronfile:
# vi cronfile

3. Add the following information to your cronfile:
0 0 * * * /etc/security/newauditlog.sh

4. Save the change to the cronfile.

5. Type the following command to add the cronfile to crontab:
# crontab cronfile

If you have any question please comment in the comment box. I will reply as soon as possible. Thanks for visiting my site.

How to Setup Local DNF Repository on RHEL 8 Server using ISO or DVD

0

Finally Red Hat released their best optimized operating system “RHEL 8“. They have changed many features and increased performances than the previous version of RHEL 7. So If you install RHEL 8 Server in your system, then you need to setup local yum or dnf repository. To do this you need to have installation DVD or ISO image file and need to follow the below steps and procedure.

If you have previous version RHEL-7 and need to setup yum repository, visit the below post:
How to setup local YUM Repository on RHEL 7

Local YUM or DNF repository is the place where the rpm packages for Redhat/CentOS are stored and distributed to client servers for software installation and OS updates.

In RHEL 8, there are two package repositories:
1. BaseOS
2. Application Stream (AppStream)

Packages in BaseOS is intended to provide the core set of the underlying OS functionality that provides the foundation for all type installations. Where as Application Stream repository have all application related packages, developer tools and databases etc. Using Application stream repository, we can have multiple of versions of same application and Database.

Mount RHEL 8 installation DVD or ISO file:

To mount a DVD use below mount command
# mount /dev/sr0 /mnt
# cd /mnt
or if you already installed server from ISO image then you will find the mounted ISO image as below:
# df -h
/dev/sr0 7.2G 7.2G 0 100% /run/media/root/RHEL-8-1-0-BaseOS-x86_64

Copy the inside items of RHEL 8 DVD or ISO file into a local directory:

# mkdir /reposerver
# cd /run/media/root/RHEL-8-1-0-BaseOS-x86_64
# cp -pfrv * /reposerver

Remove or Backup existing repo file:
Remove/backup repo file existing in yum.repos.d directory
# cd /etc/yum.repos.d/
# rm -fr *
or
# mv /etc/yum.repos.d/redhat.repo /etc/yum.repos.d/redhat.repo.backup

Create a new repo file for YUM or DNF setup:

# vim /etc/yum.repos.d/rhel8.repo
[InstallMedia-BaseOS]
name=rhel-8-BaseOS
baseurl=file:///reposerver/BaseOS/
metadata_expire=-1
enabled=1
gpgcheck=0

[InstallMedia-AppStream]
name=rhel-8-AppStream
baseurl=file:///reposerver/AppStream/
metadata_expire=-1
enabled=1
gpgcheck=0

Clean Yum / DNF and Subscription Manager Cache:

# dnf clean all
# subscription-manager clean

Verify whether Yum / DNF is getting packages from Local Repo:
# dnf repolist all
Last metadata expiration check: 2:13:53 ago on Fri 08 Jan 2021 10:12:28 AM +06.
repo id repo name status
InstallMedia-AppStream rhel-8-AppStream enabled: 4,795
InstallMedia-BaseOS rhel-8-BaseOS enabled: 1,662

Note : You can use either dnf or yum command, if you use yum command then its request is redirecting to DNF itself because in RHEL 8 yum is based on DNF command.

Here, you will see a warning message like “This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register”

If you want to prevent this message while running dnf / yum command then edit the file subscription-manager.conf file and change the enabled value to 0.
# vim /etc/yum/pluginconf.d/subscription-manager.conf
[main]
enabled=0

Install the packages using DNF / Yum:

# dnf install vsftpd
The output will be like below:

# dnf install vsftpd
Last metadata expiration check: 1:20:39 ago on Fri 08 Jan 2021 10:12:28 AM +06.

Dependencies resolved.

Package Architecture Version Repository Size

Installing:
vsftpd x86_64 3.0.3-28.el8 InstallMedia-AppStream 180 k

Transaction Summary

Install 1 Package

Total size: 180 k
Installed size: 356 k
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : vsftpd-3.0.3-28.el8.x86_64 1/1
Running scriptlet: vsftpd-3.0.3-28.el8.x86_64 1/1
Verifying : vsftpd-3.0.3-28.el8.x86_64 1/1
Installed products updated.

Installed:
vsftpd-3.0.3-28.el8.x86_64

Complete!

Conclusion:

Now you have successfully setup local yum repository on your RHEL 8 Server.