<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Durga Sai Kumar Thulluru on Medium]]></title>
        <description><![CDATA[Stories by Durga Sai Kumar Thulluru on Medium]]></description>
        <link>https://medium.com/@durgasaikumarthulluru0515?source=rss-37430518f0e6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*_bBCYOK5lCOwxMMK</url>
            <title>Stories by Durga Sai Kumar Thulluru on Medium</title>
            <link>https://medium.com/@durgasaikumarthulluru0515?source=rss-37430518f0e6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 19:23:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@durgasaikumarthulluru0515/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Mastering WordPress Deployment: Leverage Ansible Roles on a LEMP Stack (#Ubuntu 20.04)]]></title>
            <link>https://medium.com/@durgasaikumarthulluru0515/mastering-wordpress-deployment-leverage-ansible-roles-on-a-lemp-stack-ubuntu-20-04-08a9d9bd6ec7?source=rss-37430518f0e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/08a9d9bd6ec7</guid>
            <category><![CDATA[ansible]]></category>
            <category><![CDATA[wordpress-web-development]]></category>
            <category><![CDATA[lamp]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Durga Sai Kumar Thulluru]]></dc:creator>
            <pubDate>Tue, 04 Jun 2024 20:56:17 GMT</pubDate>
            <atom:updated>2024-06-04T21:05:36.661Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*fbDvokuRDk5glE2pPDKJ0g.png" /></figure><p>In this blog post, we’ll delve into using Ansible roles to streamline the installation and configuration of WordPress on a LEMP stack (Linux, Nginx, MySQL, PHP). We’ll be focusing on Ubuntu 20.04 as our Linux distribution.</p><p>what will I include in my writings:</p><ol><li>First, we’ll explore the concept of Ansible roles and their advantages.</li><li>Then, we’ll walk you through creating custom roles for each LEMP component, ensuring modularity and reusability in your Ansible playbooks.</li><li>Finally, we’ll craft a comprehensive playbook that orchestrates the deployment of your WordPress application on the LEMP stack.</li></ol><h3><strong>Understanding the Power of Ansible Roles:</strong></h3><p>Ansible roles are a fundamental concept for building efficient and maintainable automation workflows in Ansible. They provide a modular way to organize your configuration tasks, templates, variables, and handlers, all neatly packaged into reusable components.</p><ul><li><strong>Reuse</strong>: Write tasks once, use them everywhere. No more repetitive code!</li><li><strong>Modularity</strong>: Break down complex configurations into bite-sized, manageable chunks.</li><li><strong>Organization</strong>: Keep your code tidy and well-structured for easy maintenance.</li><li><strong>Separation of Concerns</strong>: Playbooks orchestrate roles, roles handle specific tasks. Clean separation!</li><li><strong>Versioning and Sharing</strong>: Track changes, roll back if needed, and share roles with others!</li></ul><h3><strong>Building Modular Playbooks with Custom Ansible Roles:</strong></h3><p>let&#39;s pull the ansible roles and playbook files from GitHub repo:</p><pre>git clone https://github.com/Durgathulluru/LEMP_ANSIBLE.git</pre><p>Before we delve into playbooks and let us understand the files and directories:</p><p>mysql, sertver and wordpress are the ansible roles that i have created, to install all these dependencies for wordpress to run.</p><p>The ‘myhosts’ file serves as a repository for the public IP addresses of remote hosts. These hosts are configured using Ansible Playbooks, which are powerful automation tools that streamline the process of managing complex IT workflows and infrastructure. This file is crucial for ensuring that the Ansible Playbooks can accurately target and configure the desired remote systems. By maintaining a list of public IP addresses in the ‘myhosts’ file, system administrators can efficiently orchestrate their networked environments and apply consistent configurations across all servers.</p><p>The ‘default’ file, which houses the nginx configuration, must be transferred to the remote host. The specific target directory for this file is “/etc/nginx/sites-enabled/default”. This process is crucial for ensuring that the nginx server on the remote host operates with the intended configuration settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JHfUaiv7sUArqUgiCTtcbg.png" /></figure><p>Now, cd into LEMP_ANSIBLE and open the playbook.yml file using nano or vi editor</p><pre>---<br>- name: deploy wordpress<br> hosts: all<br> become: yes<br> tasks:<br><br># update package chache<br><br>  - name: Update package cache<br>   apt:<br>   update_cache: yes<br>  - name: restart nginx service<br>   service:<br>    name: nginx<br>    state: restarted<br><br> roles:<br>    - server<br>    - mysql<br>    - wordpress</pre><p>In this play, I will describe the purpose of each section.</p><p><strong>1. Play Definition:</strong></p><ul><li>- name: deploy wordpress: This defines the name of the play, which is &quot;deploy wordpress&quot;.</li></ul><p><strong>2. Inventory and Privileges:</strong></p><ul><li>hosts: all: This specifies that the play should be run on all hosts defined in the inventory file. In a basic setup, there might be just one server listed.</li><li>become: yes: This indicates that the tasks within the play will be executed with elevated privileges (usually root) on the target server. This is necessary for some configuration tasks like installing packages.</li></ul><p><strong>3. Initial Tasks:</strong></p><ul><li>- name: Update package cache: This task uses the apt module with update_cache: yes to update the package cache on the server before installing any software.</li><li>- name: restart nginx service: This task uses the service module with state: restarted to restart the Nginx web server after any potential configuration changes.</li></ul><p><strong>4. Roles:</strong></p><ul><li>roles:: This section defines the roles that will be included in this play. Roles are reusable modules that encapsulate specific configuration tasks, promoting code organization and maintainability.</li><li>- server: This likely includes tasks for configuring the server environment, such as installing and configuring PHP and dependencies.</li><li>- mysql: This likely includes tasks for setting up the MySQL database server, creating databases and users.</li><li>- wordpress: This likely includes tasks for downloading and installing WordPress files on the server.</li></ul><blockquote>Now, change the directory to the <strong>server</strong> role located in the same directory as playbook.yml, and open the main.yml file in the tasks directory.</blockquote><pre>---<br># tasks file for server setup<br><br>- name: kill all apache2 process<br> apt:<br>   name: apache2<br>   state: absent<br><br>- name: install nginx<br> apt:<br>  name: nginx<br>  state: present<br><br>- name: start nginx<br> service:<br>   name: nginx<br>   state: started<br><br>- name: update cache<br> apt:<br>  update_cache: yes<br><br>- name: installing all dependencies<br> apt:<br>  name: &quot;{{item}}&quot;<br>  state: present<br> with_items:<br>    - php8.1<br>    - php8.1-fpm<br>    - php8.1-mysql<br>    - mysql-server<br>    - mysql-client<br>    - python3-dev<br>    - python3-mysqldb<br>    - libmysqlclient-dev<br><br>- name: replace the file default at /etc/nginx/sites-available<br> copy:<br>   src: ./default<br>   dest: /etc/nginx/sites-available/.<br>   force: yes<br>   owner: root<br>   group: root</pre><p>Here’s a breakdown of what each play does:</p><p><strong>Play 1: Stop Apache2 (if running)</strong></p><ul><li>This play checks if any Apache2 processes are running.</li><li>If Apache2 is running, it uses the apt module with the state: absent option to stop all Apache2 processes. This ensures that Apache2 isn&#39;t interfering with Nginx, which will be installed later.</li></ul><p><strong>Play 2: Install Nginx</strong></p><ul><li>This play uses the apt module with the state: present option to install the Nginx web server on the server.</li></ul><p><strong>Play 3: Start Nginx</strong></p><ul><li>This play uses the service module with the state: started option to start the Nginx service. This ensures that Nginx is running and ready to serve web requests.</li></ul><p><strong>Play 4: Update Package Cache</strong></p><ul><li>This play uses the apt module with the update_cache: yes option to update the package cache on the server. This ensures that the list of available packages is up-to-date before installing dependencies in the next play.</li></ul><p><strong>Play 5: Install PHP and Dependencies</strong></p><ul><li>This play uses the apt module with the state: present option and a with_items loop to install several packages:</li><li>php8.1: This installs the PHP 8.1 interpreter.</li><li>php8.1-fpm: This installs the PHP-FPM (FastCGI Process Manager) which will handle running PHP applications efficiently.</li><li>php8.1-mysql: This installs the PHP 8.1 extension for connecting to MySQL databases.</li><li>mysql-server: This installs the MySQL database server.</li><li>mysql-client: This installs the MySQL client tools for interacting with the database server from the command line.</li><li>python3-dev: This installs development headers for Python 3, which may be required by some PHP libraries.</li><li>python3-mysqldb: This installs a Python library for connecting to MySQL databases.</li><li>libmysqlclient-dev: This installs development headers for the MySQL client library, which may be required by some PHP libraries.</li></ul><p><strong>Play 6: Replace Nginx Default Configuration File</strong></p><ul><li>This play uses the copy module to replace the default Nginx configuration file located at /etc/nginx/sites-available/default with a new configuration file located at the playbook&#39;s path (./default).</li><li>The force: yes option ensures that the existing file is overwritten.</li><li>The owner: root and group: root options set the ownership and group ownership of the copied file to root.</li></ul><blockquote>Next, we will open the main.yml file located in the mysql/tasks directory to examine its contents.</blockquote><pre>---<br># tasks file for mysql<br><br>- name: update packages<br> apt:<br>  update_cache: yes<br><br># Update mysql root password for all root accounts<br><br>- name: Update root user password<br> #become_user: root<br> mysql_user:<br>   name: root<br>   host: &quot;{{ lookup(&#39;file&#39;, &#39;/home/ubuntu/ansible/myhosts&#39;) }}&quot;<br>   password: &quot;{{ wp_mysql_password }}&quot;<br>   priv: &quot;*.*:ALL,GRANT&quot;<br><br>#Set Mysql_user and Password for the Mysql_User<br><br>- name: Create mysql user<br> mysql_user:<br>  name: &quot;{{ wp_mysql_user }}&quot;<br>  password: &quot;{{ wp_mysql_password }}&quot;<br>  priv: &quot;*.*:ALL&quot;<br><br>#Create DataBase for the Mysql_user<br><br>- name: Create mysql database<br> mysql_db:<br>  name: &quot;{{ wp_mysql_db }}&quot;<br>  state: present<br><br># Ensure anonymous users are not in the database and Remove the test DB<br><br>- name: Delete anonymous MySQL server user for localhost<br> action: mysql_user user=&quot; &quot; state=&quot;absent&quot;<br><br>- name: Remove the MySQL test database<br> action: mysql_db db=test state=absent</pre><p>Ansible playbook snippet focuses on configuring a MySQL database server. Here’s a breakdown of what each play does:</p><p><strong>Play 1: Update Package Cache</strong></p><ul><li>This play uses the apt module with the update_cache: yes option to update the package cache on the server. This ensures that the list of available packages is up-to-date before attempting any database configuration tasks.</li></ul><p><strong>Play 2: Update MySQL Root Password (Optional)</strong></p><ul><li>This play uses the mysql_user module to update the password for the MySQL root user.</li><li>The play specifies the following options:</li><li>name: root: This defines the username as &quot;root&quot;.</li><li>host: &quot;{{ lookup(&#39;file&#39;, &#39;/home/ubuntu/ansible/myhosts&#39;) }}&quot;: This retrieves the hostname from a file named myhosts located in the /home/ubuntu/ansible/ directory.</li><li>password: &quot;{{ wp_mysql_password }}&quot;: This sets the new password for the root user. The actual password value is likely defined elsewhere in the playbook using a variable named wp_mysql_password.</li><li>priv: &quot;*.*:ALL,GRANT&quot;: This grants the root user all privileges on all databases, including the ability to grant privileges to other users.</li></ul><p><strong>Play 3: Create a New MySQL User</strong></p><ul><li>This play uses the mysql_user module to create a new MySQL user with the name specified by the variable {{ wp_mysql_user }}.</li><li>The play also sets the user’s password to the value of the variable {{ wp_mysql_password }}.</li><li>priv: &quot;*.*:ALL&quot;: This grants the new user all privileges on all databases.</li></ul><p><strong>Play 4: Create a Database</strong></p><ul><li>This play uses the mysql_db module with the state: present option to create a new MySQL database with the name specified by the variable {{ wp_mysql_db }}.</li></ul><p><strong>Play 5: Secure the Database</strong></p><ul><li>This play uses the mysql_user module with the action: mysql_user user=&quot; &quot; state=&quot;absent&quot; option to remove any anonymous users from the MySQL server that may have access to the database.</li><li>This play also uses the mysql_db module with the action: mysql_db db=test state=absent option to remove the default &quot;test&quot; database that comes with MySQL installations.</li></ul><h3>**Note:</h3><p>that variables named wp_mysql_user, wp_mysql_password, and wp_mysql_db are defined in the mysql/variables/main.yml file directory.</p><p>It is generally advised against embedding sensitive data such as passwords directly into playbooks. Instead, it is preferable to utilize a secure storage solution like Ansible Vault to manage such information effectively.</p><p>Now it&#39;s time for WordPress role playbook:</p><pre>---<br># tasks file for wordpress<br><br>- name: download wordpress<br> get_url:<br>   url=https://wordpress.org/latest.tar.gz<br>   dest=/tmp/latest.tar.gz<br>   validate_certs=no<br><br><br><br>- name: Unzip Wordpress tar file<br> unarchive:<br>    src: /tmp/latest.tar.gz<br>    dest: /tmp/.<br>    owner: www-data<br>    group: www-data<br>    copy: no<br><br>- name: copy wordpress file from /tmp to /var/www/<br> ansible.builtin.copy:<br>  src: /tmp/wordpress<br>  dest: /var/www/html/<br>  remote_src: yes<br>  directory_mode: yes<br><br><br>- name: Assign root permission to wordpress directory<br> shell: chown -R www-data:www-data /var/www/html/wordpress<br>expand_more</pre><blockquote>This Wordpress snippet focuses on downloading and installing WordPress on the server. Here’s a breakdown of what each play does:</blockquote><p><strong>Play 1: Download WordPress</strong></p><ul><li>This play uses the get_url module to download the latest version of WordPress as a compressed tar archive (.tar.gz) from the official WordPress website.</li><li>url: https://wordpress.org/latest.tar.gz: This specifies the URL of the WordPress download file.</li><li>dest: /tmp/latest.tar.gz: This defines the destination path on the server where the downloaded file will be saved.</li><li>validate_certs=no: This option is generally discouraged as it skips certificate validation during the download, which could be a security risk in a production environment. It&#39;s recommended to configure your server to trust the WordPress website&#39;s certificate or find a way to validate certificates securely.</li></ul><p><strong>Play 2: Unzip WordPress Archive</strong></p><ul><li>This play uses the unarchive module to extract the downloaded WordPress archive (latest.tar.gz) into the /tmp directory on the server.</li><li>src: /tmp/latest.tar.gz: This specifies the location of the downloaded archive.</li><li>dest: /tmp/: This defines the destination directory for the extracted files.</li><li>owner: www-data: This sets the ownership of the extracted files to the &quot;www-data&quot; user, which is a common user for web applications on Linux systems.</li><li>group: www-data: This sets the group ownership of the extracted files to the &quot;www-data&quot; group.</li><li>copy: no: This option specifies that the extracted files should not be copied again if they already exist.</li></ul><p><strong>Play 3: Copy WordPress Files to Web Root</strong></p><ul><li>This play uses the ansible.builtin.copy module to copy the extracted WordPress files from the /tmp/wordpress directory (assuming the extracted directory is named &quot;wordpress&quot;) to the web root directory, which is typically /var/www/html/ on the server.</li><li>src: /tmp/wordpress: This specifies the source directory containing the extracted WordPress files.</li><li>dest: /var/www/html/: This defines the destination directory, which is the web root where WordPress will be accessible.</li><li>remote_src: yes: This option specifies that the source directory (/tmp/wordpress) is on the remote server, not the Ansible control machine.</li><li>directory_mode: yes: This option ensures that the directory structure of the WordPress files is preserved during the copy operation.</li></ul><p><strong>Play 4: Set Ownership of WordPress Directory</strong></p><ul><li>This play uses the shell module to execute a shell command on the server.</li><li>The command chown -R www-data:www-data /var/www/html/wordpress changes the ownership of the WordPress directory (/var/www/html/wordpress) and all its contents recursively to the &quot;www-data&quot; user and group. This ensures that the web server user (typically &quot;www-data&quot;) has the necessary permissions to access and manage the WordPress files.</li></ul><p>When you execute the Ansible playbook command as indicated below, the playbooks should run successfully without any errors.</p><pre>ansible-playbook -i myhosts playbook.yml</pre><p>In the browser, paste the URL http://&lt;public_IP address of your remote host&gt;/WordPress to view the image as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ThuTFTtkdnn5ti79i8xnGw.png" /></figure><h3>Summary</h3><p><strong>This blog unveils the mastermind behind your streamlined WordPress deployment:</strong></p><p>An Ansible playbook leveraging powerful roles. We have dissected how these roles work together to configure a robust LEMP stack (Linux, Nginx, MySQL/MariaDB, PHP) on your server, effortlessly setting up the perfect foundation for WordPress.</p><p><strong>LEMP Stack Applications (beyond WordPress):</strong></p><ul><li><strong>LAMP Stack (Linux, Apache, MySQL/MariaDB, PHP):</strong> A popular alternative to LEMP, using Apache instead of Nginx for web serving. Ideal for applications like Drupal, Joomla, or custom PHP projects.</li><li><strong>MEAN Stack (MongoDB, Express.js, Angular, Node.js):</strong> A JavaScript-focused stack for building dynamic web applications.</li><li><strong>MERN Stack (MongoDB, Express.js, React, Node.js):</strong> Another popular JavaScript stack with React for the frontend.</li><li><strong>Python with Django:</strong> A powerful framework for building complex web applications in Python.</li></ul><p>Ansible playbooks can be tailored to manage the configuration of these diverse application stacks, allowing you to automate provisioning, installation, and ongoing maintenance tasks across your servers. This ensures consistency, reduces manual errors, and saves you valuable time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=08a9d9bd6ec7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LEMP Stack: A Comprehensive Guide for Beginners to Intermediate DevOps Enthusiasts (project 2)]]></title>
            <link>https://medium.com/@durgasaikumarthulluru0515/lemp-stack-a-comprehensive-guide-for-beginners-to-intermediate-devops-enthusiasts-project-2-52ecd89524e5?source=rss-37430518f0e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/52ecd89524e5</guid>
            <category><![CDATA[devops-practice]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[lemp]]></category>
            <dc:creator><![CDATA[Durga Sai Kumar Thulluru]]></dc:creator>
            <pubDate>Wed, 10 Jan 2024 14:23:31 GMT</pubDate>
            <atom:updated>2024-01-10T14:44:07.832Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iES-pkP7P_YZuvr-.png" /></figure><p>The LEMP stack, an acronym for Linux, Nginx (pronounced Engine-X), MySQL, and PHP, is a powerful combination of software that can serve dynamic web pages and web applications. This guide aims to provide a clear understanding of the LEMP stack from a DevOps perspective.</p><h3>Linux</h3><p>Linux is a Unix-like operating system. It provides a foundation for the other software in the stack to run on. Linux is open-source and there are many different distributions or versions you can use such as Ubuntu, CentOS, Debian, and more.</p><h3>Nginx</h3><p>Nginx (pronounced “engine x”) is the HTTP server for the stack. It can also be used as a reverse proxy, load balancer, and HTTP cache. Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.</p><h3>MySQL</h3><p>MySQL is a relational database management system. This means it can create, update, and manage relational databases. MySQL is used in this stack to store and retrieve data for your web applications.</p><h3>PHP</h3><p>PHP is the programming language we use in this stack. PHP is a server-side scripting language designed for web development. It’s the part of the package that handles the logic of your site: it’s used to interact with MySQL databases, form handling, and more.</p><h3>DevOps Perspective</h3><p>From a DevOps perspective, understanding the LEMP stack involves more than just understanding the basics. It’s about integrating these components into a cohesive workflow that emphasizes collaboration, automation, and streamlined deployment. Tools like Docker and Kubernetes come into play here, allowing you to define your LEMP stack and its configuration as code.</p><p>I’ve documented my journey of setting up a LEMP stack web server on AWS in a <a href="https://github.com/Durgathulluru/LEMP-SETUP_project2">GitHub repository</a>. It’s a step-by-step guide that can help you understand the process and the intricacies involved.</p><p>Feel free to connect with me on <a href="https://www.linkedin.com/in/thulluru1995/">LinkedIn</a> for more updates and discussions around DevOps and other technologies.</p><h3>Remember, the goal is to create a workflow that improves collaboration and productivity, while maintaining high standards of quality. Happy learning! 😊</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=52ecd89524e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Are you looking to learn more about the *LAMP stack*?]]></title>
            <link>https://medium.com/@durgasaikumarthulluru0515/are-you-looking-to-learn-more-about-the-lamp-stack-b6de86a25b86?source=rss-37430518f0e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6de86a25b86</guid>
            <category><![CDATA[lamp-stack]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Durga Sai Kumar Thulluru]]></dc:creator>
            <pubDate>Tue, 09 Jan 2024 23:44:10 GMT</pubDate>
            <atom:updated>2024-01-09T23:46:43.377Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ap-C2scyv3F9NsbNT7WPZQ.png" /></figure><p>Are you looking to learn more about the *LAMP stack*? Look no further! In this post, I will share my experience with LAMP and how it can be used to create dynamic web applications.</p><p>LAMP stands for *Linux, Apache, MySQL, and PHP*. It is an open-source web development platform that is widely used by developers around the world. I have been working with LAMP for a while now and I must say that it is a great tool for web development.</p><p>In this post, I will cover the following topics:</p><p>- What is LAMP?</p><p>- Why use LAMP?</p><p>- How to get started with LAMP?</p><p>- My experience with LAMP</p><p>- Conclusion</p><p>If you are interested in learning more about LAMP, then this post is for you! You can also check out my GitHub repository where I have created a simple web application using LAMP. It is a great resource for beginners who want to learn more about LAMP.</p><p>*What is LAMP?*</p><p>LAMP stands for *Linux, Apache, MySQL, and PHP*. It is an open-source web development platform that is widely used by developers around the world. LAMP is a combination of four technologies that work together to create dynamic web applications.</p><p>*Why use LAMP?*</p><p>LAMP is a popular choice for web development because it is open-source, free, and easy to use. It is also highly customizable and can be used to create a wide range of web applications.</p><p>*How to get started with LAMP?*</p><p>To get started with LAMP, you will need to install Linux, Apache, MySQL, and PHP on your computer. There are many resources available online that can help you with the installation process.</p><p>*My experience with LAMP*</p><p>I have been working with LAMP for a while now and I must say that it is a great tool for web development. LAMP is highly customizable and can be used to create a wide range of web applications. I have used LAMP to create a simple web application that I have shared on my GitHub repository.</p><p>*Conclusion*</p><p>LAMP is a great tool for web development. It is open-source, free, and easy to use. If you are interested in web development, then I highly recommend that you give LAMP a try.</p><p>Here are some examples of web applications that use LAMP stack:</p><p>1. *WordPress*: A popular content management system (CMS) that is used to create blogs, websites, and online stores .</p><p>2. *Drupal*: Another CMS that is used to create complex websites and applications .</p><p>3. *Joomla*: A CMS that is used to create websites, blogs, and online applications .</p><p>4. *phpBB*: A forum software that is used to create online discussion forums .</p><p>5. *Moodle*: An open-source learning management system (LMS) that is used to create online courses .</p><p>Thank you for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6de86a25b86" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LAMP STACK]]></title>
            <link>https://medium.com/@durgasaikumarthulluru0515/lamp-stack-55f8632d8067?source=rss-37430518f0e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/55f8632d8067</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[projects]]></category>
            <category><![CDATA[lamp]]></category>
            <dc:creator><![CDATA[Durga Sai Kumar Thulluru]]></dc:creator>
            <pubDate>Tue, 09 Jan 2024 15:55:06 GMT</pubDate>
            <atom:updated>2024-01-09T23:14:36.574Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/1*jPA92D8pZ45YfFn_tQFolA.png" /><figcaption><a href="https://stackify.com/what-is-lamp-stack/">What is LAMP Stack? (stackify.com)</a></figcaption></figure><p>To do this project fork my git hub repository: <a href="https://github.com/Durgathulluru/LAMPstack/tree/main">Durgathulluru/LAMPstack: This Is a LINUX APACHE MYSQL PHP project (github.com)</a></p><p># Small Introduction On Stack: <br>What is a Technology stack?<br>A technology stack is a set of frameworks and tools used to develop a software product. This set of frameworks and tools are very <br>specifically chosen to work together in creating a well-functioning software. They are acronymns for individual technologies used<br>together for a specific technology product. some examples are…</p><p>- LAMP (Linux, Apache, MySQL, PHP or Python, or Perl)<br>- LEMP (Linux, Nginx, MySQL, PHP or Python, or Perl)<br>- MERN (MongoDB, ExpressJS, ReactJS, NodeJS)<br>- MEAN (MongoDB, ExpressJS, AngularJS, NodeJS<br># Step 0 — Preparing prerequisites<br>In order to complete this project you will need an AWS account and a virtual server with Ubuntu Server OS.</p><p>[AWS](<a href="https://aws.amazon.com/">https://aws.amazon.com/</a>) is the biggest Cloud Service Provider and it offers a free tier account that we are going to leverage for our projects.</p><p>Do not focus too much on AWS itself right now, there will be a proper Cloud introduction and configuration projects later.</p><p>Right now, all we need to know is that AWS can provide us with a free virtual server called EC2 (Elastic Compute Cloud).</p><p>Spinning up a new EC2 instance (an instance of a virtual server) is only a matter of a few clicks.</p><p>You can either Watch the videos below to get yourself set up.</p><p>1. AWS account setup and Provisioning an Ubuntu Server<br>2. Connecting to your EC2 Instance</p><p>Or follow the instructions below.</p><p>1. Register a new AWS account following this instruction.<br>2. Select your preferred region (the closest to you) and launch a new EC2 instance of t2.micro family with Ubuntu Server 20.04 LTS (HVM)<br>launch EC2</p><p>IMPORTANT — save your private key (.pem file) securely and do not share it with anyone! If you lose it, you will not be able to<br>connect to your server ever again!</p><p>For Windows users, you will need a tool called putty or you can also use Mobaxterm to connect to your EC2 Instance. Download <a href="https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html">Putty Here</a> and to download free version here <a href="https://mobaxterm.mobatek.net/download.html">Mobaxterm</a> .<br>For Mac users, you can simply open up Terminal and use the ssh command to get into the server.</p><p>IMPORTANT NOTICE<br>Both Putty and ssh use the SSH protocol to establish connectivity between computers. It is the most secure protocol because it uses<br>crypto algorithms to encrypt the data that is transmitted — it uses TCP port 22 which is open for all newly created EC2 intances in<br>AWS by default. Most of these terminologies will make more sense to you as you proceed. So for now, if nothing makes sense, just <br>ignore. But be assured that the information is already registered in your sub-conscious mind. So it will become useful to you soon.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*XxCvkj1WchdBDnCY22hOiw.png" /><figcaption>project1-step0</figcaption></figure><h3>STEP 1 — INSTALLING APACHE AND UPDATING THE FIREWALL</h3><p>```<br>#update a list of packages in package manager<br>sudo apt update</p><p>#run apache2 package installation<br>sudo apt install apache2<br>```</p><h3>To verify that apache2 is running as a Service in our OS, use following command</h3><pre>sudo systemctl status apache2</pre><h3>STEP 2 — INSTALLING MYSQL</h3><pre>$ sudo apt install mysql-server</pre><p>When the installation is finished, log in to the MySQL console by typing:</p><pre>$ sudo mysql</pre><p>Set a password for the root user, using mysql_native_password as default authentication method. We’re defining this user’s password as PassWord.01.</p><pre>ALTER USER &#39;root&#39;@&#39;localhost&#39; IDENTIFIED WITH mysql_native_password BY &#39;PassWord.1&#39;;</pre><p>Exit the MySQL shell with:</p><pre>mysql&gt; exit</pre><pre>$ sudo mysql_secure_installation</pre><p>For the rest of the questions, press Y and hit the ENTER key at each prompt. This will prompt you to change the root password, remove some anonymous users and the test database, disable remote root logins, and load these new rules so that MySQL immediately respects the changes you have made.</p><pre>$ sudo mysql -p</pre><p>Notice the -p flag in this command, which will prompt you for the password used after changing the root user password.</p><p>To exit the MySQL console, type:</p><pre>mysql&gt; exit</pre><h3>STEP 3 — INSTALLING apache2</h3><p>To install these 3 packages at once, run:</p><pre>sudo apt install php libapache2-mod-php php-mysql</pre><p>At this point, your LAMP stack is completely installed and fully operational.</p><ul><li>Linux (Ubuntu)</li><li>Apache HTTP Server</li><li>MySQL</li><li>PHP</li></ul><blockquote>FOR CREATING A VIRTUAL HOST FOR YOUR WEBSITE USING APACHE AND ENABLE PHP ON THE WEBSITE: The whole project is available in my git hub repo here : “<a href="https://github.com/Durgathulluru/LAMPstack">Durgathulluru/LAMPstack: This Is a LINUX APACHE MYSQL PHP project (github.com)</a>” in easy 5 steps and you will understand in deatail.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=55f8632d8067" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CI/CD Build docker-Jenkins pipeline From Zero to Hero]]></title>
            <link>https://medium.com/@durgasaikumarthulluru0515/ci-cd-build-docker-jenkins-pipeline-from-zero-to-hero-89f2fede7923?source=rss-37430518f0e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/89f2fede7923</guid>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Durga Sai Kumar Thulluru]]></dc:creator>
            <pubDate>Thu, 04 Jan 2024 02:51:52 GMT</pubDate>
            <atom:updated>2024-01-04T02:51:52.807Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xY8fRvoKTwiBOxAV-D2Nbg.gif" /></figure><p><strong>Demonstration of the continuous integration and delivery by Building a Docker Jenkins Pipeline:</strong></p><p><strong>Introduction:</strong></p><p>Terraform to set up resources from Amazon Web Services (AWS). Specifically, I’m setting up an EC2 instance (a virtual server) in the US East (N. Virginia) region. In addition, I’m installing several software tools on this server: Ansible , Python 3 (a programming language), pip3 (a package installer for Python), and Java v.11 (needed to run Jenkins, a continuous integration/continuous delivery tool), Docker (To build the application from a Docker file and push it to Docker Hub), Docker hub (To store the Docker image)</p><p>GitHub is a repository to store the application code and track its revisions)</p><p>Git helps to connect and push files from the local system to GitHub</p><p><strong>Required Tools And Files:</strong></p><ul><li>An AWS EC2 instance: This is a virtual server in the cloud where we’ll install our software.</li><li>SSH key: This is needed to access the EC2 instance from the terminal.</li><li>A Linux-based machine: This could be your personal computer or any remote machine that runs on Linux. You can access it using MobaXterm, a software that allows you to control remote servers.</li><li>Docker file: Docker can build images automatically by reading the instructions from a Dockerfile. A Dockerfile is a text document that contains all the commands a user could call on the command line to assemble an image.</li></ul><p><strong>Step 1: Creating an Linux server:</strong></p><p>I am not using Linux server locally as my system is windows, I have created an ec2 instance using Aws services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/436/1*kEuTFwPInGcnyw_Sl3l2lQ.png" /></figure><p><strong>Step 2: Terraform package installation:</strong></p><ol><li>Install terraform package from: <a href="https://developer.hashicorp.com/terraform/downloads">Install | Terraform | HashiCorp Developer</a></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*SDZIF53J_JQyJ9mJba2JCg.png" /></figure><p>2. I’m setting up the latest version of Terraform, which is 1.6.2. To do this, you’ll need to copy and paste each command into your terminal. Once you’ve successfully run the commands, you can check the installed version of Terraform with the following command:</p><p>terraform — version</p><p>After running this command, you should see output similar to this:</p><p>Terraform v1.6.2</p><p>on linux_amd64</p><p>This confirms that Terraform v1.6.2 is installed on your Linux machine.</p><p><strong>Step 3: How to create an access keys using aws services:</strong></p><p>When you log into AWS services, the default page that opens is the AWS console home page. From here, you can set up an IAM (Identity Access Management) user:</p><ul><li>Search for “IAM” in the AWS console.</li><li>Go to the “Users” tab and create a new user named “terra”.</li><li>Click on “Add attach policy” and add “EC2 full access”.</li><li>Click “Next” and then “Create”.</li></ul><p>Now, I created access keys for the “terra” user:</p><p>· Go to the “terra” user and click on “Create access keys”.</p><p>For more detailed instructions on creating an IAM user, I have refered to the official AWS documentation here. <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html">https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html</a></p><p>Next, you need to install the AWS CLI on your local Ubuntu server. You can do this by running the following command:</p><p>apt install awscli</p><p>This will install aws-cli/1.18.69. To ensure you have access to your AWS account, run the following command:</p><p>aws configure</p><p>You’ll be prompted to enter your IAM user access key ID, secret access key, default region name (e.g., us-east-1), and default output format (e.g., json).</p><p><strong>Step 4: creating an SSH-KEY and redirecting the path:</strong></p><p>1. I created a pair of private and public keys using the command sudo ssh -t rsa -b 4096. I also made a directory named “key” in my home/ubuntu path by running the command mkdir key.</p><p>2. I then changed the destination path to <strong>/home/ubuntu/key/tfkey-- </strong>as shown in picture bellow</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*Tt3PjohVJojsCzgv5GTQ4A.png" /></figure><p>3. I started writing a main.tf file in the terraform1 directory.</p><p>This main.tf file is crucial for creating infrastructure or resources on the AWS environment.</p><p><strong>Step 5: Terraform provisioning code</strong></p><p>4. I’ve created the SSH key using AWS resources by writing the code for creating both the public and private keys in the main.tf Terraform provisioning file. As usual, I’ve removed the key directory using the rm -rf key command that privously created. And I used ssh key file persission as 400. Which is only read permission.</p><p>5. The code for <strong>main.tf is as follows</strong>: (Please change the code as per your requirements).</p><blockquote>provider “aws” {</blockquote><blockquote>region = “us-east-1”</blockquote><blockquote>}</blockquote><blockquote>resource “tls_private_key” “tfkeyprivate” {</blockquote><blockquote>algorithm = “RSA”</blockquote><blockquote>rsa_bits = 4096</blockquote><blockquote>}</blockquote><blockquote>resource “local_file” “tf_key” {</blockquote><blockquote>content = tls_private_key.tfkeyprivate.private_key_pem</blockquote><blockquote>filename = “${path.module}/private_key.pem”</blockquote><blockquote>file_permission = “0400”</blockquote><blockquote>}</blockquote><blockquote>resource “aws_key_pair” “tfkeypublic” {</blockquote><blockquote>key_name = “tfkey”</blockquote><blockquote>public_key = tls_private_key.tfkeyprivate.public_key_openssh</blockquote><blockquote>}</blockquote><blockquote>resource “aws_instance” “myinstance” {</blockquote><blockquote>ami = “ami-0261755bbcb8c4a84” # This is an example ubuntu20.04 ID.</blockquote><blockquote>instance_type = “t2.micro”</blockquote><blockquote>key_name = aws_key_pair.tfkeypublic.key_name</blockquote><blockquote>tags = {</blockquote><blockquote>Name = “myinstance”</blockquote><blockquote>}</blockquote><blockquote>}</blockquote><blockquote>resource “aws_security_group” “http_sg” {</blockquote><blockquote>name = “http_sg”</blockquote><blockquote>description = “Security group for HTTP traffic”</blockquote><blockquote>ingress {</blockquote><blockquote>from_port = 80</blockquote><blockquote>to_port = 80</blockquote><blockquote>protocol = “tcp”</blockquote><blockquote>cidr_blocks = [“0.0.0.0/0”]</blockquote><blockquote>}</blockquote><blockquote>egress {</blockquote><blockquote>from_port = 0</blockquote><blockquote>to_port = 0</blockquote><blockquote>protocol = “-1”</blockquote><blockquote>cidr_blocks = [“0.0.0.0/0”]</blockquote><blockquote>}</blockquote><blockquote>}</blockquote><blockquote>resource “aws_security_group” “all_ipv4_sg” {</blockquote><blockquote>name = “all_ipv4_sg”</blockquote><blockquote>description = “Security group for all IPv4 traffic”</blockquote><blockquote>ingress {</blockquote><blockquote>from_port = 0</blockquote><blockquote>to_port = 0</blockquote><blockquote>protocol = “-1”</blockquote><blockquote>cidr_blocks = [“0.0.0.0/0”]</blockquote><blockquote>}</blockquote><blockquote>egress {</blockquote><blockquote>from_port = 0</blockquote><blockquote>to_port = 0</blockquote><blockquote>protocol = “-1”</blockquote><blockquote>cidr_blocks = [“0.0.0.0/0”]</blockquote><blockquote>}</blockquote><blockquote>}</blockquote><p>Then I ran <strong>terraform init</strong> command, it is used to initialize a working directory containing Terraform configuration files.</p><ol><li><a href="https://spacelift.io/blog/terraform-init"><strong>Backend Initialization</strong>: Prepares the backend, which maintains the state file that tracks the resources managed by Terraform2</a>.</li><li><a href="https://spacelift.io/blog/terraform-init"><strong>Child Module Installation</strong>: Downloads the modules needed for the Terraform configuration2</a>.</li><li><a href="https://spacelift.io/blog/terraform-init"><strong>Plugin Installation</strong>: Installs the necessary provider plugins</a></li></ol><p>I run the command <strong>terraform plan</strong> to see how many resources it was creating and type of resources it was creating</p><p>After that I run <strong>terraform apply --auto-approve</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*kwTcSVSYvO9PoTwL2AdQkg.png" /></figure><p>6. It has generated the file name of the <strong>private key</strong> in the present directory where the terraform init is initialized.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*Omhkn2hIcwhEZ-FLyQjIVw.png" /></figure><p>7. EC2instance was created, and Now I connected to instance using:</p><p>ssh -i private_key.pem <a href="/service/mailto:ubuntu@54.152.81.54">ubuntu@54.152.81.54</a> <strong>#provide your ec2 ip4 address</strong></p><p><strong>54.152.81.54 is myinstance public ip4 address.</strong></p><p>The results are shown below in the image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*j-KGhpyuQNrXW6k6DK-NIQ.png" /></figure><h3><strong>Step 6:</strong> <strong>java, ansible, and Jenkins</strong></h3><p>I have installed java by running:</p><blockquote><strong>apt install openjdk-11-jre-headless</strong></blockquote><p>This is my output I have received.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*CXt7CUP2cvEtw9B4Tc8PEw.png" /></figure><p>But I tried installing the python3 but its shows that python-3 is already installed in ubuntu 20.4</p><p>I have installed the ansible by running apt install ansible this command installed the</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*cWu7JeAB7b4hpqvmqWEW6w.png" /></figure><pre>Its time to install Jenkins before installing the jenkis, I have downloaded the a key from the Jenkins website and saves it to a specific location by running below command:</pre><p>wget -O /usr/share/keyrings/jenkins-keyring.asc <a href="https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key">https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E88qLt7orCTyF4mN4erPyw.png" /></figure><p>Now again I have added the Jenkins repository by running the command.</p><pre>echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] https://pkg.jenkins.io/debian-stable binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list &gt; /dev/null</pre><pre>apt update &amp;&amp; apt install Jenkins</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*iWQcXJUXWhXzcTnvxRUMVw.png" /></figure><pre>systemctl status Jenkins <br><br>systemctl start jenkins</pre><p>I have checked my Jenkins status by <strong>systemctl status Jenkins</strong></p><p><strong>And I have pulled my password using this command</strong></p><blockquote><strong>cat /var/lib/jenkins/secrets/initialAdminPassword</strong></blockquote><p>I used <strong>hhtp:// 54.152.81.54:8080</strong> to look my Jenkins in my server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*qyJgci0a4XqE9xeJPdR79A.png" /></figure><p>This is how my Jenkins dashboard looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*wh3lmUCGNs7BBDJn-Mbo1A.png" /></figure><p>Installation of docker in terminal: Before demonstrating the continuous integration and delivery by building a Docker Jenkins Pipeline, is necessary to perform the installation of each program that need to use. Because of that, is necessary to install Jenkins, Docker and Git.</p><p>The Jenkins installation is completed, now its time to install Docker and Git in the terminal.</p><p>To install Git in the terminal, run the following command below:</p><blockquote><strong>sudo apt-get update</strong></blockquote><blockquote><strong>sudo apt-get install git</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*ZWPu7vOHqNEwH-Cid7Qk8w.png" /></figure><p>On terminal, generate a new SSH key, use command: <br><strong>ssh-keygen -t rsa -b 4096</strong></p><p>I have Copied the generated ssh with command cat /home/ubuntu/.ssh/id_rsa.pub</p><p>And On GitHub portal access Profile &gt;&gt; SSH Keys &gt;&gt; Add New and paste the copied value as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*4FF_CmatXAkfg2PJ5f8CQw.png" /></figure><p><strong>GitHub Repository:</strong></p><p>I have Created a new Jenkins repository on GitHub Website, with name a Jenkins-docker.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*pVhdCiwl4JtNl2Wtz3p68Q.png" /></figure><p><strong>Installation of docker:</strong></p><p>here are the steps to install Docker on Ubuntu 20.04:</p><p><strong>Update your existing list of packages:</strong></p><p><strong>sudo apt update</strong></p><p><strong>Install prerequisite packages which let apt use packages over HTTPS:</strong></p><blockquote>sudo apt install apt-transport-https ca-certificates curl software-properties-common</blockquote><p><strong>Add the GPG key for the official Docker repository to your system:</strong></p><blockquote>curl -fsSL <a href="https://download.docker.com/linux/ubuntu/gpg">https://download.docker.com/linux/ubuntu/gpg</a> | sudo apt-key add -</blockquote><p><strong>Add the Docker repository to APT sources:</strong></p><blockquote>sudo add-apt-repository “deb [arch=amd64] <a href="https://download.docker.com/linux/ubuntu">https://download.docker.com/linux/ubuntu</a> $(lsb_release -cs) stable”</blockquote><p><strong>Update the package database with the Docker packages from the newly added repo:</strong></p><blockquote>sudo apt update</blockquote><p><strong>Ensure you are about to install from the Docker repo instead of the default Ubuntu repo:</strong></p><blockquote>apt-cache policy docker-ce</blockquote><p><strong>Install Docker:</strong></p><blockquote>sudo apt install docker-ce</blockquote><p>For more information, we Can visit docker official page: <a href="https://docs.docker.com/engine/install/ubuntu/">Install Docker Engine on Ubuntu | Docker Docs</a></p><p><strong>Verify if the Docker service is running:</strong></p><blockquote>sudo systemctl status docker</blockquote><p><strong>Step:7 Add the Docker Hub Credentials to Jenkins</strong></p><p>You could use your password for your Docker Hub credentials, but it’s better to create an access token to login into Docker Hub. The Jenkins pipeline will use your Docker Hub username and access token when pushing the Docker image to the Docker Hub repository. To create the Docker Hub access token, follow the steps below:</p><p>First Step: Log into your Docker Hub account</p><p>Second Step: Click `Account Settings`</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*HdJrsXZDyMBMNX7dwuXXIw.png" /></figure><p>Third Step: Click `Security`, Click `New Access Token` and Add Access Token Description</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*sv5dFnZXpKftf1jVBsl7vA.png" /></figure><p>After adding the access token description, click `Generate`. Copy and save the generated access token. You will go back to the Jenkins `Manage Credentials` and add the new credentials as shown below and add the token as password option.</p><p>Till here the configuration of docker in Jenkins is completed.</p><p>Created a Docker repo in <a href="https://medium.com/u/607469dace9">Docker</a> and name it as nodeapp</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*NH8g_F76ELrfjeqHrytGzA.png" /></figure><p>Create a Directory in terminal and I name it as jenkinsdocker:</p><p>as i jenkin</p><p>With the following command</p><blockquote>mkdir Jenkinsdocker</blockquote><blockquote>cd jnekinsdocker</blockquote><p>you can clone the Dockerfile from my git repository</p><p><strong>By using the following command:</strong></p><blockquote>git pull <a href="https://github.com/Durgathulluru/jenkins-dcoker.git">https://github.com/Durgathulluru/jenkins-dcoker.git</a> main</blockquote><p><strong>Dockerfile</strong> -</p><h4>FROM node:latest</h4><h4>WORKDIR /usr/src/app</h4><h4>COPY nodeapp/* /</h4><h4>RUN npm install</h4><h4>EXPOSE 3000</h4><h4>CMD [ “npm”,”start” ]</h4><p>And Node app is also available in my git repository, because I am trying to deploy a NodeJS application in, docker.</p><p><strong>Step 8: Creating a Jenkins Job</strong></p><p>To create a Jenkins job, follow the steps shown in the images below.</p><p>Step One: Go back to the Jenkins dashboard and click `Create a job` and name the job as Jenkins-docker</p><p>Select free style job and click on OK</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*lzWHcSqOss1tcbKXt5Yd3w.png" /></figure><p>Step Two : Give the description for the job and Go to source code section where you can asset the git hub repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*N8x9X754jUCoLSjTjL-PWQ.png" /></figure><p>And give the git repository username and password, after you click on the add button credentials.</p><p>And my default branch is main.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*83TNqd7qN0Nh2nnGczBiLg.png" /></figure><p>Now add the docker hub credentials only after you download the plugin from.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/390/1*PsKUH5WSpDXhsUGze8QdWQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*_KjQdVGDO7Wp8gSMZTxV6w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*MlGGWkV3IV2yM5rUiL_HEA.png" /></figure><p>I have clicked on <strong>save</strong> and click on <strong>build now</strong> where it has built successfully built image from and pushed it to my docker hub repository after pulling my files from git hub repository.</p><p>To make it as automated I have simply added a <strong>webhook</strong> in git hub and <strong>pollscm</strong> as every minute, this helps Jenkins to trigger the build every minute, in my Jenkins application. Whereas the GitHub Webhooks provide a way for notifications to be delivered to an external web server whenever certain events occur on GitHub. They allow your integrations to take an action in response to events that occur on GitHub.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*REpnG1YyX655LA9sOu-Ohw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89f2fede7923" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>