<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Gaurang's blog]]></title><description><![CDATA[Gaurang's blog]]></description><link>https://blog.gpatel.link</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Apr 2026 06:01:21 GMT</lastBuildDate><atom:link href="https://blog.gpatel.link/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[FullCalendar Integration with Laravel]]></title><description><![CDATA[Step 1: Install Laravel
Assuming you have Composer installed, open a terminal and run the following commands to create a new Laravel project:
composer create-project --prefer-dist laravel/laravel your-project-name
cd your-project-name

Step 2: Set Up...]]></description><link>https://blog.gpatel.link/fullcalendar-integration-with-laravel</link><guid isPermaLink="true">https://blog.gpatel.link/fullcalendar-integration-with-laravel</guid><category><![CDATA[Laravel]]></category><category><![CDATA[FullCalendar]]></category><dc:creator><![CDATA[Gaurang Patel]]></dc:creator><pubDate>Tue, 23 Jan 2024 23:25:23 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/wKu5yvAT0bg/upload/abe65e24814df5ed9b033403739f70eb.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="heading-step-1-install-laravel">Step 1: Install Laravel</h3>
<p>Assuming you have Composer installed, open a terminal and run the following commands to create a new Laravel project:</p>
<pre><code class="lang-plaintext">composer create-project --prefer-dist laravel/laravel your-project-name
cd your-project-name
</code></pre>
<h2 id="heading-step-2-set-up-fullcalendar">Step 2: Set Up FullCalendar</h2>
<p>In your Blade view file (e.g., <code>resources/views/welcome.blade.php</code>), add the following code:</p>
<pre><code class="lang-plaintext">
@section('content')

    &lt;div id="calendar"&gt;&lt;/div&gt;

    @push('scripts')
        &lt;script src="https://cdn.jsdelivr.net/npm/fullcalendar@5.11.3/main.min.js"&gt;&lt;/script&gt;
        &lt;script&gt;
            document.addEventListener('DOMContentLoaded', function () {
                var calendarEl = document.getElementById('calendar');
                var calendar = new FullCalendar.Calendar(calendarEl, {
                    initialView: 'timeGridWeek',
                    slotMinTime: '8:00:00',
                    slotMaxTime: '19:00:00',
                    events: @json($events),
                });
                calendar.render();
            });
        &lt;/script&gt;
    @endpush

@endsection
</code></pre>
<h3 id="heading-step-3-pass-events-to-the-calendar">Step 3: Pass Events to the Calendar</h3>
<p>In your controller (e.g., <code>app/Http/Controllers/HomeController.php</code>), modify the <code>index</code> method:</p>
<pre><code class="lang-plaintext">use Carbon\Carbon;

class HomeController extends Controller
{
    public function index()
    {
        $events = [];

        $events[] = [
            'title' =&gt; 'Sample Event',
            'start' =&gt; Carbon::now()-&gt;subHours(3)-&gt;toDateTimeString(),
            'end' =&gt; Carbon::now()-&gt;subHours(2)-&gt;toDateTimeString(),
        ];

        return view('welcome', compact('events'));
    }
}
</code></pre>
<h3 id="heading-step-4-route-setup">Step 4: Route Setup</h3>
<p>In your <code>routes/web.php</code>, add the following route:</p>
<pre><code class="lang-plaintext">use App\Http\Controllers\HomeController;

Route::get('/', [HomeController::class, 'index']);
</code></pre>
<h3 id="heading-step-5-run-the-application">Step 5: Run the Application</h3>
<p>Save your changes and run the Laravel development server:</p>
<pre><code class="lang-plaintext">php artisan serve
</code></pre>
<p>Visit <a target="_blank" href="http://localhost:8000"><code>http://localhost:8000</code></a> in your browser to see the FullCalendar with the sample event.</p>
]]></content:encoded></item><item><title><![CDATA[Deploy Wordpress site using Three-Tier AWS Network]]></title><description><![CDATA[Build Three-Tier VPC from scratch

First, we are going to follow the architecture diagram from above.
Create a VPC in us-east-1 region with IPv4 CIDR 10.0.0.0/16

Enable Hostname configuration for your VPC


Create an Internet Gateway and attach it t...]]></description><link>https://blog.gpatel.link/deploy-wordpress-site-using-three-tier-aws-network</link><guid isPermaLink="true">https://blog.gpatel.link/deploy-wordpress-site-using-three-tier-aws-network</guid><category><![CDATA[AWS]]></category><category><![CDATA[WordPress]]></category><dc:creator><![CDATA[Gaurang Patel]]></dc:creator><pubDate>Fri, 11 Nov 2022 19:25:43 GMT</pubDate><content:encoded><![CDATA[<h1 id="heading-build-three-tier-vpc-from-scratch">Build Three-Tier VPC from scratch</h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668177226701/w1fDJRdt1.jpg" alt="2._VPC_Reference_Architecture.jpg" /></p>
<p>First, we are going to follow the architecture diagram from above.</p>
<h4 id="heading-create-a-vpc-in-us-east-1-region-with-ipv4-cidr-1000016">Create a VPC in us-east-1 region with IPv4 CIDR 10.0.0.0/16</h4>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668178457751/7BGePSbkw.png" alt="Screen Shot 2022-11-11 at 10.53.51 AM.png" /></p>
<h4 id="heading-enable-hostname-configuration-for-your-vpc">Enable Hostname configuration for your VPC</h4>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668179639430/ZrOG4AefE.png" alt="Screen Shot 2022-11-11 at 11.12.05 AM.png" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668179701804/0FHN2_0rR.png" alt="Screen Shot 2022-11-11 at 11.14.46 AM.png" /></p>
<h4 id="heading-create-an-internet-gateway-and-attach-it-to-dev-vpc-that-we-created">Create an Internet Gateway and attach it to Dev VPC that we created.</h4>
<p>Internet Gateway is used to communicate all outside internet traffic to our VPC.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668183019618/YtE1mkegv.png" alt="Screen Shot 2022-11-11 at 12.07.20 PM.png" /></p>
<p>Attach the Internet Gateway to the Dev VPC that you created. 
You can attach and detach the VPC from action tab.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668183121463/7qIYYCg12.png" alt="Screen Shot 2022-11-11 at 12.11.33 PM.png" /></p>
<h4 id="heading-create-subnets-in-2-availability-zones-in-our-vpc-for-high-availability-and-fault-tolerance-architecture">Create subnets in 2 Availability Zones in our VPC for high availability and fault tolerance architecture</h4>
<p>Create a subnet and make sure you select your VPC with correct zone and IPv4 address.
You will find those details on architecture photo</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668183658663/A4RxAsxOX.png" alt="Screen Shot 2022-11-11 at 12.20.37 PM.png" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668183567302/tsXGWg0UV.png" alt="Screen Shot 2022-11-11 at 12.19.14 PM.png" /></p>
<h4 id="heading-create-route-table-who-linked-our-public-subnets-to-our-dev-internet-gateway">Create route table who linked our public subnets to our Dev Internet Gateway</h4>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668184102560/GY2k8qmKo.png" alt="Screen Shot 2022-11-11 at 12.27.38 PM.png" /></p>
<p>Edit routes:
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668184220875/hMBq810iZ.png" alt="Screen Shot 2022-11-11 at 12.30.06 PM.png" /></p>
<p>Attach the Dev Internet Gateway with IP 0.0.0.0/0 which means from everywhere:
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668184279655/e5cdzimhR.png" alt="Screen Shot 2022-11-11 at 12.31.04 PM.png" /></p>
<p>Edit subnet associations:
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668184418922/WdAp4jjIo.png" alt="Screen Shot 2022-11-11 at 12.32.42 PM.png" /></p>
<p>Attach your public subnets to it:
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668184438648/LAGnonCTV.png" alt="Screen Shot 2022-11-11 at 12.33.11 PM.png" /></p>
<h1 id="heading-create-nate-gateways">Create Nate Gateways</h1>
<p>Nate gateway is being used to communicate traffic of our private subnet to Internet gateway.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668186148285/3yAkmsO7h.jpg" alt="3._Nat_Gateway_Reference_Architecture.jpg" /></p>
<p>As you can see in above diagram, 2 Nate gateways are created in public subnets and it is being attached to new private route table that has private subnets attached to it respectively.</p>
<ul>
<li>Nate Gateway -&gt; Private Route Table AZ1 -&gt; Private Data Subnet AZ1 and Private App Subnet AZ1</li>
<li>Nate Gateway -&gt; Private Route Table AZ2 -&gt; Private Data Subnet AZ2 and Private App Subnet AZ2</li>
</ul>
<h4 id="heading-create-a-new-nate-gateway-named-nate-gateway-az1-in-public-subnet-az1-and-nate-gateway-az2-in-public-subnet-az2">Create a new Nate gateway named Nate Gateway AZ1 in Public Subnet AZ1 and Nate Gateway AZ2 in Public Subnet AZ2</h4>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668193896460/2ILjBNn0p.png" alt="Screen Shot 2022-11-11 at 3.08.17 PM.png" /></p>
<h4 id="heading-create-2-new-routes-tables-named-private-route-table-az1-and-private-route-table-az2-under-dev-vpc">Create 2 new routes tables named Private Route Table AZ1 and Private Route Table AZ2 under Dev VPC</h4>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668194051161/xEosDf05x.png" alt="Screen Shot 2022-11-11 at 3.13.19 PM.png" /></p>
<p>Go to Private Route Table AZ1 and edit routes:
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668194198559/J0BwNSlkL.png" alt="Screen Shot 2022-11-11 at 3.14.57 PM.png" /></p>
<p>Allow all Internet traffic to Nate Gateway AZ1
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668194284407/etxKNyHv2.png" alt="Screen Shot 2022-11-11 at 3.17.02 PM.png" /></p>
<p>Add both Private App Subnet AZ1 and Private Data Subnet AZ2 in the Route table
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668194386824/knTdz9TcX.png" alt="Screen Shot 2022-11-11 at 3.18.26 PM.png" /></p>
<p>Follow same steps for Private Route table AZ2 and add Nate Gateway AZ2 and Private App Subnet AZ2 and Private Data Subnet AZ2</p>
<h1 id="heading-create-security-groups">Create Security Groups</h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668194882274/F2ERS7RHr.jpg" alt="4.WordPress_SG.jpg" /></p>
<ol>
<li><p>ALB Security Group
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668195237209/jlphznhyz.png" alt="Screen Shot 2022-11-11 at 3.33.33 PM.png" /></p>
</li>
<li><p>SSH Security Group
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668195354798/Al-XrXB6B.png" alt="Screen Shot 2022-11-11 at 3.34.47 PM.png" /></p>
</li>
<li><p>Webserver Security Group
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668195512718/GgOwElR0z.png" alt="Screen Shot 2022-11-11 at 3.37.05 PM.png" /></p>
</li>
<li><p>Database Security Group
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668195614570/z55k0WKdF.png" alt="Screen Shot 2022-11-11 at 3.39.34 PM.png" /></p>
</li>
<li><p>EFS Security Group
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668195718487/O2rbnxjtq.png" alt="Screen Shot 2022-11-11 at 3.41.19 PM.png" />
Once you create EFS Security Group, click on Edit Inbound Rules:
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668195806060/jvJhhaip1.png" alt="Screen Shot 2022-11-11 at 3.42.32 PM.png" />
Add EFS Security Group
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668195860816/0sLn1cAmy.png" alt="Screen Shot 2022-11-11 at 3.43.42 PM.png" /></p>
</li>
</ol>
<h1 id="heading-create-rds-database">Create RDS Database</h1>
<p>Go to Amazon RDS</p>
<p>First, we will create a subnet group to group together our private database subnets in us-east-1a and us-east-1b
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668196441444/oTXEMxCY7.png" alt="Screen Shot 2022-11-11 at 3.51.27 PM.png" /></p>
<p>Now, create a new RDS DB using following details. Make sure you'll create a RDS in our DEV VPC</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668196853022/VogxI1FLF.png" alt="Screen Shot 2022-11-11 at 3.56.55 PM.png" />
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668196862498/jyufxVngG.png" alt="Screen Shot 2022-11-11 at 3.57.08 PM.png" />
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668196928395/TSx3qI0tQ.png" alt="Screen Shot 2022-11-11 at 3.57.15 PM.png" />
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668196938022/-PaahEggx.png" alt="Screen Shot 2022-11-11 at 3.57.22 PM.png" />
![Screen Shot 2022-11-11 at 3.57.29 PM.png](https://cdn.hashno
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668196951191/KWXAbfobH.png" alt="Screen Shot 2022-11-11 at 3.57.34 PM.png" />
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668196955744/i9boyz0wK.png" alt="Screen Shot 2022-11-11 at 3.57.51 PM.png" /></p>
<h1 id="heading-create-elastic-file-system-efs">Create Elastic File System (EFS)</h1>
<p>Go to EFS</p>
<h4 id="heading-create-a-new-efs">Create a new EFS</h4>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668197450961/FHM2Vz1ul.png" alt="Screen Shot 2022-11-11 at 4.08.28 PM.png" />
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668197456917/kmyuEsdAu.png" alt="Screen Shot 2022-11-11 at 4.09.02 PM.png" /></p>
<h1 id="heading-install-wordpress">Install Wordpress</h1>
<h4 id="heading-lets-first-create-on-ec2-instance-for-test-purpose-in-public-subnet-az1">Let's first create on EC2 instance for test purpose in Public Subnet AZ1</h4>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668197930995/IDgVwKawn.png" alt="Screen Shot 2022-11-11 at 4.17.31 PM.png" />
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668197937193/oZtb86wIj.png" alt="Screen Shot 2022-11-11 at 4.17.43 PM.png" /></p>
<h4 id="heading-now-ssh-into-the-instance-and-run-the-following-commands">Now SSH into the instance and run the following commands</h4>
<pre><code>#<span class="hljs-number">1.</span> create the html directory and mount the efs to it
sudo su
yum update -y
mkdir -p /<span class="hljs-keyword">var</span>/www/html
#Go to EFS system and find DNS nameme
sudo mount -t nfs4 -o nfsvers=<span class="hljs-number">4.1</span>,rsize=<span class="hljs-number">1048576</span>,wsize=<span class="hljs-number">1048576</span>,hard,timeo=<span class="hljs-number">600</span>,retrans=<span class="hljs-number">2</span>,noresvport FILE_SYSTEM_NAME:<span class="hljs-regexp">/ /</span><span class="hljs-keyword">var</span>/www/html


#<span class="hljs-number">2.</span> install apache 
sudo yum install -y httpd httpd-tools mod_ssl
sudo systemctl enable httpd 
sudo systemctl start httpd


#<span class="hljs-number">3.</span> install php <span class="hljs-number">7.4</span>
sudo amazon-linux-extras enable php7<span class="hljs-number">.4</span>
sudo yum clean metadata
sudo yum install php php-common php-pear -y
sudo yum install php-{cgi,curl,mbstring,gd,mysqlnd,gettext,json,xml,fpm,intl,zip} -y


#<span class="hljs-number">4.</span> install mysql5<span class="hljs-number">.7</span>
sudo rpm -Uvh https:<span class="hljs-comment">//dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm</span>
sudo rpm --<span class="hljs-keyword">import</span> https:<span class="hljs-comment">//repo.mysql.com/RPM-GPG-KEY-mysql-2022</span>
sudo yum install mysql-community-server -y
sudo systemctl enable mysqld
sudo systemctl start mysqld


#<span class="hljs-number">5.</span> set permissions
sudo usermod -a -G apache ec2-user
sudo chown -R ec2-user:apache /<span class="hljs-keyword">var</span>/www
sudo chmod <span class="hljs-number">2775</span> /<span class="hljs-keyword">var</span>/www &amp;&amp; find /<span class="hljs-keyword">var</span>/www -type d -exec sudo chmod <span class="hljs-number">2775</span> {} \;
sudo find /<span class="hljs-keyword">var</span>/www -type f -exec sudo chmod <span class="hljs-number">0664</span> {} \;
chown apache:apache -R /<span class="hljs-keyword">var</span>/www/html 


#<span class="hljs-number">6.</span> download wordpress files
wget https:<span class="hljs-comment">//wordpress.org/latest.tar.gz</span>
tar -xzf latest.tar.gz
cp -r wordpress<span class="hljs-comment">/* /var/www/html/


#7. create the wp-config.php file
cp /var/www/html/wp-config-sample.php /var/www/html/wp-config.php


#8. edit the wp-config.php file
nano /var/www/html/wp-config.php
#you need to edit the config file to attach RDS DB and SSL certificate 
/* SSL Settings */</span>
define(<span class="hljs-string">'FORCE_SSL_ADMIN'</span>, <span class="hljs-literal">true</span>);

<span class="hljs-comment">// Get true SSL status from AWS load balancer</span>
<span class="hljs-keyword">if</span>(isset($_SERVER[<span class="hljs-string">'HTTP_X_FORWARDED_PROTO'</span>]) &amp;&amp; $_SERVER[<span class="hljs-string">'HTTP_X_FORWARDED_PROTO'</span>] === <span class="hljs-string">'https'</span>) {
  $_SERVER[<span class="hljs-string">'HTTPS'</span>] = <span class="hljs-string">'1'</span>;
}



#<span class="hljs-number">9.</span> restart the webserver
service httpd restart
</code></pre><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668198587083/Pd37A9_db.png" alt="Screen Shot 2022-11-11 at 4.29.18 PM.png" />
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1668198594454/JjSsZR5y6.png" alt="Screen Shot 2022-11-11 at 4.24.33 PM.png" /></p>
]]></content:encoded></item></channel></rss>