<?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>DEV Community: Mansoor Ali</title>
    <description>The latest articles on DEV Community by Mansoor Ali (@mansoor_ali_6f5708c0cfedf).</description>
    <link>https://dev.to/mansoor_ali_6f5708c0cfedf</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%2F3916357%2Fb5d34a1b-b07b-4ec5-8fa0-1decc5e22c0e.webp</url>
      <title>DEV Community: Mansoor Ali</title>
      <link>https://dev.to/mansoor_ali_6f5708c0cfedf</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mansoor_ali_6f5708c0cfedf"/>
    <language>en</language>
    <item>
      <title>Copy Fail: The Linux Vulnerability That Shook the Open-Source World</title>
      <dc:creator>Mansoor Ali</dc:creator>
      <pubDate>Fri, 08 May 2026 17:44:39 +0000</pubDate>
      <link>https://dev.to/mansoor_ali_6f5708c0cfedf/copy-fail-the-linux-vulnerability-that-shook-the-open-source-world-37kg</link>
      <guid>https://dev.to/mansoor_ali_6f5708c0cfedf/copy-fail-the-linux-vulnerability-that-shook-the-open-source-world-37kg</guid>
      <description>&lt;p&gt;Linux is widely trusted for powering servers, cloud infrastructure, and critical systems across the world. But even the most stable ecosystems occasionally face vulnerabilities that expose deeper architectural risks.&lt;/p&gt;

&lt;p&gt;One such issue is known as "Copy Fail", a Linux kernel vulnerability affecting multiple distributions that can potentially lead to privilege escalation and system compromise.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;What is Copy Fail?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Copy Fail is a kernel-level memory handling flaw that appears in how Linux processes certain internal operations involving memory and data copying.&lt;br&gt;
In simple terms, the vulnerability can allow a local unprivileged user to influence kernel memory behavior in a way that was never intended.&lt;/p&gt;

&lt;p&gt;This can eventually lead to:&lt;br&gt;
a) Unauthorized memory modification&lt;br&gt;
b) Breaking normal privilege boundaries&lt;br&gt;
c) Potential escalation to root-level access&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Why This Vulnerability Matters&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Unlike application-level bugs, kernel vulnerabilities are especially critical because the kernel is the core of the operating system.&lt;/p&gt;

&lt;p&gt;Copy Fail stands out due to:&lt;/p&gt;

&lt;p&gt;a) Wide impact across Linux distributions&lt;br&gt;
Multiple major Linux distributions may be affected depending on kernel version.&lt;/p&gt;

&lt;p&gt;b) Memory-based exploitation&lt;br&gt;
The issue operates in memory handling layers rather than file-based manipulation, making detection harder.&lt;/p&gt;

&lt;p&gt;c) Low complexity in triggering conditions&lt;br&gt;
The exploit path does not necessarily require highly complex timing attacks or advanced race conditions.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;How the Issue Occurs&lt;/strong&gt; (Simplified)&lt;/p&gt;

&lt;p&gt;At a high level, the bug arises from inconsistent handling of memory references during internal kernel operations.&lt;br&gt;
This creates a situation where:&lt;/p&gt;

&lt;p&gt;a) Memory pages are not safely isolated&lt;/p&gt;

&lt;p&gt;b) Kernel-managed data may be unintentionally exposed to writable operations&lt;/p&gt;

&lt;p&gt;c) A controlled user-level input influences kernel behavior&lt;/p&gt;




&lt;p&gt;Visual Breakdown&lt;/p&gt;

&lt;p&gt;Here's a simplified view of how the flow behaves:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;User Space Process&lt;br&gt;
        |&lt;br&gt;
        v&lt;br&gt;
  Input Trigger&lt;br&gt;
        |&lt;br&gt;
        v&lt;br&gt;
Kernel Memory Handler&lt;br&gt;
        |&lt;br&gt;
   [Copy Operation]&lt;br&gt;
        |&lt;br&gt;
        v&lt;br&gt;
Page Cache / Memory Layer&lt;br&gt;
        |&lt;br&gt;
   (Unsafe Reference Leak)&lt;br&gt;
        |&lt;br&gt;
        v&lt;br&gt;
Privilege Escalation Risk&lt;/code&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Real-World Risks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If exploited successfully, Copy Fail could allow attackers to:&lt;/p&gt;

&lt;p&gt;a) Gain root access on local systems&lt;br&gt;
b) scape containerized environments&lt;br&gt;
c) Compromise shared cloud infrastructure and&lt;br&gt;
d) Bypass traditional access control layers&lt;/p&gt;

&lt;p&gt;This makes it especially relevant in:&lt;/p&gt;

&lt;p&gt;Cloud servers&lt;br&gt;
DevOps pipelines&lt;br&gt;
Multi-tenant environments&lt;br&gt;
Kubernetes clusters&lt;/p&gt;

&lt;p&gt;┌──────────────────────┐&lt;br&gt;
│ User Application │&lt;br&gt;
└─────────┬────────────┘&lt;br&gt;
 │&lt;br&gt;
 v&lt;br&gt;
┌──────────────────────┐&lt;br&gt;
│ System Call / Input │&lt;br&gt;
└─────────┬────────────┘&lt;br&gt;
 │&lt;br&gt;
 v&lt;br&gt;
┌──────────────────────┐&lt;br&gt;
│ Kernel Memory Layer │&lt;br&gt;
│ (Copy Operation) │&lt;br&gt;
└─────────┬────────────┘&lt;br&gt;
 │&lt;br&gt;
 v&lt;br&gt;
┌──────────────────────┐&lt;br&gt;
│ Page Cache / Memory │&lt;br&gt;
│ Mismanagement │&lt;br&gt;
└─────────┬────────────┘&lt;br&gt;
 │&lt;br&gt;
 v&lt;br&gt;
┌──────────────────────┐&lt;br&gt;
│ Privilege Escalation │&lt;br&gt;
│ (Root Access Risk) │&lt;br&gt;
└──────────────────────┘&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Mitigation and Fix&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The recommended fix involves kernel-level patches that:&lt;br&gt;
a) Correct unsafe memory handling behavior&lt;br&gt;
b) Prevent unintended shared references in memory operations&lt;br&gt;
c) strengthen isolation between kernel and user-space data&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What administrators should do:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Update Linux kernel to the latest patched version&lt;/p&gt;

&lt;p&gt;a) Reboot affected systems after patching&lt;br&gt;
b) Review system exposure in cloud/container environments&lt;br&gt;
c) Limit unnecessary low-level kernel feature access where possible&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Final Thoughts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Copy Fail highlights an important truth in system security:&lt;br&gt;
Even highly mature systems like Linux can develop critical vulnerabilities when performance optimizations intersect with complex memory handling logic.&lt;/p&gt;

&lt;p&gt;For engineers and system administrators, the takeaway is simple:&lt;br&gt;
Kernel updates are not optional - they are a core security practice.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sources / References&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://xint.io/blog/copy-fail-linux-distributions#the-fix-6" rel="noopener noreferrer"&gt;https://xint.io/blog/copy-fail-linux-distributions#the-fix-6&lt;/a&gt;&lt;br&gt;
Linux Kernel Mailing List (LKML) discussions on memory safety patches: &lt;a href="https://lore.kernel.org/lkml/" rel="noopener noreferrer"&gt;https://lore.kernel.org/lkml/&lt;/a&gt;&lt;br&gt;
Linux kernel security documentation: &lt;a href="https://www.kernel.org/doc/html/latest/admin-guide/security-bugs.html" rel="noopener noreferrer"&gt;https://www.kernel.org/doc/html/latest/admin-guide/security-bugs.html&lt;/a&gt;&lt;br&gt;
CVE tracking databases (for kernel vulnerability references): &lt;a href="https://cve.mitre.org/" rel="noopener noreferrer"&gt;https://cve.mitre.org/&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to Set Up WordPress on AWS EC2 with Nginx, PHP 8.1, and MySQL on Ubuntu 22.04 (2026 Guide)</title>
      <dc:creator>Mansoor Ali</dc:creator>
      <pubDate>Wed, 06 May 2026 17:54:58 +0000</pubDate>
      <link>https://dev.to/mansoor_ali_6f5708c0cfedf/how-to-set-up-wordpress-on-aws-ec2-with-nginx-php-81-and-mysql-on-ubuntu-2204-2026-guide-3dc1</link>
      <guid>https://dev.to/mansoor_ali_6f5708c0cfedf/how-to-set-up-wordpress-on-aws-ec2-with-nginx-php-81-and-mysql-on-ubuntu-2204-2026-guide-3dc1</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa0mlukp8tpxerzmsgdgz.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa0mlukp8tpxerzmsgdgz.webp" alt="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a0mlukp8tpxerzmsgdgz.webp" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Available here for $12&lt;/strong&gt;: &lt;a href="//alimansoor1298.gumroad.com/l/1-click-wordpress-aws"&gt;1-Click WordPress on AWS&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Most WordPress tutorials default to Apache. That's fine, but Nginx handles more concurrent connections with less memory — which matters when you're paying for every megabyte on a cloud instance.&lt;br&gt;
This guide walks through deploying a WordPress stack on a fresh AWS EC2 instance running Ubuntu 22.04 LTS. By the end, you'll have:&lt;/p&gt;

&lt;p&gt;Nginx serving as the web server&lt;br&gt;
PHP 8.1 with FPM (FastCGI Process Manager)&lt;br&gt;
MySQL 8.0 with a dedicated WordPress database user&lt;br&gt;
WordPress installed at /var/www/html&lt;br&gt;
A working site you can access in your browser&lt;/p&gt;

&lt;p&gt;If you've SSH'd into a Linux server before, you can follow this.&lt;br&gt;
Prerequisites&lt;br&gt;
You'll need:&lt;/p&gt;

&lt;p&gt;Step 1: &lt;strong&gt;An AWS account&lt;/strong&gt;&lt;br&gt;
A key pair for SSH (create one in the EC2 console if you don't have one)&lt;br&gt;
A terminal with SSH (Mac and Linux have one built in; on Windows use PowerShell or WSL)&lt;br&gt;
About 30 minutes&lt;/p&gt;

&lt;p&gt;A t3.micro instance is fine for testing and small sites. It's eligible for the free tier in your first 12 months. After that, expect roughly $7–10/month for the instance plus a couple dollars for the EBS volume.&lt;br&gt;
Step 1: Launch an EC2 Instance&lt;br&gt;
In the AWS Console, go to EC2 → Instances → Launch Instances.&lt;br&gt;
Configure with these settings:&lt;/p&gt;

&lt;p&gt;Name: wordpress-server&lt;br&gt;
AMI: Ubuntu Server 22.04 LTS (HVM), SSD Volume Type&lt;br&gt;
Instance type: t3.micro&lt;br&gt;
Key pair: Select your key pair, or create a new one&lt;br&gt;
Network settings: Create a new security group with these inbound rules:&lt;/p&gt;

&lt;p&gt;SSH (port 22) — Source: My IP&lt;br&gt;
HTTP (port 80) — Source: Anywhere (0.0.0.0/0)&lt;br&gt;
HTTPS (port 443) — Source: Anywhere (0.0.0.0/0)&lt;/p&gt;

&lt;p&gt;Storage: 20 GB gp3&lt;/p&gt;

&lt;p&gt;Click Launch Instance and wait until the state shows "Running."&lt;br&gt;
Copy the Public IPv4 address from the instance details. You'll need it shortly.&lt;/p&gt;

&lt;p&gt;Step 2: &lt;strong&gt;Connect via SSH&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In your terminal, navigate to your .pem key file and set the correct permissions (you only need to do this once):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;chmod &lt;/span&gt;400 your-key.pem
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then connect, replacing the filename and IP with your own:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh &lt;span class="nt"&gt;-i&lt;/span&gt; your-key.pem ubuntu@YOUR_PUBLIC_IP
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Type yes when prompted to confirm the host fingerprint. You should land at a prompt like ubuntu@ip-172-31-xx-xx:~$.&lt;/p&gt;

&lt;p&gt;Step 3: &lt;strong&gt;Update the System&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Always start with a clean, updated system:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt upgrade &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This pulls the latest package lists and installs security updates. It'll take a few minutes on a fresh instance.&lt;/p&gt;

&lt;p&gt;Step 4: &lt;strong&gt;Install Nginx&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;nginx &lt;span class="nt"&gt;-y&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Start it and enable it to launch on boot:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start nginx
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;nginx

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

&lt;/div&gt;



&lt;p&gt;Verify it's running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl status nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see Active: active (running). Press q to exit.&lt;br&gt;
To confirm Nginx is reachable, open &lt;a href="http://YOUR_PUBLIC_IP" rel="noopener noreferrer"&gt;http://YOUR_PUBLIC_IP&lt;/a&gt; in your browser. You should see the default "Welcome to nginx!" page. If you don't, double-check that port 80 is open in your security group.&lt;/p&gt;

&lt;p&gt;Step 5: &lt;strong&gt;Install PHP 8.1-FPM and Required Extensions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;WordPress needs PHP and several specific extensions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;php8.1-fpm php8.1-mysql php8.1-curl php8.1-gd php8.1-mbstring php8.1-xml php8.1-xmlrpc php8.1-soap php8.1-intl php8.1-zip &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What each extension does:&lt;/p&gt;

&lt;p&gt;php8.1-mysql — connects PHP to MySQL&lt;br&gt;
php8.1-curl — needed by plugins that fetch external data&lt;br&gt;
php8.1-gd — image manipulation for uploads&lt;br&gt;
php8.1-mbstring — multi-byte string handling for non-English content&lt;br&gt;
php8.1-xml and php8.1-xmlrpc — required by WordPress core&lt;br&gt;
php8.1-zip — for plugin and theme uploads&lt;/p&gt;

&lt;p&gt;Verify PHP-FPM is running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl status php8.1-fpm

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

&lt;/div&gt;



&lt;p&gt;You should see it active and listening on /run/php/php8.1-fpm.sock — the Unix socket Nginx will use.&lt;/p&gt;

&lt;p&gt;Step 6: &lt;strong&gt;Install and Secure MySQL&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Install MySQL Server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;mysql-server &lt;span class="nt"&gt;-y&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Start it and enable it on boot:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start mysql
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;mysql

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

&lt;/div&gt;



&lt;p&gt;Run the security script. This is important — it removes anonymous users, disables remote root login, and removes the test database:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;mysql_secure_installation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Recommended answers to the prompts:&lt;/p&gt;

&lt;p&gt;VALIDATE PASSWORD COMPONENT? Y&lt;br&gt;
Password validation policy: 2 for STRONG&lt;br&gt;
Remove anonymous users? Y&lt;br&gt;
Disallow root login remotely? Y&lt;br&gt;
Remove test database? Y&lt;br&gt;
Reload privilege tables now? Y&lt;/p&gt;

&lt;p&gt;Step 7: &lt;strong&gt;Create the WordPress Database and User&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Don't run WordPress as root — that's a security mistake. Create a dedicated database and user.&lt;br&gt;
Log into MySQL:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;mysql

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

&lt;/div&gt;



&lt;p&gt;At the mysql&amp;gt; prompt, run these commands. Replace your_strong_password_here with an actual strong password:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="n"&gt;wordpress_db&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="nb"&gt;CHARACTER&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;utf8mb4&lt;/span&gt; &lt;span class="k"&gt;COLLATE&lt;/span&gt; &lt;span class="n"&gt;utf8mb4_unicode_ci&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;USER&lt;/span&gt; &lt;span class="s1"&gt;'wordpress_user'&lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="s1"&gt;'localhost'&lt;/span&gt; &lt;span class="n"&gt;IDENTIFIED&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="s1"&gt;'your_strong_password_here'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;ALL&lt;/span&gt; &lt;span class="k"&gt;PRIVILEGES&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;wordpress_db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="s1"&gt;'wordpress_user'&lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="s1"&gt;'localhost'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;FLUSH&lt;/span&gt; &lt;span class="k"&gt;PRIVILEGES&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;EXIT&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save the password. You'll need it in Step 9.&lt;/p&gt;

&lt;p&gt;Step 8: &lt;strong&gt;Download and Configure WordPress&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Move into a temporary directory and download WordPress:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /tmp
wget https://wordpress.org/latest.tar.gz
&lt;span class="nb"&gt;tar &lt;/span&gt;xzvf latest.tar.gz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Move the WordPress files to the web root, wiping the default Nginx page first:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; /var/www/html/&lt;span class="k"&gt;*&lt;/span&gt;
&lt;span class="nb"&gt;sudo cp&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; /tmp/wordpress/&lt;span class="k"&gt;*&lt;/span&gt; /var/www/html/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Set the correct ownership and permissions. On Ubuntu, Nginx and PHP-FPM run as the www-data user:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo chown&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; www-data:www-data /var/www/html/
&lt;span class="nb"&gt;sudo &lt;/span&gt;find /var/www/html/ &lt;span class="nt"&gt;-type&lt;/span&gt; d &lt;span class="nt"&gt;-exec&lt;/span&gt; &lt;span class="nb"&gt;chmod &lt;/span&gt;755 &lt;span class="o"&gt;{}&lt;/span&gt; &lt;span class="se"&gt;\;&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;find /var/www/html/ &lt;span class="nt"&gt;-type&lt;/span&gt; f &lt;span class="nt"&gt;-exec&lt;/span&gt; &lt;span class="nb"&gt;chmod &lt;/span&gt;644 &lt;span class="o"&gt;{}&lt;/span&gt; &lt;span class="se"&gt;\;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These set directories to 755 and files to 644 — the standard secure WordPress permissions.&lt;/p&gt;

&lt;p&gt;Step 9: &lt;strong&gt;Configure Nginx for WordPress&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is the step most tutorials skip or get wrong. The default Nginx config doesn't handle PHP, and it doesn't handle WordPress permalinks.&lt;/p&gt;

&lt;p&gt;Open the default site config:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;nano /etc/nginx/sites-available/default
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace its contents with this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nginx"&gt;&lt;code&gt;&lt;span class="k"&gt;server&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kn"&gt;listen&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt; &lt;span class="s"&gt;default_server&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kn"&gt;listen&lt;/span&gt; &lt;span class="s"&gt;[::]:80&lt;/span&gt; &lt;span class="s"&gt;default_server&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kn"&gt;root&lt;/span&gt; &lt;span class="n"&gt;/var/www/html&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kn"&gt;index&lt;/span&gt; &lt;span class="s"&gt;index.php&lt;/span&gt; &lt;span class="s"&gt;index.html&lt;/span&gt; &lt;span class="s"&gt;index.htm&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kn"&gt;server_name&lt;/span&gt; &lt;span class="s"&gt;_&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;# Handle WordPress permalinks&lt;/span&gt;
    &lt;span class="kn"&gt;location&lt;/span&gt; &lt;span class="n"&gt;/&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kn"&gt;try_files&lt;/span&gt; &lt;span class="nv"&gt;$uri&lt;/span&gt; &lt;span class="nv"&gt;$uri&lt;/span&gt;&lt;span class="n"&gt;/&lt;/span&gt; &lt;span class="n"&gt;/index.php?&lt;/span&gt;&lt;span class="nv"&gt;$args&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c1"&gt;# Pass PHP scripts to PHP-FPM&lt;/span&gt;
    &lt;span class="kn"&gt;location&lt;/span&gt; &lt;span class="p"&gt;~&lt;/span&gt; &lt;span class="sr"&gt;\.php$&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kn"&gt;include&lt;/span&gt; &lt;span class="nc"&gt;snippets/fastcgi-php&lt;/span&gt;&lt;span class="s"&gt;.conf&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kn"&gt;fastcgi_pass&lt;/span&gt; &lt;span class="s"&gt;unix:/run/php/php8.1-fpm.sock&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c1"&gt;# Deny access to .htaccess and other hidden files&lt;/span&gt;
    &lt;span class="kn"&gt;location&lt;/span&gt; &lt;span class="p"&gt;~&lt;/span&gt; &lt;span class="sr"&gt;/\.ht&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kn"&gt;deny&lt;/span&gt; &lt;span class="s"&gt;all&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save and exit (Ctrl+X, Y, Enter).&lt;/p&gt;

&lt;p&gt;Two lines that matter most:&lt;/p&gt;

&lt;p&gt;try_files $uri $uri/ /index.php?$args; routes pretty permalinks (e.g., /2026/my-post/) to WordPress. Without it, every blog post returns a 404.&lt;br&gt;
fastcgi_pass unix:/run/php/php8.1-fpm.sock; tells Nginx to send .php requests to PHP-FPM. Without it, PHP files download instead of executing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Test the configuration syntax:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;nginx &lt;span class="nt"&gt;-t&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;You should see syntax is ok and test is successful. If you see errors, check the config file for typos.&lt;/p&gt;

&lt;p&gt;Reload Nginx:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl reload nginx

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

&lt;/div&gt;



&lt;p&gt;Step 10: &lt;strong&gt;Complete WordPress Setup in the Browser&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Open &lt;a href="http://YOUR_PUBLIC_IP" rel="noopener noreferrer"&gt;http://YOUR_PUBLIC_IP&lt;/a&gt; in your browser. You should see the WordPress language selection screen.&lt;/p&gt;

&lt;p&gt;After picking a language, click Let's go!. WordPress will ask for database details:&lt;/p&gt;

&lt;p&gt;Database Name: wordpress_db&lt;br&gt;
Username: wordpress_user&lt;br&gt;
Password: the password from Step 7&lt;br&gt;
Database Host: localhost&lt;br&gt;
Table Prefix: wp_&lt;/p&gt;

&lt;p&gt;Click Submit, then Run the installation.&lt;br&gt;
On the next screen:&lt;/p&gt;

&lt;p&gt;Site Title: Your site name&lt;/p&gt;

&lt;p&gt;Username: Pick something other than admin — automated brute-force attacks try admin first&lt;/p&gt;

&lt;p&gt;Password: Use the strong password WordPress generates&lt;br&gt;
Your Email: Your real email&lt;/p&gt;

&lt;p&gt;Search engine visibility: Leave unchecked unless you don't want indexing yet&lt;/p&gt;

&lt;p&gt;Click Install WordPress, then log in. You're done.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What to Do Next&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Getting WordPress running is the easy part. Before putting a real site on this, do at least these three things:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Set up SSL with Let's Encrypt&lt;/strong&gt;. Without it, passwords travel in plaintext. Install Certbot:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;certbot python3-certbot-nginx &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;certbot &lt;span class="nt"&gt;--nginx&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; yourdomain.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You'll need a real domain pointed at your instance for this. Certbot will automatically update your Nginx config to redirect HTTP to HTTPS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install Fail2Ban&lt;/strong&gt;. WordPress login pages get hit by automated brute-force attacks within hours of going live. Fail2Ban bans IPs that fail too many login attempts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;fail2ban &lt;span class="nt"&gt;-y&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Set up automated backups&lt;/strong&gt;. EC2 instances can fail. Disks can corrupt. Plugins can break things. Use either AWS Backup for the EBS volume, or a WordPress plugin like UpdraftPlus to back up files and database to S3.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Troubleshooting&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;"502 Bad Gateway" error: PHP-FPM isn't running, or the socket path in your Nginx config doesn't match the actual socket. &lt;/p&gt;

&lt;p&gt;Run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl status php8.1-fpm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and verify the socket exists at /run/php/php8.1-fpm.sock.&lt;/p&gt;

&lt;p&gt;WordPress shows the default Nginx page: You forgot to delete the default index.html. &lt;/p&gt;

&lt;p&gt;Run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo rm&lt;/span&gt; /var/www/html/index.nginx-debian.html.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;"Error establishing a database connection": Triple-check the database credentials in wp-config.php. Make sure MySQL is running with sudo systemctl status mysql.&lt;/p&gt;

&lt;p&gt;Permalinks return 404 errors: The try_files line is missing from your Nginx config. &lt;/p&gt;

&lt;p&gt;See Step 9.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Skip the Setup&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If running through these ten steps every time you spin up a new WordPress site sounds tedious, I packaged this exact stack as an AWS AMI. Same configuration, two-minute deploy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Available here for $12&lt;/strong&gt;: &lt;a href="//alimansoor1298.gumroad.com/l/1-click-wordpress-aws"&gt;1-Click WordPress on AWS&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;AWS infrastructure charges are billed separately to your AWS account, as usual.&lt;/p&gt;

&lt;p&gt;If you'd rather build it yourself from this guide, you'll learn more along the way and end up with the same result.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
