<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>devops Archives - ServerStadium</title>
	<atom:link href="https://serverstadium.com/knowledge-base/tag/devops/feed/" rel="self" type="application/rss+xml" />
	<link>https://serverstadium.com/knowledge-base/tag/devops/</link>
	<description>Public Cloud Solution by ServerStadium</description>
	<lastBuildDate>Wed, 19 Apr 2023 23:15:32 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.4</generator>

<image>
	<url>https://serverstadium.com/wp-content/uploads/2023/04/cropped-favicon-1-32x32.png</url>
	<title>devops Archives - ServerStadium</title>
	<link>https://serverstadium.com/knowledge-base/tag/devops/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Deploying Magento on ServerStadium</title>
		<link>https://serverstadium.com/knowledge-base/deploying-magento-on-serverstadium/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Mon, 31 May 2021 16:19:46 +0000</pubDate>
				<guid isPermaLink="false">https://cloudraya.com/knowledge-base/?p=1115</guid>

					<description><![CDATA[<p>Introduction This article will show you how to deploy Magento on ServerStadium Cloud. Before we begin, let’s get to know about Magento. In short, Magento is a content management system focused on eCommerce that helps users to create eCommerce websites. It was released on March 31, 2008, by Varien and then developed on Zend Framework.&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/deploying-magento-on-serverstadium/">Deploying Magento on ServerStadium</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Introduction</h2>



<p class="wp-block-paragraph">This article will show you how to deploy Magento on ServerStadium Cloud. Before we begin, let’s get to know about Magento.</p>



<p class="wp-block-paragraph">In short, Magento is a content management system focused on eCommerce that helps users to create eCommerce websites. It was released on March 31, 2008, by Varien and then developed on Zend Framework.</p>



<p class="wp-block-paragraph">In addition, there are some basic features of Magento:</p>



<ul class="wp-block-list">
<li><strong>Product management:</strong> able to manage products such as product images, product reviews, favorite product list, and product list.</li>
<li><strong>Category management:</strong> to help users find and then select products by category easier.</li>
<li><strong>Inventory management:</strong> it shows the management of product quantity and also the options.</li>
<li><strong>Client account:</strong> It shows account status, transaction history, preferred catalog, address, and also a shopping cart.</li>
<li><strong>Customer service:</strong> allows the admin to assist the customer actions, such as canceling an order, order tracking and history from an account, resetting mail and password, etc.</li>
<li><strong>Order Management</strong>: This feature relates to order as well as invoice management. So, the admin is able to view, edit, create, and fulfill orders and/or invoices from the admin panel.</li>
<li><strong>Payments:</strong> many payment methods, such as credit cards, PayPal, Google Checkout, support external payment modules like CyberSource, ePay, eWAY, and more.</li>
<li><strong>Search technology: </strong>is fast, friendly, and supports search on Google SiteMap.</li>
<li><strong>International support:</strong> Language support, multiple currencies, and tax rates.</li>
<li><strong>Promotion and marketing tools:</strong> These include coupons, promotions, and many more.</li>
<li><strong>Analyze and report:</strong> it integrates with the Google Analytics service and also provides multiple reports.</li>
</ul>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Installation Stage</h2>



<h5 class="wp-block-heading"><strong>1. System Requirements and Package Installation</strong></h5>



<p class="wp-block-paragraph">In this article, we will deploy Magento in a single-node environment. While the Magento deployment in the cluster may need additional environment and steps. The requirements for a single-node deployment are described below:</p>



<ul class="wp-block-list">
<li>Virtual Server with Ubuntu 20.04 x86_64 and 4 GB minimum memory</li>
<li>Nginx 1.x, as a web server</li>
<li>PHP7.4-FPM, and the extensions needed</li>
<li>MariaDB 10.4 as a database</li>
<li>Elasticsearch 7.x, as an indexing engine (required by Magento)</li>
<li>Composer 1.10.16</li>
</ul>



<h5 class="wp-block-heading"><strong>1.1 Creating a virtual machine in ServerStadium Cloud</strong></h5>



<p class="has-text-align-left wp-block-paragraph">Please find the virtual machine creation steps on <a href="https://serverstadium.com/knowledge-base/deploying-a-virtual-machine-in-serverstadium/" target="_blank" rel="noreferrer noopener">this link</a>. After that, Select Ubuntu 20.04 as a based OS in the image selection, and choose a package with a minimum of 4 GB memory resource.</p>



<h5 class="wp-block-heading"><strong>1.2 Installing Nginx 1.x Web Server</strong></h5>

<ul>
<li>First of all, please update the current Ubuntu repository by running this command  $ sudo apt update.</li>
<li>Then, Install the Nginx package from Ubuntu repository $ sudo apt install nginx -y.</li>
<li>Next, check the nginx version by executing $ nginx -v </li>
</ul>

<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<h5 class="wp-block-heading"><strong>1.3 Installing PHP7.4-FPM and the required extensions</strong></h5>



<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<ul class="wp-block-list">
<li>Firstly, type this command to install PHP7.4-FPM in the virtual machine $ sudo apt install php7.04-fpm -y</li>
<li>After that, Verify the PHP version <code>$ php -v </code></li>
<li>Then, add the required php extentions to the system.</li>
</ul>



<pre class="wp-block-preformatted"><code>$ sudo apt install -y php74u-pdo php74u-mysqlnd php74u-opcache php74u-xml php74u-gd php74u-devel php74u-mysql php74u-intl php74u-mbstring php74u-bcmath php74u-json php74u-iconv php74u-soap</code></pre>
</div></div>
</div></div>
</div></div>
</div></div>



<p class="wp-block-paragraph">&nbsp;</p>
</div></div>



<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<h5 class="wp-block-heading"><strong>1.4 Installing MariaDB 10.4</strong></h5>



<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<ul class="wp-block-list">
<li>First, setup the repository and install it to the virtual machine by following <a href="https://serverstadium.com/knowledge-base/how-to-install-and-secure-mariadb-on-ubuntu-18-04-and-20-04/" target="_blank" rel="noreferrer noopener">this link.</a></li>
<li>We can also follow the secure installing process in the link above to harden our MariaDB</li>
<li>Run the following command to install the dependency of MariaDB 10.4 <br /><code>$ sudo apt install -y mariadb-server-10.04 mariadb-client-10.4</code></li>
<li>Then, login the to the MariaDB server to determine its version</li>
</ul>


<div class="wp-block-image">
<figure class="aligncenter"><img fetchpriority="high" decoding="async" width="890" height="176" class="wp-image-1122" src="https://serverstadium.com/wp-content/uploads/2021/05/mariadb-version.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/05/mariadb-version.png 890w, https://serverstadium.com/wp-content/uploads/2021/05/mariadb-version-300x59.png 300w, https://serverstadium.com/wp-content/uploads/2021/05/mariadb-version-768x152.png 768w" sizes="(max-width: 890px) 100vw, 890px" /></figure>
</div></div></div>
</div></div>
</div></div>



<h5 class="wp-block-heading"><strong>1.5 Installing Elasticsearch 7.x</strong></h5>



<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<ul class="wp-block-list">
<li>We need Java Development Kid (JDK) before adding Elasticsearch to the virtual machine. We can install the JDK using the following command. <code>$ sudo apt install -y java-1.8.0-openjdk</code></li>
<li>Follow <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/deb.html" target="_blank" rel="noreferrer noopener">this link </a>for Ubuntu or Debian based platform.</li>
<li>Please also make sure the Elasticsearch service is running after it’s started.</li>
</ul>


<div class="wp-block-image">
<figure class="aligncenter"><img decoding="async" width="890" height="418" class="wp-image-1125" src="https://serverstadium.com/wp-content/uploads/2021/05/elasticsearch.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/05/elasticsearch.png 890w, https://serverstadium.com/wp-content/uploads/2021/05/elasticsearch-300x141.png 300w, https://serverstadium.com/wp-content/uploads/2021/05/elasticsearch-768x361.png 768w" sizes="(max-width: 890px) 100vw, 890px" /></figure>
</div>


<p class="wp-block-paragraph">&nbsp;</p>
</div></div>



<h5 class="wp-block-heading"><strong>1.6 Installing Composer</strong></h5>

<ul>
<li>The composer’s manual suggests not running the command using a root or super privileged. So, we will create a temporal user to execute the composer command.</li>
<li>Create a temporal user using the command below, and add it to www-data usergroup</li>
</ul>
<pre style="padding-left: 40px;"><span style="color: #ff0000;"><code>$ sudo adduser admuser</code></span></pre>
<pre style="padding-left: 40px;"><span style="color: #ff0000;"><code>$ sudo usermod -aG www-data admuser</code></span></pre>
<ul>
<li>Then, download the composer file direct from the internet. Then move the file to /usr/local/bin directory</li>
</ul>
<pre style="padding-left: 40px;"><span style="color: #ff0000;"><code>$ sudo curl -sS https://getcomposer.org/installer | php<br />$ sudo mv composer.phar /usr/local/bin/composer</code></span></pre>
<ul>
<li>Run the following command to change the composer version to 1.10.16</li>
</ul>
<pre style="padding-left: 40px;"><span style="color: #ff0000;"><code>$ composer self-update 1.10.16</code></span></pre>
<p>Let’s check all the installed dependencies using the simple script below</p>
<pre><span style="color: #ff0000;"><code>$ git clone <a style="color: #ff0000;" href="https://github.com/kingahmadr/magento-usefultools.git">https://github.com/kingahmadr/magento-usefultools.git</a>; cd magento-usefultools/script</code></span><br /><br /><span style="color: #ff0000;"><code>$ sh Check_All_Required_Package.sh</code></span></pre>

<figure class="wp-block-image size-large"><img decoding="async" width="1011" height="890" class="wp-image-1133" src="https://serverstadium.com/wp-content/uploads/2021/05/check-all-required-package-1.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/05/check-all-required-package-1.png 1011w, https://serverstadium.com/wp-content/uploads/2021/05/check-all-required-package-1-300x264.png 300w, https://serverstadium.com/wp-content/uploads/2021/05/check-all-required-package-1-768x676.png 768w" sizes="(max-width: 1011px) 100vw, 1011px" /></figure>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Minimal Configuration</h2>



<p class="wp-block-paragraph">In this section, We will tweak the configuration of all Magento dependencies on the virtual machine with minimal tweaking.</p>



<h5 class="wp-block-heading"><strong>2. Configuring Nginx and Terminate SSL</strong></h5>



<p class="wp-block-paragraph">We will configure the Nginx web server, to use the PHP-FPM as an upstream connection and configure the SSL Certificate on the domain.</p>

<ul>
<li>Create the domain file configuration in directory /etc/nginx/sites-available <span style="color: #ff0000;"><code><span style="color: #ff0000;">$ sudo touch &lt;name of your domain&gt;.&lt;tld&gt;</span></code></span></li>
</ul>

<p class="wp-block-paragraph"><strong>2.1 Domain Configuration</strong></p>



<ul class="wp-block-list">
<li>Configure the domain in /etc/nginx/sites-available as the following example:</li>
</ul>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="583" height="596" class="wp-image-1149" src="https://serverstadium.com/wp-content/uploads/2021/05/ahmadcloud.life_.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/05/ahmadcloud.life_.png 583w, https://serverstadium.com/wp-content/uploads/2021/05/ahmadcloud.life_-293x300.png 293w" sizes="(max-width: 583px) 100vw, 583px" />
<figcaption>Config File On /etc/nginx/sites-available</figcaption>
</figure>

<ul>
<li>Line 1 – 5 describes a fastcgi backend server between Nginx web server and PHP-FPM.</li>
<li>6 – 12, is a function to redirect http connection of the domain to an https connection.</li>
<li>15 – 17, described the name of the domain listened, and set the MAGE_ROOT variable to /var/www/magento (the Document Root of our Magento Platform).
<p><em>NOTE The server_name value in the configuration is a domain name that you have bought from the registrar</em></p>
</li>
<li>19, describes an included Nginx configuration in directory /var/www/magento. Magento provides a template configuration of nginx web server on their directory. We can include that configuration in our Nginx configuration.</li>
<li>21 – 24, define the SSL certificate file and SSL certificate key file directory. In this lines, it will be used by the web server to perform an SSL termination.</li>
<li>27 – 34, the directives for SSL hardening purposes.</li>
</ul>
<p>Create a symbolic link to /etc/nginx/sites-enabled</p>
<pre>$ sudo ln -s /etc/nginx/sites-available/ahmadcloud,life.conf /etc/nginx/sites-enabled/ahmadcloud.life.conf</pre>
<p>Test the Nginx configuration by executing nginx -t command. If the test success, execute the “nginx -s reload” to reload the current configuration</p>

<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="941" height="114" class="wp-image-1156" src="https://serverstadium.com/wp-content/uploads/2021/05/nginx-configuration-test.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/05/nginx-configuration-test.png 941w, https://serverstadium.com/wp-content/uploads/2021/05/nginx-configuration-test-300x36.png 300w, https://serverstadium.com/wp-content/uploads/2021/05/nginx-configuration-test-768x93.png 768w" sizes="(max-width: 941px) 100vw, 941px" /></figure>



<h5 class="wp-block-heading">2.2 <strong>Configuring PHP </strong></h5>



<p class="wp-block-paragraph">Find the php configuration file in /etc/php/7.4/fpm/php.ini &amp; /etc/php/7.4/cli/php.ini. Don’t forget to backup the original configuration of php.ini</p>



<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<ul class="wp-block-list">
<li>Firstly, set the system time zone for PHP. Locate the following setting and uncomment it if necessary</li>
</ul>



<pre class="wp-block-preformatted">date.timezone =</pre>



<ul class="wp-block-list">
<li>Then, increase the values for the PHP <code>realpath_cache_size</code>, and <code>realpath_cache_ttl</code> to recommended settings.</li>
</ul>



<pre class="wp-block-preformatted"><code><span style="color: #ff0000;">realpath_cache_size=10M</span>
<span style="color: #ff0000;">realpath_cache_ttl=7200</span></code></pre>



<ul class="wp-block-list">
<li>Enable opcache.save_comments, which is required for Magento 2.1 and later. Locate the opcache.save_comments directive and uncomment it if necessary. Make sure its value is set to 1</li>
</ul>



<figure class="wp-block-image"><img decoding="async" class="wp-image-1163" src="https://serverstadium.com/wp-content/uploads/2021/05/opcache.save_comments.png" alt="" /></figure>



<ul class="wp-block-list">
<li>Next, change the value of memory_limit, max_execution_time and zlib.output_compression to one of the values recommended.
<pre><span style="color: #ff0000;">memory_limit = 2G</span><br /><span style="color: #ff0000;">max_execution_time = 1800</span><br /><span style="color: #ff0000;">zlib.output_compression = On</span></pre>
</li>
</ul>
</div></div>



<h5 class="wp-block-heading">2.3 <strong>MariaDB instance Configuration</strong></h5>



<p class="wp-block-paragraph">This section will discuss how to create a new database instance for Magento. Although we recommend a new database instance, you can install Magento into an existing database instance (optionally).</p>



<ul class="wp-block-list">
<li>before that, login to your database server using a privileged user</li>
</ul>



<pre class="wp-block-preformatted"><span style="color: #ff0000;">$ mysql -uroot</span></pre>



<ul class="wp-block-list">
<li>Enter the following commands in the order shown to create a database instance named Magento with username Magento:<br /><strong>creating a new database </strong>
<p><code>create database magento;</code></p>
<p><strong>make a new user with a localhost access </strong></p>
<br />
<p><span style="color: #ff0000;"><code>create user 'magento'@'localhost' IDENTIFIED BY 'R2phuYzuMAEG8jgS';</code></span></p>
<p><strong>Grant all privileges to user magento@localhost to database Magento </strong></p>
<br />
<p><span style="color: #ff0000;"><code>GRANT ALL ON magento.* TO 'magento'@'localhost';flush privileges;</code></span></p>
</li>
<li>Verify the database</li>
</ul>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1303" height="226" class="wp-image-1166" src="https://serverstadium.com/wp-content/uploads/2021/05/verify_database.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/05/verify_database.png 1303w, https://serverstadium.com/wp-content/uploads/2021/05/verify_database-300x52.png 300w, https://serverstadium.com/wp-content/uploads/2021/05/verify_database-1024x178.png 1024w, https://serverstadium.com/wp-content/uploads/2021/05/verify_database-768x133.png 768w" sizes="(max-width: 1303px) 100vw, 1303px" /></figure>



<h5 class="wp-block-heading">2.3.1 Magento Database Tweaking</h5>

<p>We recommend you configure your database instance as appropriate for your business. When configuring your database, please keep the following in mind:</p>
<ol>
<li>Indexers require higher tmp_table_size and max_heap_table_size values (e.g., 64M). If you configure the batch_size parameter, you can adjust that value and table size settings to improve indexer performance.</li>
</ol>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1168" src="https://serverstadium.com/wp-content/uploads/2021/05/verify_database-1.png" alt="" width="1303" height="226" srcset="https://serverstadium.com/wp-content/uploads/2021/05/verify_database-1.png 1303w, https://serverstadium.com/wp-content/uploads/2021/05/verify_database-1-300x52.png 300w, https://serverstadium.com/wp-content/uploads/2021/05/verify_database-1-1024x178.png 1024w, https://serverstadium.com/wp-content/uploads/2021/05/verify_database-1-768x133.png 768w" sizes="(max-width: 1303px) 100vw, 1303px" /></p>
<ol start="2">
<li>For optimal performance, make sure all MySQL and Magento index tables can be kept in memory (e.g., configure innodb_buffer_pool_size)</li>
<li>Reindex process on MariaDB 10.4 takes more time compared to other MariaDB or MySQL versions. To speed up reindex process, we recommend setting these MariaDB configuration parameters,</li>
</ol>
<pre>optimizer_switch=’rowid_filter=off’, optimizer_use_condition_selectivity = 1 </pre>
<p>To set those variables permanently, We will create the *.cnf file in /etc/mysql/mariadb.conf.d/ directory. We will name the file magento.cnf</p>

<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="937" height="153" class="wp-image-1170" src="https://serverstadium.com/wp-content/uploads/2021/05/mariadb-reindexing.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/05/mariadb-reindexing.png 937w, https://serverstadium.com/wp-content/uploads/2021/05/mariadb-reindexing-300x49.png 300w, https://serverstadium.com/wp-content/uploads/2021/05/mariadb-reindexing-768x125.png 768w" sizes="(max-width: 937px) 100vw, 937px" /></figure>

<p>To check the variable&#8217;s value, we can execute the below command:</p>
<pre>mysql -uroot -e "SHOW VARIABLES LIKE 'optimizer_switch';" | grep -i "rowid_filter" \<br /><br />&amp;&amp; mysql -uroot -e "SHOW VARIABLES LIKE 'optimizer_use_condition_selectivity';"</pre>

<figure class="wp-block-image size-large is-style-default"><img loading="lazy" decoding="async" width="1510" height="263" class="wp-image-1171" src="https://serverstadium.com/wp-content/uploads/2021/05/variable-value.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/05/variable-value.png 1510w, https://serverstadium.com/wp-content/uploads/2021/05/variable-value-300x52.png 300w, https://serverstadium.com/wp-content/uploads/2021/05/variable-value-1024x178.png 1024w, https://serverstadium.com/wp-content/uploads/2021/05/variable-value-768x134.png 768w" sizes="(max-width: 1510px) 100vw, 1510px" /></figure>



<h5 class="wp-block-heading">2.4 Elasticsearch Configuration</h5>

<p>There are three things we would like to change in the file configuration (/etc/elasticsearch/elasticsearch.yml)</p>
<ul>
<li>Update the Cluster Name by replacing the cluster.name value, with something descriptive, for instance, “<strong>Magento Cluster</strong>”. </li>
<li>Then, update the Node Name, and replace the node-name value with something descriptive like “<strong>Magento Node</strong>”</li>
<li>You need to update the Network Host also. And finally, do the same with network.host , replacing the IP (“192.168.0.1”) with “localhost”.</li>
<li>Lastly, Save the configuration and restart the service. </li>
</ul>
<pre style="padding-left: 40px;"># systemctl restart elasticsearch.service</pre>

<h5 class="wp-block-heading">3. Deploy Magento using composer</h5>



<p class="wp-block-paragraph">First of all, we will need a Magento Marketplace account and generate a set of keys during the Magento 2.4 installation process. Once sign into Magento Marketplace, navigate to My Profile. Under the Marketplace tab, click on Access Keys. After that, under the Magento 2 tab, click the Create A New Access Key button. In the Popup, give this a proper name, such as the Business Name of the website you plan to install (note, you cannot use spaces). Once you generate your <strong>Public Key</strong> and <strong>Private Key</strong>, put them somewhere safe for later.</p>

<ul>
<li>To begin the Magento installation using composer, first, navigate to Magento Document Root (/var/www/magento)</li>
<li>Change the folder owner to admuser:www-data</li>
</ul>
<p style="padding-left: 40px;"># cd /var/www</p>
<p style="padding-left: 40px;"># chown -R admuser:www-data magento</p>
<p style="padding-left: 40px;"># cd magento</p>
<ul>
<li>Execute the composer installer as an admuser user</li>
</ul>
<p style="padding-left: 40px;"># su admuser -c “composer create-project &#8211;repository-url=https://repo.magento.com/ magento/project-community-edition=2.4.0 .”</p>
<ul>
<li>During the setup, we will be asked for a Username and a Password. Just to be clear, Username = <strong>Public Key</strong> and Password = <strong>Private Key</strong>. Once underway, the composer process can take anywhere from 5-10 minutes to complete</li>
</ul>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1174" src="https://serverstadium.com/wp-content/uploads/2021/05/magento-composer-deployment-1-e1621457707667.png" alt="" width="1205" height="159" srcset="https://serverstadium.com/wp-content/uploads/2021/05/magento-composer-deployment-1-e1621457707667.png 1205w, https://serverstadium.com/wp-content/uploads/2021/05/magento-composer-deployment-1-e1621457707667-300x40.png 300w, https://serverstadium.com/wp-content/uploads/2021/05/magento-composer-deployment-1-e1621457707667-1024x135.png 1024w, https://serverstadium.com/wp-content/uploads/2021/05/magento-composer-deployment-1-e1621457707667-768x101.png 768w" sizes="(max-width: 1205px) 100vw, 1205px" /></p>
<ul>
<li>In the current directory, run the following instruction to setup Magento with a described environment. You must define your own to fulfill your needs. Below is just an example of my setup. </li>
</ul>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1176" src="https://serverstadium.com/wp-content/uploads/2021/05/Magento-installation-script.png" alt="" width="617" height="350" srcset="https://serverstadium.com/wp-content/uploads/2021/05/Magento-installation-script.png 617w, https://serverstadium.com/wp-content/uploads/2021/05/Magento-installation-script-300x170.png 300w" sizes="(max-width: 617px) 100vw, 617px" /></p>
<p>Once the setup is complete, it will look like this</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1177" src="https://serverstadium.com/wp-content/uploads/2021/05/setup-completed.png" alt="" width="994" height="357" srcset="https://serverstadium.com/wp-content/uploads/2021/05/setup-completed.png 994w, https://serverstadium.com/wp-content/uploads/2021/05/setup-completed-300x108.png 300w, https://serverstadium.com/wp-content/uploads/2021/05/setup-completed-768x276.png 768w" sizes="(max-width: 994px) 100vw, 994px" /></p>

<p class="wp-block-paragraph" style="font-size: 12px;"><em>NOTE: IF YOU HAVE AN ISSUE WITH TWO-FACTOR AUTHENTICATION STEPS, YOU CAN DISABLE THE MODULE <a href="https://magento.stackexchange.com/questions/318715/how-to-disable-two-factor-authentication-module-in-magento-2-4" target="_blank" rel="noreferrer noopener">HERE</a></em>.</p>



<p class="wp-block-paragraph">After this section, you should be able to access Magento from your domain. (e.g https://ahmadcloud.life/admin_zazwsv)</p>



<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1248" height="904" data-id="1178" class="wp-image-1178" src="https://serverstadium.com/wp-content/uploads/2021/05/landing-page1.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/05/landing-page1.png 1248w, https://serverstadium.com/wp-content/uploads/2021/05/landing-page1-300x217.png 300w, https://serverstadium.com/wp-content/uploads/2021/05/landing-page1-1024x742.png 1024w, https://serverstadium.com/wp-content/uploads/2021/05/landing-page1-768x556.png 768w" sizes="(max-width: 1248px) 100vw, 1248px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1149" height="941" data-id="1179" class="wp-image-1179" src="https://serverstadium.com/wp-content/uploads/2021/05/landing-page2.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/05/landing-page2.png 1149w, https://serverstadium.com/wp-content/uploads/2021/05/landing-page2-300x246.png 300w, https://serverstadium.com/wp-content/uploads/2021/05/landing-page2-1024x839.png 1024w, https://serverstadium.com/wp-content/uploads/2021/05/landing-page2-768x629.png 768w" sizes="(max-width: 1149px) 100vw, 1149px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1879" height="836" data-id="1180" class="wp-image-1180" src="https://serverstadium.com/wp-content/uploads/2021/05/landing-page3.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/05/landing-page3.png 1879w, https://serverstadium.com/wp-content/uploads/2021/05/landing-page3-300x133.png 300w, https://serverstadium.com/wp-content/uploads/2021/05/landing-page3-1024x456.png 1024w, https://serverstadium.com/wp-content/uploads/2021/05/landing-page3-768x342.png 768w, https://serverstadium.com/wp-content/uploads/2021/05/landing-page3-1536x683.png 1536w" sizes="(max-width: 1879px) 100vw, 1879px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1745" height="888" data-id="1181" class="wp-image-1181" src="https://serverstadium.com/wp-content/uploads/2021/05/landing-page4.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/05/landing-page4.png 1745w, https://serverstadium.com/wp-content/uploads/2021/05/landing-page4-300x153.png 300w, https://serverstadium.com/wp-content/uploads/2021/05/landing-page4-1024x521.png 1024w, https://serverstadium.com/wp-content/uploads/2021/05/landing-page4-768x391.png 768w, https://serverstadium.com/wp-content/uploads/2021/05/landing-page4-1536x782.png 1536w" sizes="(max-width: 1745px) 100vw, 1745px" /></figure>

<figcaption class="blocks-gallery-caption">Magento Pages Example</figcaption>
</figure>
</div></div>



<p class="wp-block-paragraph">&nbsp;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/deploying-magento-on-serverstadium/">Deploying Magento on ServerStadium</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Classes: Post Installation on Ansible</title>
		<link>https://serverstadium.com/knowledge-base/classes-post-installation-on-ansible/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Fri, 26 Feb 2021 02:57:19 +0000</pubDate>
				<guid isPermaLink="false">https://cloudraya.com/knowledge-base/?p=624</guid>

					<description><![CDATA[<p>Managing many servers is not an easy job; we need to plan and create a good and manageable Ansible Playbook to implement Ansible properly. Since then, we all agree that it is hard to manage a lot of servers at once. For example, you have installed 50 VMs/Servers with fresh OS and need to add&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/classes-post-installation-on-ansible/">Classes: Post Installation on Ansible</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Managing many servers is not an easy job; we need to plan and create a good and manageable Ansible Playbook to implement Ansible properly.</p>



<p class="wp-block-paragraph">Since then, we all agree that it is hard to manage a lot of servers at once. For example, you have installed 50 VMs/Servers with fresh OS and need to add some users to it.</p>



<p class="wp-block-paragraph">Thus, In this class, we will learn how to add some users to the servers using Ansible Playbook.</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">How to Add users using Ansible Playbook</h2>



<p class="wp-block-paragraph">First, create a folder called ansible_try</p>



<p class="wp-block-paragraph">Under folder ansible_try, create files for inventory and YML master playbook.</p>



<p class="wp-block-paragraph">For the inventory file, please fill in the lists of the IP address server.</p>



<pre class="wp-block-preformatted"><sup><code>[allserver]</code></sup> <sup><code>192.168.20.183</code></sup> <sup><code>192.168.20.184</code></sup></pre>



<p class="wp-block-paragraph">Then, create a YML file for the master playbook</p>



<ul class="wp-block-list">
<li>usergroup.yml</li>
</ul>



<pre class="wp-block-preformatted"><code>   hosts: allservers</code> <code>gather_facts: false</code> <code>roles:</code> <code>- usergroup</code></pre>



<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<ul class="wp-block-list">
<li>after that, create 3 folders called tasks, files, and vars.</li>
</ul>



<ul class="wp-block-list">
<li>The tasks folder, will be filled with the Ansible automation code</li>
</ul>



<ul class="wp-block-list">
<li>Files folder will be filled with the SSH_Key_Pub and sudoers config file</li>
</ul>



<ul class="wp-block-list">
<li>The Vars folder will be filled with variables files for Ansible automation code</li>
</ul>



<p class="wp-block-paragraph">Then, go to the Task folder and create a file as below:</p>



<p class="wp-block-paragraph">main.ym</p>
</div></div>



<p class="wp-block-paragraph">&nbsp;</p>
</div></div>



<pre class="wp-block-preformatted"><code>import_tasks: configureSudoers.yml</code> <code>import_tasks: configureUsers.yml</code> __________________________________________________</pre>



<p class="wp-block-paragraph">configureSudoers.yml</p>



<pre class="wp-block-preformatted"><code>name: Create Engineer Group</code> <code>group: name=engineer state=present</code> <code>ignore_errors: yes</code> <code>become: true</code> <code>tags:</code> <code>- sudoersgroup</code> <code>name: Engineer Group As Sudoers</code> <code>copy: src=sudoers.d/00-engineer.j2 dest=/etc/sudoers.d/00-engineer</code> <code>owner=root</code> <code>group=root</code> <code>mode=440</code> <code>backup=no</code> <code>ignore_errors: yes</code> <code>become: true</code> <code>tags:</code> <code>- sudoersgroup</code> _________________________________________________</pre>



<p class="wp-block-paragraph">configureUsers.yml</p>



<pre class="wp-block-preformatted"><br /><code>name: Manage Users SA</code><br /><code>user:</code><br /><code>name: "{{ item.key }}"</code><br /><code>state: "{{ item.value.state }}"</code><br /><code>groups: "{{ item.value.groups }}"</code><br /><code>shell: "{{ item.value.shell }}"</code><br /><code>with_dict: '{{users_sa}}'</code><br /><code>become: true</code><br /><code>tags:</code><br /><code>- usergroup</code><br /><br /><code>name: Manage User Keys SA</code><br /><code>authorized_key:</code><br /><code>user: "{{ item.key }}"</code><br /><code>state: present</code><br /><code>key: "{{ lookup('file', item.value.authkey) }}"</code><br /><code>with_dict: '{{users_sa}}'</code><br /><code>become: true</code><br /><code>tags:</code><br /><code>- usergroup</code><br /><br /><code>name: Remove inactive User</code><br /><code>user:</code><br /><code>name: "{{ item.key }}"</code><br /><code>state: "{{ item.value.state }}"</code><br /><code>remove: "{{ item.value.remove }}"</code><br /><code>with_dict: '{{ inactiveUsers }}'</code><br /><code>become: true</code><br /><code>tags:</code><br /><code>- usergroup</code><br /><code>- remove</code></pre>



<ul class="wp-block-list">
<li>After creating the task code, then go to the vars folder and create main.yml file</li>
</ul>



<pre class="wp-block-preformatted">main.yml<br /><br /><code>users_sa:<br />user1:<br />name: user1<br />state: present<br />groups: engineer<br />shell: /bin/bash<br />authkey: authkeys/user1.pub<br /><br />users_noc:<br />user2:<br />name: user2<br />state: present<br />groups: engineer<br />shell: /bin/bash<br />authkey: authkeys/user.pub</code><br /><br /><code>inactiveUsers:</code><br /><code>alfian:<br />state: absent<br />remove: yes<br /></code></pre>



<ul class="wp-block-list">
<li>Then, goes to the Files Folder and create two subfolders &#8220;authkeys&#8221; and &#8220;sudoers.d&#8221;</li>
<li>Under the folder &#8220;authkeys&#8221;, put the SSH_Key_Public according to it&#8217;s username, for example, user1.pub, user2.pub</li>
<li>Next, under the &#8220;sudoers.d&#8221;, put the jinja file about the sudoers file configuration that will be copied to the server as below
<ul>
<li>Create a file with name 00-engineer.j2</li>
<li>Fill with below sudoers configuration<br />&#8220;%engineer ALL=NOPASSWD: ALL&#8221;</li>
</ul>
</li>
</ul>



<ul class="wp-block-list">
<li>Back to the top of folder ansible_try and run this command</li>
</ul>



<pre class="wp-block-preformatted"><code>ansible-playbook -i inventory usergroup.yml -u ubunt</code>u</pre>



<ul class="wp-block-list">
<li>ansible-playbook is a command for running a playbook
<ul>
<li>-i is for variable inventory</li>
<li>-u is for the username used for SSH</li>
</ul>
</li>
</ul>



<ul class="wp-block-list">
<li>The Output will go like this</li>
</ul>



<pre class="wp-block-code"><code>PLAY [allserver] *************************************************************************************************************************************

TASK [usergroup : Create Engineer Group] *************************************************************************************************************
ok: [192.168.20.184]
ok: [192.168.20.183]

TASK [usergroup : Engineer Group As Sudoers] *********************************************************************************************************
changed: [192.168.20.183]
changed: [192.168.20.184]

TASK [usergroup : Manage Users SA] *******************************************************************************************************************
ok: [192.168.20.183] =&gt; (item={'key': 'user1', 'value': {'name': 'user1', 'state': 'present', 'groups': 'engineer', 'shell': '/bin/bash', 'authkey': 'authkeys/user1.pub'}})
ok: [192.168.20.184] =&gt; (item={'key': 'user1', 'value': {'name': 'user1', 'state': 'present', 'groups': 'engineer', 'shell': '/bin/bash', 'authkey': 'authkeys/user1.pub'}})
ok: [192.168.20.183] =&gt; (item={'key': 'user2', 'value': {'name': 'user2', 'state': 'present', 'groups': 'engineer', 'shell': '/bin/bash', 'authkey': 'authkeys/user2.pub'}})
ok: [192.168.20.184] =&gt; (item={'key': 'user2', 'value': {'name': 'user2', 'state': 'present', 'groups': 'engineer', 'shell': '/bin/bash', 'authkey': 'authkeys/user2.pub'}})

TASK [usergroup : Remove inactive User] **************************************************************************************************************
ok: [192.168.20.183] =&gt; (item={'key': 'alfian', 'value': {'name': 'alfian', 'state': 'absent', 'remove': True}})
ok: [192.168.20.184] =&gt; (item={'key': 'alfian', 'value': {'name': 'alfian', 'state': 'absent', 'remove': True}})

PLAY RECAP *******************************************************************************************************************************************
192.168.20.183             : ok=5    changed=2    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
192.168.20.184             : ok=5    changed=2    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
</code></pre>



<ul class="wp-block-list">
<li>If you want just to send a command to get the output, like checking the OS version, just execute this command</li>
</ul>



<pre class="wp-block-preformatted"><br /><code>ansible allserver -m shell -a "lsb_release -a" -i inventory -u ubuntu</code></pre>



<ul class="wp-block-list">
<li>The output will go like this</li>
</ul>



<pre class="wp-block-code"><code>192.168.20.184 | CHANGED | rc=0 &gt;&gt;
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.5 LTS
Release:        16.04
Codename:       xenialNo LSB modules are available.
192.168.20.183 | CHANGED | rc=0 &gt;&gt;
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.5 LTS
Release:        16.04
Codename:       xenialNo LSB modules are available.
</code></pre>



<ul class="wp-block-list">
<li>So with this Ansible command, you don&#8217;t need to sign in to every single server to check the OS version, and it will make your action faster, especially if the server you manage is quite a large scale.</li>
</ul>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Summary</h2>



<p class="wp-block-paragraph">To manage many servers, you need to learn how to run Ansible post the installation. Eager to know more? Visit our <a href="https://ServerStadium.com/knowledge-base/" target="_blank" rel="noreferrer noopener">site.</a></p>
<p>The post <a href="https://serverstadium.com/knowledge-base/classes-post-installation-on-ansible/">Classes: Post Installation on Ansible</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Classes: Install and Configure Ansible</title>
		<link>https://serverstadium.com/knowledge-base/install-and-configure-ansible/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Wed, 24 Feb 2021 07:09:13 +0000</pubDate>
				<guid isPermaLink="false">https://cloudraya.com/knowledge-base/?p=626</guid>

					<description><![CDATA[<p>Previously we have introduced Ansible. Therefore, this article will discuss how to install and configure Ansible on Linux. In short, Ansible is an agentless automation tool that uses SSH and Python to manage remote servers. It does not need a database server or run as a daemon or service. You can easily install it on&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/install-and-configure-ansible/">Classes: Install and Configure Ansible</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Previously we have introduced Ansible. Therefore, this article will discuss how to install and configure Ansible on Linux.</p>



<p class="wp-block-paragraph">In short, <a href="https://kb.iu.edu/d/aaik">Ansible</a> is an agentless automation tool that uses SSH and Python to manage remote servers. It does not need a database server or run as a daemon or service. You can easily install it on a server or a laptop, and that’s it; after that, you can start using Ansible to manage an entire fleet of remote servers from your laptop.</p>



<p class="wp-block-paragraph">When Ansible manages remote <a href="https://ServerStadium.com/knowledge-base/deploying-a-virtual-machine-in-Server-Stadium/">machines,</a> it does not leave software installed or running on them. So there’s no real question about how to upgrade Ansible when moving to a new version. In addition, currently, Ansible can be run from any machine with Python 2 (version 2.7) or Python 3 (versions 3.5 and higher) installed.</p>



<p class="wp-block-paragraph">Ansible only needs python2 (version 2.7) or python3 (version 3.5 and higher) installed on the remote servers to manage them, and that’s it; no need for other software or service, which is why it’s called agentless.</p>



<p class="wp-block-paragraph">Therefore, to understand better, please closely examine how to install and configure Ansible on Linux below.</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Installing Ansible on Linux</h2>



<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<ul class="wp-block-list">
<li>On Fedora:</li>
</ul>



<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<pre class="wp-block-preformatted"><code>$ sudo dnf install ansible </code></pre>
</div></div>
</div></div>



<ul class="wp-block-list">
<li>On RHEL and CentOS:</li>
</ul>



<pre class="wp-block-preformatted"><code>$ sudo yum install ansible</code></pre>



<ul class="wp-block-list">
<li>On Ubuntu:</li>
</ul>



<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<pre class="wp-block-preformatted"><code>$ sudo apt update </code><br /><code>$ sudo apt install software-properties-common </code><br /><code>$ sudo apt-add-repository --yes --update ppa:ansible/ansible </code><br /><code>$ sudo apt install ansible</code></pre>
</div></div>



<p class="wp-block-paragraph">Once you have installed Ansible, run the command below to make sure that Ansible is installed properly.</p>



<pre class="wp-block-preformatted"><code>$ ansible --version</code></pre>



<p class="wp-block-paragraph">Then, you will see the output would be something like the below.</p>



<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<pre class="wp-block-preformatted"><br /><code>ansible 2.9.16<br />config file = /etc/ansible/ansible.cfg<br />configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']<br />ansible python module location = /usr/lib/python2.7/dist-packages/ansible<br />executable location = /usr/bin/ansible<br />python version = 2.7.17 (default, Sep 30 2020, 13:38:04) [GCC 7.5.0]</code></pre>
</div></div>



<p class="wp-block-paragraph">Due to the output, we could see that Ansible has a configuration that can be optimized as your need at /etc/ansible/ansible.cfg<br />By default, the configuration is enough for you to make an Ansible role as well as Ansible read the ssh keys form ~/.ssh/id_rsa. Although It depends on what users are logging in, you still can optimize that in the [ssh_connection] section. Not only can you make it more fun by optimizing the color of your ansible output, but you can also change it in the [colors] section as well.</p>



<p class="wp-block-paragraph">As I mentioned in the previous classes, you need to follow the Ansible hierarchy to make Ansible run well. By default, ansible already created files on /etc/ansible path for inventory and roles, but you can move it to your desired path.</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Ansible hierarchy</h2>



<ul class="wp-block-list">
<li>Inventory: this file is for the inventory list of your server. You can group it with server functions or roles.<br />Example format:<br />[allserver]<br />192.168.20.1<br />192.168.20.2<br />192.168.20.3<br />192.168.20.4<br /><br />[lb_server]<br />192.168.20.1<br />192.168.20.2</li>
<li>Group_vars: here we assign variables to particular groups<br />This will be applied to all servers when Ansible runs<br />Example format:<br />ntpserverip: ntp.domain.com<br />rsyslog_version: &#8216;*&#8217;</li>
<li>Host_vars: if systems need specific variables, put them here.<br />This will be applied to some servers that are defined in this path.<br />Thus, the file should be named with the IP listed in the inventory<br />Example format:<br />host_name: lb-vm1<br />host_domain: domain.com<br />full_host_name: &#8220;{{ host_name }}.{{ host_domain }}&#8221;<br />ip_address: 192.168.20.1</li>
</ul>



<ul class="wp-block-list">
<li>site.yml: master playbook<br />This file will be called in the first time when running ansible-playbook<br />In this file, you need to define what role and which server will be executed. Then, you need to save the file in yml format.<br />Example format:<br />hosts: allserver<br />gather_facts: false<br />roles:<br />&#8211; usergroup</li>
</ul>



<ul class="wp-block-list">
<li>roles: list of roles and scripts that will be executed.</li>
</ul>



<p class="wp-block-paragraph">So, do you want to know how to use Ansible?<br />Please follow this link.</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/install-and-configure-ansible/">Classes: Install and Configure Ansible</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Classes: Introduction to Ansible for a robust Configuration Management</title>
		<link>https://serverstadium.com/knowledge-base/introduction-to-ansible-for-a-robust-configuration-management/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Tue, 23 Feb 2021 11:52:52 +0000</pubDate>
				<guid isPermaLink="false">https://cloudraya.com/knowledge-base/?p=628</guid>

					<description><![CDATA[<p>Do you need robust configuration management? If you manually manage many servers with many configurations, then you know how difficult it is. This is where Ansible can help you to have better server management and configuration standardization without too much hassle. What is Ansible? Ansible is an open-source IT Configuration Management, Deployment &#38; Orchestration tool.&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/introduction-to-ansible-for-a-robust-configuration-management/">Classes: Introduction to Ansible for a robust Configuration Management</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Do you need robust configuration management? If you manually manage many servers with many configurations, then you know how difficult it is. This is where Ansible can help you to have better server management and configuration standardization without too much hassle.</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>What is Ansible?</strong></h2>



<ul class="wp-block-list">
<li>Ansible is an open-source IT Configuration Management, Deployment &amp; Orchestration tool.</li>
<li>It aims to provide large productivity gains to various automation challenges.<br />For example, you are going to config SMTP servers or collect logs from SMTP servers.</li>
<li>This tool is very simple to use but powerful enough to automate complex application environments.</li>
<li>Ansible is an automation tool that provides a way to define infrastructure as code.</li>
<li>Infrastructure as code (IAC) means managing infrastructure by writing code rather than using manual processes.</li>
<li>You don’t need to know the commands to accomplish a specific task.<br />For example, when adding a new user on Linux OS. Normally, you need to run more than two commands to add the new user.</li>
<li>In Ansible, you simply need to specify what state you want the system to be in, and then Ansible will take care of it. <br />(In case of adding a user, state can be &#8220;present&#8221; or &#8220;absent&#8221;)</li>
<li>For example,
<ul>
<li>Task for create new user<br />&#8211; name: Manage Users  <br />user:    <br />name: user1    <br />state: present  <br />groups: engineer    <br />shell: /bin/bash    <br />become: true  <br />tags:    &#8211; usergroup</li>
</ul>
</li>
</ul>



<p class="wp-block-paragraph">Ansible connects via SSH to remote hosts listed on inventory files such as /etc/ansible/hosts. You can do a simple command by using the Ansible adhoc command. For example, to get a date from a server, you can do it like “ansible –m command SERVER date”.</p>



<p class="wp-block-paragraph">You can also do a complete setup on a server, like installing apps and configuring them on a server using Ansible Playbook. Playbook is a template for which “Infrastructure as a Code” term refers to a Code.</p>



<p class="wp-block-paragraph">Playbook will have modules, inventory, and tasks. Since Playbook is a template, we can use it as a standard centralized configuration for all the server provisioning. Also, we can share the templates and modify them as needed.</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Terminologies</h2>



<p class="wp-block-paragraph" id="6edf">Generally, Ansible uses these terminologies below:</p>



<ol class="wp-block-list">
<li>Controller Machine: Machine to install Ansible</li>
<li>Inventory: detailed info regarding servers to be managed</li>
<li>Playbook: Automation is defined using tasks defined in YAML format</li>
<li>Task: Procedure to be executed</li>
<li>Module: Predefined command execute directly on remote hosts</li>
<li>Play: Execution of a playbook</li>
<li>Role: a Pre-defined way for organizing playbooks</li>
<li>Handlers: Tasks with unique names. Another task will execute it if there is any notification. <br /><br />(For an example of the configuration, please visit &#8220;Classes: Install and Configure Ansible&#8221; and &#8220;Classes: Post Installation&#8221;)</li>
</ol>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Advantages of Ansible</strong> for Configuration Management</h2>



<ul class="wp-block-list">
<li>Ansible is an open-source tool.</li>
<li>Ansible’s playbooks do not require special coding skills.</li>
<li>It also allows you to model even highly complex IT workflows.<br />For example, you need to add a repository based on the OS version.</li>
<li>You do not need to install any agent on the target systems you want to automate.</li>
<li>You do not need to set up a separate management structure like puppet.</li>
<li>Since you don’t have to install any extra software, your server has more room for application resources.</li>
<li>Ansible is simple, reliable, and consistent for configuration management.</li>
<li>Secure and consistent<br />Because Ansible only uses SSH and Python on the managed nodes, it ensures safety and security.</li>
<li>Reliable<br />An Ansible playbook can be idempotent when written carefully. This prevents unexpected side effects on the managed systems.<br />An operation is idempotent if the result of performing it once is exactly the same as the result of performing it repeatedly without any intervening actions (denoting an element of a set that is unchanged).</li>
</ul>



<p class="wp-block-paragraph">Lastly, if you want to know how to install and configure Ansible, you can find out by reading <a href="https://ServerStadium.com/knowledge-base/install-and-configure-ansible/" target="_blank" rel="noreferrer noopener">this article.</a></p>
<p>The post <a href="https://serverstadium.com/knowledge-base/introduction-to-ansible-for-a-robust-configuration-management/">Classes: Introduction to Ansible for a robust Configuration Management</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
