<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Saif</title>
    <description>The latest articles on Forem by Saif (@saif02).</description>
    <link>https://forem.com/saif02</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F378535%2F2dc24ac3-90b6-4fd9-976d-66ab869e8568.png</url>
      <title>Forem: Saif</title>
      <link>https://forem.com/saif02</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/saif02"/>
    <language>en</language>
    <item>
      <title>SSL Installation on Apache Web Server
</title>
      <dc:creator>Saif</dc:creator>
      <pubDate>Mon, 19 Jul 2021 08:33:41 +0000</pubDate>
      <link>https://forem.com/saif02/ssl-installation-on-apache-web-server-4940</link>
      <guid>https://forem.com/saif02/ssl-installation-on-apache-web-server-4940</guid>
      <description>&lt;p&gt;Websites need SSL certificates to keep user data secure, verify ownership of the website, prevent attackers from creating a fake version of the site, and convey trust to users. ... HTTPS is the secure form of HTTP, which means that HTTPS websites have their traffic encrypted by SSL.&lt;/p&gt;

&lt;p&gt;Procedure to Install SSL Certificate in Linux Instances&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Purchase the SSL Certitifcate from the SSL provider i.e namecheap.com &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Generate a CSR and KEY files from &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;CSR code (Certificate Signing Request) is a specific code and an essential part for the SSL activation. It contains information about website name and the company contact details. For many reasons, the code should be created on the hosting server end. On some servers, it is the obligatory condition.&lt;/p&gt;

&lt;p&gt;Note: Many hosting providers offer CSR code generation assistance to their clients where possible. Thus, it is worth checking with the web-hosting company whether they provide such service and whether it is available on your hosting plan.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://decoder.link/csr_generator"&gt;https://decoder.link/csr_generator&lt;/a&gt;                                                    &lt;/p&gt;

&lt;p&gt;OR&lt;/p&gt;

&lt;p&gt;openssl option&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;openssl genrsa -out domain_name.key 2048
openssl req -new -key domain_name.key  -out domain_name.csr
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;CSR Information&lt;/p&gt;

&lt;p&gt;Please ensure you fill out the CSR code details correctly. This should speed up the process of obtaining the SSL. Furthermore, the validation process for OV and EV SSL certificates requires that business details be entered accurately.&lt;/p&gt;

&lt;p&gt;-Common Name (the domain name the Certificate will be issued for)&lt;/p&gt;

&lt;p&gt;-For example - example.com&lt;/p&gt;

&lt;p&gt;-Note! For Wildcard certificates, the Common Name should be represented with an asterisk in front (e.g. *.example.com).&lt;/p&gt;

&lt;p&gt;-Country (two-letter code)&lt;/p&gt;

&lt;p&gt;-Country (C) – the two-letter code of the country where the company or applicant is located (for example, GB for Great Britain or US for the United States; you can check your country code here.)&lt;/p&gt;

&lt;p&gt;-State (or province)&lt;/p&gt;

&lt;p&gt;-State (S) – the state, county or region the company or applicant is located in (e.g. California).&lt;/p&gt;

&lt;p&gt;-Locality (or city)&lt;/p&gt;

&lt;p&gt;-Locality (L) – the city where the company or applicant is located (e.g. Los Angeles). This parameter should not be abbreviated.&lt;/p&gt;

&lt;p&gt;-Organization (your company name. Feel free to put "NA" here for any Domain Validated certificate)&lt;/p&gt;

&lt;p&gt;-Organization (O) – the officially registered name of the organization that is applying for a certificate (e.g. Namecheap Inc.). For Organization and Extended Validation certificates, Certificate Authorities will be verifying the submitted organization. For Domain Validation SSLs, this field is not critical and the details will not be listed on the issued certificate; however, it should at least be filled in with "NA".&lt;/p&gt;

&lt;p&gt;-Organizational Unit (department. Feel free to put "NA" here for any any Domain Validated certificate)&lt;/p&gt;

&lt;p&gt;-Organization Unit (OU) – the name of the department or division within the submitted organization (e.g. SSL Support).&lt;/p&gt;

&lt;p&gt;-Email address (put a valid email address here)&lt;/p&gt;

&lt;p&gt;-Email Address – an email address of the company or the applicant. This field is optional.&lt;/p&gt;

&lt;p&gt;-Note! This email address won’t be used during the verification process, unless a mistake is found with any of the submitted details. However, this email will be considered an admin contact, unless you change it during the activation process. The SSL will be issued to the admin contact email address once it is activated.&lt;/p&gt;

&lt;p&gt;-Challenge Password and Optional Company Name - please do not use challenge password and leave Optional Company Name field empty too. These values are now obsolete and may cause issues with getting the SSL certificate.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Paste the CSR certificate file in namecheap DV authentication
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iS6CgtnW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://namecheap.simplekb.com/SiteContents/2-7C22D5236A4543EB827F3BD8936E153E/media/newact1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iS6CgtnW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://namecheap.simplekb.com/SiteContents/2-7C22D5236A4543EB827F3BD8936E153E/media/newact1.png" alt="newact1"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select the domain control validation method among CNAME, File uploading and Email-based options:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LKXfUzPl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://namecheap.simplekb.com/SiteContents/2-7C22D5236A4543EB827F3BD8936E153E/media/act_dcv_choice.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LKXfUzPl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://namecheap.simplekb.com/SiteContents/2-7C22D5236A4543EB827F3BD8936E153E/media/act_dcv_choice.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click Submit to confirm the domain control validation method and submit the order&lt;/p&gt;

&lt;p&gt;Approve the certificate issuance. If you chose Email validation, an approver email is to be delivered to a chosen approver address shortly after you finish the activation process. If you do not receive an email within 2 hours, please refer to the instructions provided in the What should I do if approval email was not delivered? article. When you confirm the issuance by following the link in the approver email, you should receive a signed certificate to the administrative email address you indicated during activation.&lt;br&gt;
For HTTP-based validation, you need to upload a text file into into a particular directory of your website (/.well-known/pki-validation/). If the domain is the primary one in your cPanel account, the document root is usually the public_html folder. The validation file can be downloaded from the page with the certificate details after it was activated.&lt;/p&gt;

&lt;p&gt;Note: If you have activated the certificate with domain.com or &lt;a href="http://www.domain.com"&gt;www.domain.com&lt;/a&gt; indicated as FQDN in your CSR code, please make sure that the file is available via &lt;a href="http://domain.com/.well-known/pki-validation/file.txt"&gt;http://domain.com/.well-known/pki-validation/file.txt&lt;/a&gt; . In this case, &lt;a href="http://www.domain.com"&gt;www.domain.com&lt;/a&gt; is considered to be under your control as well&lt;br&gt;
Content of the file shouldn't be changed in any way, as Comodo (now Sectigo) validation system is case sensitive.&lt;/p&gt;

&lt;p&gt;After the Domain Validation happens the Certificates bundles files have been issued &lt;/p&gt;

&lt;p&gt;Initially, all the certificates purchased through Namecheap are sent by a Certificate Authority to the administrative email address provided during activation. In case you have not received a validated Certificate for any reason, you can download the certificate into your account following the steps below.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Sign in to your Namecheap account &amp;gt;&amp;gt; navigate to the Dashboard and open the SSL Certificates tab.&lt;/li&gt;
&lt;li&gt;Find the SSL certificate in question and click Download over on the right, see the picture below:
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oPphCHau--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://namecheap.simplekb.com/SiteContents/2-7C22D5236A4543EB827F3BD8936E153E/media/ssl_L_dwnld.png" alt=""&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The ZIP file with your certificate will be downloaded to your computer. Once it is unzipped, you will see three files: *.crt, *.ca-bundle and *.p7b .&lt;br&gt;
*.crt and *.ca-bundle are the files for Apache, Nginx, cPanel, etc.&lt;br&gt;
*.crt is a file with your server certificate, and the *ca-bundle is a file with the Certificate Authority Chain which should be installed on your server with your domain certificate.&lt;br&gt;
*.ca-bundle is necessary for the browser to be able to check the CA signature of the certificate. If the bundle is missing, incomplete or broken, the browser might mark the website as untrusted or even restrict the connection, depending on a browser version and security settings.&lt;br&gt;
*.p7b file is a certificate and CA Bundle combined into one file. The file is suitable for the certificate installation on Microsoft IIS and Tomcat servers.&lt;/p&gt;

&lt;p&gt;Configuring in the Apache Web Server&lt;/p&gt;

&lt;p&gt;Installation check&lt;/p&gt;

&lt;p&gt;First, we will check the exact location of the current configuration file for HTTP websites. For that, run the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo apachectl -S&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YP4YwMXh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://namecheap.simplekb.com/SiteContents/2-7C22D5236A4543EB827F3BD8936E153E/media/apache_16.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YP4YwMXh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://namecheap.simplekb.com/SiteContents/2-7C22D5236A4543EB827F3BD8936E153E/media/apache_16.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can see the website configuration file (the one for non-secured HTTP connections via port 80) in the output. It is usually called "&lt;code&gt;000-default.conf&lt;/code&gt;" or” &lt;code&gt;domain_name.conf&lt;/code&gt;".&lt;/p&gt;

&lt;p&gt;The default folder for such a file location is `/etc/apache2/sites-available.&lt;/p&gt;

&lt;p&gt;In this guide, we will show in detail how to add the settings for HTTPS port 443 into the same configuration file. However, we also recommend reviewing all possible ways to proceed - like separate configuration file creation in the &lt;code&gt;/etc/apache2/sites-available&lt;/code&gt; or &lt;code&gt;/etc/apache2/sites-enabled&lt;/code&gt; folder - here in the 'Tips and troubleshootings' part of this guide.&lt;/p&gt;

&lt;p&gt;Before we proceed any further, we will need to make sure that SSL/TLS support is enabled on the webserver. For that, we will need to run the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo a2enmod ssl&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cabHenni--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://namecheap.simplekb.com/SiteContents/2-7C22D5236A4543EB827F3BD8936E153E/media/apache_17.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cabHenni--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://namecheap.simplekb.com/SiteContents/2-7C22D5236A4543EB827F3BD8936E153E/media/apache_17.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo service apache2 restart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Configuring the webserver&lt;/p&gt;

&lt;p&gt;Now, configure the website to work with the SSL certificate.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If there were no SSLs installed on the webserver previously, check the configuration file name for the HTTP port 80 and open it in your text editor of choice (nano, vi, etc.).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Note: If you are following another way from these ones, then keep in mind that your file name will be different, and you need to open your configuration file instead of the default one.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CL4SvnMK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://namecheap.simplekb.com/SiteContents/2-7C22D5236A4543EB827F3BD8936E153E/media/apache_18.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CL4SvnMK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://namecheap.simplekb.com/SiteContents/2-7C22D5236A4543EB827F3BD8936E153E/media/apache_18.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;VirtualHost *:80&amp;gt;
        ServerAdmin webmaster@example.com
        ServerName example.com
        DocumentRoot /var/www/html/
        Redirect / "https://example.com/"
&amp;lt;/VirtualHost&amp;gt;

&amp;lt;VirtualHost *:443&amp;gt;

        ServerAdmin webmaster@example.com
        ServerName example.com
        DocumentRoot /var/www/html
        SSLEngine on
        SSLCertificateFile "/etc/apache2/ssl/example.com/__example.com.crt"
        SSLCertificateKeyFile "/etc/apache2/ssl/example.com/example.com.key"
        SSLCACertificateFile "/etc/apache2/ssl/example.com/__example.com.ca-bundle"
        ErrorLog /etc/apache2/ssl/example.com/error_ssl.log
        CustomLog /etc/apache2/ssl/example.com/access_ssl.log combined

&amp;lt;/VirtualHost&amp;gt;


&amp;lt;Directory /var/www/html/&amp;gt;
     Order allow,deny
     AllowOverride All
     Allow from All
     Require all granted         
&amp;lt;/Directory&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Then, make sure to replace the paths of the certificate files in the following sections:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;SSLCertificateFile&lt;/code&gt;&lt;br&gt;
&lt;code&gt;SSLCertificateKeyFile&lt;/code&gt;&lt;br&gt;
&lt;code&gt;SSLCertificateChainFile&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Checking the configuration file and restarting the webserver&lt;/p&gt;

&lt;p&gt;Now, make sure to check the file syntax by running this command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;apachectl -t&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--j15LsCFx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://namecheap.simplekb.com/SiteContents/2-7C22D5236A4543EB827F3BD8936E153E/media/apache_21.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--j15LsCFx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://namecheap.simplekb.com/SiteContents/2-7C22D5236A4543EB827F3BD8936E153E/media/apache_21.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If the command responds with “&lt;code&gt;Syntax OK&lt;/code&gt;”, you can reboot the webserver. To do that, run the command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo service apache2 restart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The configuration file should be listed in the Apache configuration files list (it can be checked by running &lt;code&gt;apachectl -S&lt;/code&gt; once again):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Du-zbhJR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://namecheap.simplekb.com/SiteContents/2-7C22D5236A4543EB827F3BD8936E153E/media/apache_22.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Du-zbhJR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://namecheap.simplekb.com/SiteContents/2-7C22D5236A4543EB827F3BD8936E153E/media/apache_22.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Done! The website is now secured. The installation can be checked here.&lt;/p&gt;

</description>
      <category>ssl</category>
      <category>sslinstallation</category>
      <category>apachewebserver</category>
    </item>
    <item>
      <title>WordPress Migration Plan Dev-Production Server (cPanel)
</title>
      <dc:creator>Saif</dc:creator>
      <pubDate>Tue, 08 Jun 2021 05:02:25 +0000</pubDate>
      <link>https://forem.com/saif02/wordpress-migration-plan-dev-production-server-cpanel-oa</link>
      <guid>https://forem.com/saif02/wordpress-migration-plan-dev-production-server-cpanel-oa</guid>
      <description>&lt;h1&gt;
  
  
  WordPress Migration can be done in  several options some of the following are below.
&lt;/h1&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Migration of WordPress Site Manually&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Following steps describes the migration process in case manual method&lt;/p&gt;

&lt;p&gt;Step 1: Backup the  development WordPress Host (Development Server)&lt;br&gt;
The first thing you need to do is make a copy of all your website’s files. To do this, you’ll want to use an FTP tool. If you don’t already have one, FileZilla is an excellent (and free) option.&lt;br&gt;
After you connect to your site’s server via FTP, you’ll need to navigate to your WordPress root folder, which contains all the files on your site. It’s usually called either public_html or www, or is named after your site&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RION70gP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh3.googleusercontent.com/eb_0GdXlNHvRHvKQTs4LxF4ISJ4fFbMTJRqnrom1O5pqbflNG6mD1JTpojqluMuNja8o72BMRtlh2ytbN-CF9-uOzI6XCmlJOVfTP_3SMd89-5ylDeLa-abRjSbuKbpaZlB1Mk3D" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RION70gP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh3.googleusercontent.com/eb_0GdXlNHvRHvKQTs4LxF4ISJ4fFbMTJRqnrom1O5pqbflNG6mD1JTpojqluMuNja8o72BMRtlh2ytbN-CF9-uOzI6XCmlJOVfTP_3SMd89-5ylDeLa-abRjSbuKbpaZlB1Mk3D" alt="migrate wordpress site"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 3: Back Up Your WordPress Database&lt;br&gt;
At this point, you already have a copy of your website’s files. Now you need to back up its database. This is where all the information about your site’s content, users, and lots more is contained.&lt;br&gt;
To do this, you’ll need to access your database. Most web hosts enable you to do this through your control panel. For example, if you’re using cPanel, you’ll find a section called Databases. In that section, you’ll want to click on the phpMyAdmin option:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rowY5k69--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh6.googleusercontent.com/WSyD2cwHPJumM2t1ikgI8AlWBC3btk5UebYoPId_1OR38n1lVDcYoRmMlWPlQt3UVNUz2lUEWdN9cKrWvHIH2LldS0AXdr1AQX4-Pmsp2RSl0nuTy6y09n8VDihMddVUGiuJ3Jmf" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rowY5k69--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh6.googleusercontent.com/WSyD2cwHPJumM2t1ikgI8AlWBC3btk5UebYoPId_1OR38n1lVDcYoRmMlWPlQt3UVNUz2lUEWdN9cKrWvHIH2LldS0AXdr1AQX4-Pmsp2RSl0nuTy6y09n8VDihMddVUGiuJ3Jmf" alt="Automatic vs Manual Site Migration - screenshot of cPanel"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you’re in, choose your site’s database from the list on the left, and navigate to the Export tab using the top menu. Select the Quick option under Export Method, and hit Go:&lt;br&gt;
This will download a copy of your site’s database in .sql format.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DlfACmcI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh3.googleusercontent.com/Tb1S9LQgeFAHiSpvIx9A081tw5tt08VPx3ROzVPNhpQ5pqfNVxIMKK54TYAzfmokAFHJbUCI-Pi9r1T1Tn7-6nYP5M2Egf7E9Fa4xKPVFAz4DDSkUZkPyojZN9YED-00FI0V1uwL" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DlfACmcI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh3.googleusercontent.com/Tb1S9LQgeFAHiSpvIx9A081tw5tt08VPx3ROzVPNhpQ5pqfNVxIMKK54TYAzfmokAFHJbUCI-Pi9r1T1Tn7-6nYP5M2Egf7E9Fa4xKPVFAz4DDSkUZkPyojZN9YED-00FI0V1uwL" alt="database export in cPanel"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 5: Create a New SQL Database and Import the Contents of Your Old One&lt;/p&gt;

&lt;p&gt;Next, you have to create a new database on the web host you’re moving to. Then you’ll import the file from your old database, which will override the contents of the new one.&lt;br&gt;
If your new WordPress host also uses cPanel, here’s what you’ll need to do:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to the Databases section in cPanel, and choose the MySQL Databases option.&lt;/li&gt;
&lt;li&gt;Create a new database and add a user to it from this same tab (and take note of the names you use for later).&lt;/li&gt;
&lt;li&gt;Access the new database using phpMyAdmin, as you did during the previous step.&lt;/li&gt;
&lt;li&gt;Go to the Import tab within the new database, and upload the .sql file you generated earlier.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That’s it! Now your old database is located on your new web host. However, you still need to re-upload the rest of your site’s files.&lt;/p&gt;

&lt;p&gt;Step 6: Upload Your Site’s Files to the New Web Host&lt;/p&gt;

&lt;p&gt;For this step, you’ll need to first log into your new server via FTP. Then, navigate to its root folder.&lt;br&gt;
Right-click anywhere within that folder, and select the Upload option. Locate the folder you downloaded during the first step, open it, and select all the files and directories within.&lt;br&gt;
The upload process can take a while, since we’re talking about hundreds of files. If you’re patient, however, you’ll soon find yourself almost at the end of the journey.&lt;/p&gt;

&lt;p&gt;Step 7: Edit Your Site’s wp-config.php File&lt;/p&gt;

&lt;p&gt;Once all your files are up on the new server, you’ll need to access your WordPress root folder one more time. If you try to actually visit your website now, it won’t work, because you need to update WordPress’ wp-config.php file so that it points towards your new database.&lt;/p&gt;

&lt;p&gt;This will open the file using your local text editor, enabling you to make changes. Here are the three lines you’ll need to update:&lt;br&gt;
&lt;code&gt;define('DB_NAME, 'db_name');&lt;/code&gt;&lt;br&gt;
&lt;code&gt;define('DB_USER, 'db_user');&lt;/code&gt;&lt;br&gt;
&lt;code&gt;define('DB_PASSWORD, 'db_pass');&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Step 8: Configure and Change Your DNS&lt;/p&gt;

&lt;p&gt;Finally, you’ll need to make sure your Domain Name Server (DNS) is pointed towards the correct host. For example, if you are migrating to one of our hosting plans, you’ll need to point your DNS to your new WP Engine server. &lt;br&gt;
To do this, you’ll need two things: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Information from your new host &lt;/li&gt;
&lt;li&gt;Access to the registrar where you purchased your domain name&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;How to Migrate Your WordPress Site With a Plugin&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;When you need to migrate your website,  there are several excellent migration plugins available that can help many of these tools can create complete site backups for you, as well as providing recovery services. Additionally, if you only need to migrate part of your site, there are paid plugins that can customize the process to meet your needs.&lt;/p&gt;

&lt;p&gt;All-in-One WP Migration&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--t6NdZ4_a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh4.googleusercontent.com/_Z-o94h7cu4-WphUA4RLcM97dJDGyCiMSzqYWq141CJqYO93FjrNFfYJ46wrTcXgI7XNWqv-M4PA9UN0NHqECd644PHvdn0TuKnQDfTqWrIv41pfMA3T2YWxU6kzlXDzI24HPPWf" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--t6NdZ4_a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lh4.googleusercontent.com/_Z-o94h7cu4-WphUA4RLcM97dJDGyCiMSzqYWq141CJqYO93FjrNFfYJ46wrTcXgI7XNWqv-M4PA9UN0NHqECd644PHvdn0TuKnQDfTqWrIv41pfMA3T2YWxU6kzlXDzI24HPPWf" alt="move wp site to new host"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All-in-One WP Migration is one of the most streamlined backup and migration plugins you can find. It enables you to create copies of your site in minutes, and then import them to another WordPress installation using the same plugin. In our experience, it’s perfect for small websites, although it can struggle with larger installs.&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>wordpressmigration</category>
    </item>
    <item>
      <title>Complete Guide to setup LAMP Architecture Docker Image into Azure Kubernetes Services,with azure persistence disk attached </title>
      <dc:creator>Saif</dc:creator>
      <pubDate>Tue, 02 Jun 2020 07:46:04 +0000</pubDate>
      <link>https://forem.com/saif02/complete-guide-to-setup-lamp-architecture-docker-image-into-azure-kubernetes-services-with-azure-persistence-disk-attached-2faj</link>
      <guid>https://forem.com/saif02/complete-guide-to-setup-lamp-architecture-docker-image-into-azure-kubernetes-services-with-azure-persistence-disk-attached-2faj</guid>
      <description>&lt;p&gt;&lt;strong&gt;Hey Everyone,&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This tutorial provides a walkthrough of, how to create a docker image of LAMP(Linux,Apache,MySql,PHP) and Deploy it into Kubernetes cluster with Azure Static Provision Persistence disk attached.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Creating Docker Image&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;Installing Docker on Ubuntu&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Step 1: Update Software Repositories
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;sudo apt-get update&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Step 2:(Optional)Uninstall Old Versions of Docker
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;sudo apt-get remove docker docker-engine docker.io&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Step 3: Install Docker
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;sudo apt install docker.io&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Step 4: Start and Automate Docker
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;sudo systemctl start docker&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;



&lt;p&gt;&lt;code&gt;sudo systemctl enable docker&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Step 5 (Optional): Check Docker Version
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;docker --version&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Step 6: Docker Infomation
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;docker info&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Step 7: Docker Images
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;docker images&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Deploy Docker LAMP Architecture&lt;/strong&gt;
&lt;/h2&gt;



&lt;p&gt;&lt;code&gt;sudo docker pull ubuntu:latest&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;



&lt;p&gt;&lt;code&gt;sudo docker ps -a   #view all containers&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;



&lt;p&gt;&lt;code&gt;sudo docker images -a  #View all available images&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;



&lt;p&gt;&lt;code&gt;sudo docker stop container_id  #Stop a specific container&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;



&lt;p&gt;&lt;code&gt;sudo docker rm container_id     #Delete a specific container&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;



&lt;p&gt;&lt;code&gt;sudo docker rmi image_id        #Delete a specific image&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;



&lt;p&gt;&lt;code&gt;sudo docker exec –it &amp;lt;container-name/id&amp;gt; /bin/bash# docker image exec&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Installing PHP on Ubuntu VM in Azure
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;sudo apt-get install php&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;



&lt;p&gt;&lt;code&gt;sudo apt-get install python-software-properties&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;



&lt;p&gt;&lt;code&gt;sudo apt-get update&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;



&lt;p&gt;&lt;code&gt;php -v                # to check the PHP version&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;



&lt;p&gt;&lt;code&gt;apt-get remove –purge php*   # to uninstall PHP&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Installing MySQL in Ubuntu 16.04
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;sudo apt-get install mysql-server # to get latest remove numeric&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;



&lt;p&gt;&lt;code&gt;sudo apt-get update&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Copying Source Code from localhost to VM
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;Path to copy: /var/www/websitename.com/html&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;scp -r pathlocation root@ip(ip of where to be copied):/pathlocation 
Example :
scp -r source_code.zip root@10.10.10.10:/var/www/websitename.com/html

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Start the apache2 in the container
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;service apache2 start&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run the image as container
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run –itd –p 70:80 –name &amp;lt;container-name&amp;gt; &amp;lt;image-name&amp;gt;
Example :
docker run –itd –p 70:80 –name zaif/lamp 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;p&gt;&lt;code&gt;exit                      # exit from the container&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Note:&lt;br&gt;
Access the localhost with the exposed port number in the browser to check whether the application is deployed properly or not localhost:70&lt;/p&gt;

&lt;p&gt;Commit the changes and create a new docker image&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;docker commit &lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  docker commit &amp;lt;container-name/id&amp;gt; &amp;lt;image-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Push the committed/created image to the docker hub&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; docker push &amp;lt;account-name/repository-name&amp;gt;:tag
 docker push username/imagename:latest
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;Create an AKS cluster&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;To create an AKS cluster, complete the following steps,&lt;br&gt;
On the Azure portal menu or from the Home page, select &lt;strong&gt;Create a resource_&lt;br&gt;
__Select Containers&lt;/strong&gt;  -&amp;gt;  &lt;strong&gt;Kubernetes Service&lt;/strong&gt;&lt;br&gt;
On the Basics page, configure the following options&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4be1v4raqgfdqaj1m2lo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4be1v4raqgfdqaj1m2lo.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Project details: Select an Azure Subscription, then select or create an Azure Resource group, such as &lt;strong&gt;myResourceGroup&lt;/strong&gt;&lt;br&gt;
Cluster details: Enter a Kubernetes cluster name, such as &lt;strong&gt;myAKSCluster&lt;/strong&gt;. &lt;strong&gt;Select a Region&lt;/strong&gt;, &lt;strong&gt;Kubernetes version&lt;/strong&gt;, and &lt;strong&gt;DNS name prefix&lt;/strong&gt; for the AKS cluster&lt;br&gt;
Primary node pool: Select a &lt;strong&gt;VM Node size&lt;/strong&gt; for the AKS nodes. The &lt;em&gt;VM size can't be changed once an AKS cluster has been deployed&lt;/em&gt;. - Select the number of nodes to deploy into the cluster. For this quick start, set Node count to 1. Node count can be adjusted after the cluster has been deployed.&lt;/p&gt;

&lt;p&gt;Select Next: Scale when complete,&lt;br&gt;
On the Scale page, keep the default options. At the bottom of the screen, &lt;br&gt;
click Next: Authentication.&lt;br&gt;
On the Authentication page, configure the following options: &lt;br&gt;
Create a new service principal by leaving the Service Principal field with (new) default service principal. Or you can choose Configure service principal to use an existing one. If you use an existing one, you will need to provide the SPN client ID and secret.&lt;br&gt;
Enable the option for Kubernetes role-based access controls &lt;em&gt;(RBAC)&lt;/em&gt;. This will provide more fine-grained control over access to the Kubernetes resources deployed in your AKS cluster.&lt;br&gt;
     By default, Basic networking is used, and Azure Monitor for containers is          enabled. &lt;em&gt;Click Review + Create&lt;/em&gt; and &lt;em&gt;then Create when validation&lt;br&gt;
    completes&lt;/em&gt;.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F51w05qkamjuivtulxdh6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F51w05qkamjuivtulxdh6.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It takes a few minutes to create the AKS cluster. When your deployment is complete, click Go to resource, or browse to the AKS cluster resource group, such as myResourceGroup, and select the AKS resource, such as myAKSCluster. The AKS cluster dashboard is shown, as in this example:&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;Creating Azure Persistence Volume Disk&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Steps&lt;/strong&gt;: &lt;br&gt;
select the same Resource Group Name where the AKS Cluster is placed&lt;br&gt;
give &lt;strong&gt;azure disk name&lt;/strong&gt; such &lt;em&gt;myaks-pv&lt;/em&gt; and select the same region as of AKS is, size can be customized click on &lt;em&gt;review and create&lt;/em&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ffgf832rttgai229w5aan.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ffgf832rttgai229w5aan.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To configure kubectl to connect to your Kubernetes Cluster,use the &lt;br&gt;
az aks get-credentials command ,this will download the credentials and configures the Kubernetes CLI to use them.&lt;br&gt;
The following example gets credentials for the cluster name myAKSCluster in the resource group named myResourceGroup:&lt;/p&gt;
&lt;h4&gt;
  
  
  &lt;strong&gt;Create a Pod&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;The next step is to create a &lt;em&gt;Pod&lt;/em&gt; and link it to Persistence volume (Azure Disk).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Azure cloud shell&lt;/strong&gt;&lt;br&gt;
Azure hosts Azure Cloud Shell, an interactive shell environment that you can use through your browser&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fsaif-02%2Fblog%2Fraw%2Fmaster%2Fpowershell-updated.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fsaif-02%2Fblog%2Fraw%2Fmaster%2Fpowershell-updated.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;enter this command in azure bash shell&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  az aks get-credentials --resource-group myResourceGroup --name myAKSCluster
  az aks browse --resource-group myResourceGroup --name myAKSCluster 
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Note: az extension add --name aks-preview # optional if any error&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fz1f331dkxgjiphue275j.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fz1f331dkxgjiphue275j.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Upload YAML  file (Create From Text Input)
Here is the configuration file for the Pod:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Pod&lt;/span&gt;
&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;v1&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;myaks_pod&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;containers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;myaks_container&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;zaif/lamp_docker&lt;/span&gt;
    &lt;span class="na"&gt;volumeMounts&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;mountPath&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/mnt/azure/"&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;volume&lt;/span&gt;
  &lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;volume&lt;/span&gt;
      &lt;span class="na"&gt;azureDisk&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Managed&lt;/span&gt;
        &lt;span class="na"&gt;diskName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;myaks-pv&lt;/span&gt; 
        &lt;span class="na"&gt;diskURI&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/subscriptions/73xxxx-xxx-xxxx-xxxxxas5/resourceGroups/myaksGroup/providers/Microsoft.Compute/disks/myaks-pv&lt;/span&gt;   
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Note:disk URI copy the Resource ID from myaks-pv(Azure Disk)-&amp;gt;properties&lt;br&gt;
image below for reference &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fsaif-02%2Fblog%2Fraw%2Fmaster%2Fazure-disk-pvupdated.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fsaif-02%2Fblog%2Fraw%2Fmaster%2Fazure-disk-pvupdated.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Run the following command in Azure CLI&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
kubectl get pods       #List all pods in ps output format
kubectl get pv or pvc  #Verify that the container in the Pod is running

kubectl label pod pod_name label=app
Example:
kubectl label pod myaks_pod label=app 

kubectl expose pod pod_name --type=LoadBalancer --port=80,443 #to expose the pod in order to get public sharing ip 
Example:
kubectl expose pod myaks_pod --type-LoadBalancer --port=80,443

kubectl get svc 
NAME           TYPE           CLUSTER-IP   EXTERNAL-IP    PORT(S)                      AGE

kubernetes      ClusterIP      10.0.0.1     &amp;lt;none&amp;gt;         443/TCP                      24h 

myaks_pod       LoadBalancer   10.0.39.57   52.143.95.12 80:30761/TCP,443:31098/TCP   6h9m 

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now Login into the Pod using command&lt;br&gt;
Go to the shell,(Azure CLI)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl exec -it my_pod_name --container container_name -- /bin/bash
Example: 
kubectl exec -it myaks_pod  --container myaks_container -- /bin/bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note:&lt;br&gt;
To test the attached Azure Disk is connected and can be used for data lost retrieval, delete the POD and create a same config POD and check whether the database files can been retrieved form mnt/azure/lost+found  path location  &lt;/p&gt;

&lt;p&gt;kubectl delete pod pod_name&lt;br&gt;
Example:&lt;br&gt;
kubectl delete pod myaks_pod&lt;/p&gt;

&lt;p&gt;kubectl get svc&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note:&lt;br&gt;
Follow the above same steps from creating a POD through YAML and the next further procedures in order to check whether the data files can be retrieved through azure persistence disk attached with reference to the POD "mnt/azure/lost+found"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The persistence disk is attached to the pod (myaks_pod) to retrieve the data when pod get’s evicted works as above&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Persistence Mount Path: "/mnt/azure"&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>docker</category>
      <category>kubernetes</category>
      <category>azuredevstories</category>
      <category>lamp</category>
    </item>
  </channel>
</rss>
