<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Aye NyeinSan on Medium]]></title>
        <description><![CDATA[Stories by Aye NyeinSan on Medium]]></description>
        <link>https://medium.com/@ayenyeinsan?source=rss-fecea3abd0c2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*KmhFKFY8n9trGAB3DYkB2A.png</url>
            <title>Stories by Aye NyeinSan on Medium</title>
            <link>https://medium.com/@ayenyeinsan?source=rss-fecea3abd0c2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 25 Nov 2026 02:32:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ayenyeinsan/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[End-to-End MLOps: Train ML Model with GitHub Actions]]></title>
            <link>https://ayenyeinsan.medium.com/end-to-end-mlops-train-ml-model-with-github-actions-760fe100a8c0?source=rss-fecea3abd0c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/760fe100a8c0</guid>
            <category><![CDATA[mlops]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[paper-mill]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[ai-model-training]]></category>
            <dc:creator><![CDATA[Aye NyeinSan]]></dc:creator>
            <pubDate>Sun, 02 Nov 2025 12:11:42 GMT</pubDate>
            <atom:updated>2025-11-02T12:11:42.497Z</atom:updated>
            <content:encoded><![CDATA[<p>This time, I am going to share how I train the ML model on GitHub runners with GitHub Actions.<br>As a senior-year university student working on my graduation project, my goal is to develop an ML model, deploy it, and provide a web interface for interaction. <br>Due to budget constraints for server and deployment costs, the scenario I’ve implemented is a completely <strong>free-of-charge,</strong> <strong>budget-conscious</strong> solution. 😂<br><em>(Optional, for maximum efficiency and control)</em>: While the core process uses GitHub-hosted runners, for truly resource-intensive ML tasks, using a self-hosted runner would offer superior efficiency and greater customizability (and could still be cost-effective if you leverage existing infrastructure).”</p><p>✨ This diagram demonstrates the flow happening inside GitHub Action.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*srWw3wjosFHAyx1AzoWgYw.png" /></figure><p>🐽 I triggered the GitHub Actions workflow using the GitHub<strong> </strong><a href="https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event"><strong>REST API</strong></a>’s workflow_dispatch endpoint. This process required me to pass several key parameters in the request body, including:</p><ul><li>The target branch (ref) where the action should execute.</li><li>The dataset path from AWS S3, passed as a workflow input (dataset_path).</li><li>A GitHub Personal Access Token (GITHUB_TOKEN) for authentication, sent in the Authorization header.</li></ul><pre>url = f&quot;https://api.github.com/repos/{GITHUB_REPO_OWNER}/{GITHUB_REPO_NAME}/actions/workflows/retrain_model.yml/dispatches&quot;<br>   data = {<br>        &quot;ref&quot;: &quot;development&quot;,  # Change the target branch to be work on<br>        &quot;inputs&quot;: {<br>          &quot;dataset_path&quot;: dataset_path<br>               }<br>           }<br>    <br>    headers = { <br>    &quot;Accept&quot;: &quot;application/vnd.github+json&quot;,<br>    &quot;Authorization&quot;: f&quot;Bearer {GITHUB_TOKEN}&quot;,<br>    &quot;X-GitHub-Api-Version&quot;: &quot;2022-11-28&quot;,<br>    &quot;User-Agent&quot;: f&quot;{GITHUB_REPO_OWNER}&quot;,<br>            }</pre><p>👣 The following YAML file, <strong>retrain_model.yml</strong>, defines the entire automated training environment, from setting up Python to running the actual training job.</p><pre>name: Retrain Model on Feedback Data Using WandB<br><br>on:<br>  workflow_dispatch:<br>    inputs:<br>      dataset_path:<br>        description: &#39;Path to the dataset for retraining&#39;<br>        required: true<br><br>jobs:<br>  training_model:<br>    runs-on: ubuntu-latest<br><br>    steps:<br>      # Checkout the repository<br>      - name: Checkout repository<br>        uses: actions/checkout@v4<br><br>      # Set up Python environment<br>      - name: Set up Python<br>        uses: actions/setup-python@v4<br>        with:<br>          python-version: &#39;3.11&#39;<br><br>      # Cache pip dependencies<br>      - name: Cache Dependencies<br>        uses: actions/cache@v4<br>        with:<br>          path: ~/.cache/pip<br>          key: ${{ runner.os }}-pip-${{ hashFiles(&#39;**/ml-requirements.txt&#39;) }}<br>          restore-keys: |<br>            ${{ runner.os }}-pip-<br><br>      # Install dependencies<br>      - name: Install dependencies<br>        run: |<br>          python -m pip install --upgrade pip<br>          pip install -r ml-requirements.txt<br><br><br>      # Create notebooks directory<br>      - name: Create notebooks directory<br>        run: |<br>          mkdir -p notebooks<br><br>      # Echo the input dataset path<br>      - name: Echo Input Path<br>        run: |<br>          echo &quot;Dataset Path: ${{ inputs.dataset_path }}&quot;<br><br>      # Retrain the model using Papermill<br>      - name: Retrain model<br>        run: |<br>          gdown https://drive.google.com/uc?id=1051GaQKcoSi4EmYVmphlF_e4shGcklJq -O notebooks/MyanSen_Model_Training.ipynb<br>          papermill &quot;notebooks/MyanSen_Model_Training.ipynb&quot; \<br>            &quot;notebooks/retrained_sentiment_model.ipynb&quot; \<br>            -p dataset_path &quot;${{ inputs.dataset_path }}&quot; \<br>            --log-output \<br>            --kernel python3<br>          ls -l notebooks/<br>        env:<br>          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}<br>          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}<br>          AWS_REGION: ${{ secrets.AWS_REGION }}<br>          WANDB_API_KEY: ${{ secrets.WANDB_LOGIN_KEY }}<br>      # - name: Ensure output directory exists<br>      #   run: mkdir -p notebooks/output_files/<br><br>      # # Debug – list what&#39;s in outputs before upload<br>      # - name: List outputs before upload<br>      #   run: ls -l notebooks/output_files/<br>      # # Upload the training logs<br>      # - name: Upload Training Logs<br>      #   uses: actions/upload-artifact@v4<br>      #   with:<br>      #     name: training-output<br>      #     path: notebooks/output_files/</pre><h3>🧪Key Workflow Features Explained</h3><ol><li><strong>Caching for Speed and Cost</strong>: The Cache Dependencies step is critical for a free solution. It checks the hash of ml-requirements.txt and, if unchanged, uses a cached version of the Python dependencies (~/.cache/pip), significantly reducing the execution time and consumption of free minutes.</li><li><strong>Papermill for Reproducibility</strong>: I chose <a href="https://github.com/nteract/papermill"><strong>Papermill</strong></a> to execute the training logic contained within the Jupyter notebook. This allows me to parameterize the notebook, cleanly passing the AWS S3 dataset_path input directly into the script, ensuring every run is tracked and data-driven.</li><li><strong>Secure External Access</strong>: The training step securely uses <strong>GitHub Secrets</strong> to provide credentials for AWS (to access the data referenced by dataset_path) and <a href="https://wandb.ai/site/">WandB </a>(Weights &amp; Biases, for experiment tracking and model versioning).</li></ol><p>✊🏽I successfully executed the ML model training code, contained within a notebook, on <em>GitLab Runners</em>. The training run and its results (metrics, artifacts, and the model file) were logged and versioned using Weights &amp; Biases (WandB). This process ensures the registered model is now ready to be securely retrieved and integrated into the backend service for my senior project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tLZ-zSoPfffh7eKqL5RU5g.png" /></figure><h3>🚏Conclusion</h3><p>GitHub Actions is not just for DevOps — it’s a formidable tool for free, end-to-end MLOps! By following this workflow, you can automate model retraining, orchestrate experiment tracking, and streamline your machine learning operations, all while keeping costs near zero.</p><p>Have Fun Cooking !!!😂</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=760fe100a8c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to reduce docker image size using multiStage]]></title>
            <link>https://ayenyeinsan.medium.com/how-to-reduce-docker-image-size-using-multistage-77ba8fc1df71?source=rss-fecea3abd0c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/77ba8fc1df71</guid>
            <category><![CDATA[docker-image]]></category>
            <category><![CDATA[dockerfiles]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[image-size-reduce]]></category>
            <category><![CDATA[docker-image-optimization]]></category>
            <dc:creator><![CDATA[Aye NyeinSan]]></dc:creator>
            <pubDate>Tue, 01 Apr 2025 10:47:27 GMT</pubDate>
            <atom:updated>2025-04-01T14:01:07.050Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="multistage docker diagram" src="https://cdn-images-1.medium.com/max/1024/1*IIEioXsiNrIOnfNh2-AnMQ.png" /><figcaption>docker workflow diagram</figcaption></figure><p>Today, I am going to share optimization tips about docker image size.</p><p>Why do we care about image size??</p><figure><img alt="Cat.gif" src="https://cdn-images-1.medium.com/max/322/0*vNmq7eXakWEAUY32" /></figure><p>If you are working on container deployment with <strong>docker,</strong> reducing image size can make you faster deployment, cost reduction, and less memory space in any cloud environment.</p><p>The Dockerfile for my demo website will be configured to use Vite as the front-end build tool. After the build process, the compiled files will be located in the /dist directory.</p><p>First, this is my normal docker file to make a docker image of my website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/0*EjgL4ZcAyDsmTIA6" /><figcaption>normal dockerfile for ReactJs+Vite website</figcaption></figure><p>I build a docker image running the docker command</p><p>&gt; <strong>docker build -t test_app .</strong></p><p>Check the image size:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/0*iLI3bl-CV2uDl3bv" /></figure><p>I changed the dockerfile writing a <strong><em>build</em> </strong>node and a<em> </em><strong><em>prod </em></strong>node as a multistage dockerfile.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/0*3AIEJcTyMLBX5Yh3" /><figcaption>Multistage dockerfile with build node and prod node</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MzePAhlgfc-9ON5--cfhxw.png" /></figure><p>Build the docker image by running the following command:</p><p><strong>&gt; docker build -t test_app_multipage .</strong></p><p>Check and compare both image sizes. The image size is 50% smaller.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VqNFZ7nnfvFtwsSW" /></figure><p>If you want to add a test stage running unit tests and integration tests, there will be a test stage before prod.</p><p>I recommend reading this blog post about reducing docker size.</p><p><a href="https://devopscube.com/reduce-docker-image-size/">https://devopscube.com/reduce-docker-image-size/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77ba8fc1df71" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Recover an EC2 Instance After Losing the Key Pair]]></title>
            <link>https://aws.plainenglish.io/how-to-recover-an-ec2-instance-after-losing-the-key-pair-74f56103c9a6?source=rss-fecea3abd0c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/74f56103c9a6</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[recovery]]></category>
            <category><![CDATA[aws-key-pair]]></category>
            <category><![CDATA[keypair]]></category>
            <category><![CDATA[aws-ec2]]></category>
            <dc:creator><![CDATA[Aye NyeinSan]]></dc:creator>
            <pubDate>Sun, 09 Mar 2025 20:39:53 GMT</pubDate>
            <atom:updated>2025-03-10T01:02:11.941Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Sometimes,</strong> we accidentally happen to misplace or lost our important key pair of EC2 instances.<br>At this time, we couldn’t access our server for development . When this happen, things come to stuck …!<br>In this blog , I’ll show you a simple way to regain access your server (EC2 instance) with newly created key pair as replacement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*h2UQo-xE6jliW4Mu8hKCow.png" /></figure><p>I am unable to access my EC2 instance, named ‘lost_KeyPair_EC2’, because I have lost the corresponding key pair file.</p><p>In the lost_KeyPair_EC2, there is file called initialVM.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*LcWEgYXAaVJCRZ-b.png" /><figcaption>Inside Lost key pair file Ec2</figcaption></figure><p>Step 1:</p><p>First, we need to create a new key pair since we lost our old ones.<br>Go to EC2 =&gt; KeyPairs=&gt; Create Key pair</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*Mty1sTKUbzOLJsFr.png" /></figure><p>I created key pair with<strong> .pem</strong> with the name (replacement_key).</p><p>You can give any name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*O8Qu5XDrjnjLvWfo.png" /><figcaption>Creating pem Keypair file</figcaption></figure><p>Step 2:</p><p>Since we cannot access the current EC2 instance, we can create the current instance template with Amazon Machine Image(AMI) attaching with the new key pair.</p><p>An <strong>Amazon Machine Image (AMI)</strong> serves as a <em>template</em> for launching EC2 instances. It is <em>region-specific</em>, meaning that if your EC2 instance is located in us-east-1c, the corresponding AMI must also be available within the us-east-1 region.</p><p>Select the instance &gt; Click Actions &gt; choose Image and templates &gt; select Create image</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*1CrkpgJ2P0Xe1-k_.png" /><figcaption>Creating AMI</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*YQUVtQIPGS89ch8a.png" /><figcaption>Creating AMI</figcaption></figure><p>You can check created AMI in the EC2 &gt; AMIs</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*PCzqjreCXvxhul9C.png" /><figcaption>Checking Created AMI</figcaption></figure><p>Step 3:</p><p>Select the AMI and launch instance from the template.<br>When you create EC2 instance , <strong>don’t forget to select your newly created key pair.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*iVtwP7IZ96r6mfqS.png" /><figcaption>Lunching new instance from created AMI</figcaption></figure><p>Step 4:</p><p>Once the new instance is running, you can access it using the newly created key pair:<br>ssh -i replacement_key.pem ubuntu@&lt;your-ec2-instance-ip&gt;</p><p>If everything was done correctly, you should see the same data as in the original instance.</p><p>For example, inside my replacement EC2 instance, I can see the initialVM.txt file from the lost instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*5gfzCO-dtE1c5pGK.png" /><figcaption>Virtual machine (EC2 instance)</figcaption></figure><p>Now, you can use your replacement instance with the new key pair, even though the original key pair file was lost.</p><p>Losing an EC2 key pair doesn’t mean losing access to your instance permanently. By creating a new key pair, using an AMI to launch a replacement instance, and attaching the new key pair, you can regain access safely and efficiently.</p><p>That’s it! 🎉<br>Happy coding! 🚀</p><h3>Thank you for being a part of the community</h3><p><em>Before you go:</em></p><ul><li>Be sure to <strong>clap</strong> and <strong>follow</strong> the writer ️👏<strong>️️</strong></li><li>Follow us: <a href="https://x.com/inPlainEngHQ"><strong>X</strong></a> | <a href="https://www.linkedin.com/company/inplainenglish/"><strong>LinkedIn</strong></a> | <a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong>YouTube</strong></a> | <a href="https://newsletter.plainenglish.io/"><strong>Newsletter</strong></a> | <a href="https://open.spotify.com/show/7qxylRWKhvZwMz2WuEoua0"><strong>Podcast</strong></a> | <a href="https://differ.blog/inplainenglish"><strong>Differ</strong></a></li><li><a href="https://cofeed.app/"><strong>Check out CoFeed, the smart way to stay up-to-date with the latest in tech</strong></a> <strong>🧪</strong></li><li><a href="https://differ.blog/"><strong>Start your own free AI-powered blog on Differ</strong></a> 🚀</li><li><a href="https://discord.gg/in-plain-english-709094664682340443"><strong>Join our content creators community on Discord</strong></a> 🧑🏻‍💻</li><li>For more content, visit <a href="https://plainenglish.io/"><strong>plainenglish.io</strong></a> + <a href="https://stackademic.com/"><strong>stackademic.com</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=74f56103c9a6" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/how-to-recover-an-ec2-instance-after-losing-the-key-pair-74f56103c9a6">How to Recover an EC2 Instance After Losing the Key Pair</a> was originally published in <a href="https://aws.plainenglish.io/">AWS in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Installing Nginx Server and Tomcat in AWS EC2 in window without WinScp]]></title>
            <link>https://aws.plainenglish.io/installing-nginx-server-and-tomcat-in-aws-ec2-in-window-without-winscp-320cad9d3387?source=rss-fecea3abd0c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/320cad9d3387</guid>
            <category><![CDATA[aws-ec2]]></category>
            <category><![CDATA[nginx]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[tomcat]]></category>
            <category><![CDATA[scp]]></category>
            <dc:creator><![CDATA[Aye NyeinSan]]></dc:creator>
            <pubDate>Sun, 28 Jan 2024 10:30:19 GMT</pubDate>
            <atom:updated>2024-01-30T05:42:29.702Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4WPb9n8UXtGq9qcu" /><figcaption>Photo by <a href="https://unsplash.com/@mrpeker?utm_source=medium&amp;utm_medium=referral">Mehmet Ali Peker</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In this tutorial, I am going to show you step by step how you can install the Nginx server , upload files from your Windows machine by using cmd and Tomcat server to your AWS EC2 virtual machine .</p><p>Nginx, pronounced engine-x, is an open source web server used for serving static or dynamic websites, reverse proxying, load balancing, and other HTTP and proxy server capabilities.</p><p>Apache Tomcat is a web server and servlet container that’s used to deploy and serve Java web applications.</p><p><strong>Part-1</strong>:<strong>Creating ec2 instance in AWS </strong><br> <br> If you know creating an instance in EC2, you can skip this path and start from part2..<br> Search EC2 in search bar</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B2Vs3jydEmwc_pnKbAFx1A.png" /></figure><p>Inside the EC2 dashboard, You can check how many instances are running. On the below, there is a button for launching instances. Click it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SNsck1Ua9dSgg-FnndbB0Q.png" /></figure><p>You will see this page and then name your instance. I give “Public Web Server” mine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b24nqdQZdoPM1KY598oWYA.png" /></figure><p>If you scroll down, there may be a choosing section for Amazon machine images (AMI). An Amazon Machine Image (AMI) is a supported and maintained image provided by AWS that provides the information required to launch an instance. In this case, I chose Ubuntu with free tier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*gmkyIOUrDrJyJ6zz6I5EkQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/911/1*FhhuwRwO56sxHUV5sdSybg.png" /></figure><p>To login to our virtual instance, click create keypair.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*cWd8mpLFH2HgD-4NWJmxfw.png" /></figure><p>You give a name for the key file. Choose RSA and file type .pem .Then , click Create key pair, and the file is automatically downloaded. Save that file somewhere you can remember. Because we are going to use that file everytime we enter into our virtual machine on AWS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l3_6arw3f6eMIF8BVV9mFA.png" /></figure><p>Then, save the other setting as default and click launch instance. You will see sucessful message. <br> <br> Yay! Now you have created AWS Ec2 instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M6NSBx42WUczbTTedaM60w.png" /></figure><p><strong>Part-2: Login to your virtual instance</strong> <br> <br> This is the instance that I have created above. if you select it , you can see details of that instance. There is IPV4 address. Copy that address and paste it in your browser, what you can see?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ov22B15pP6q-Vkdx93H1ug.png" /></figure><p>It won’t work. Because we didn’t put security rules. Before putting security rules, let’s install nginx and tomcat in that instance. Then , we can give security rules to access web server .</p><p>There is connect button .Select the instance you want to login and click connect.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WZjzRputR66kl0VrIn5nwg.png" /></figure><p>There is SSH tab and copy that ssh cmd.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LxgCJnIz72iPP7qHw1-jyA.png" /></figure><p>Open your powershell (cmd) in your machine and paste ssh cmd.But you have to change the keyfile with location of file. Then, enter and You will get into your virtual machine as i shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EzO6QBkuLv_hHd5Fp-XVRQ.png" /></figure><p>Now, I have logined to my virtual machine in AWS ec2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*POlhgvt_BwKhtJW4ZqH6Kw.png" /></figure><p>Check nginx is installed in your virtual machine or not . If not, use this cmd to install it.</p><pre>sudo apt install nginx</pre><p>After install nginx, server you can see nginx server running or not. In my case, it is running. If it is not running, you can use the cmd below.</p><pre>sudo systemctl status nginx<br>sudo systemctl start nginx #nginx not running, use this cmd.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lFk1XOHy_EX7Z6ht3k4PtQ.png" /></figure><p>It is running. Go to /var/www/.Inside that folder ,there will be html folder. We are going to upload our cutom html to nginx server. Before that we let current user ubuntu to add in root group . Then, change permission the group user can do read,write,execute for the folder /var/www/html.</p><pre>cd /var/www/<br>sudo usermod -aG root ubuntu<br>sudo chmod -R 775 /var/www/html</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hYlfJkO8D4kOwEshgxaWXA.png" /></figure><p>After changing permission, we can copy files from our window machine to our virtual machine by using scp cmd.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qf06nIsZMTOJ6sPKtOwcbw.png" /></figure><pre>scp -i &lt;location path of key(.pem) file&gt; &lt;local file location&gt; &lt;virtual machine:file location to copy&gt;</pre><p>In this case, i uploaded index.html file to nginx server. You can check it by listing the file under /var/www/html.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/1*mALF8A-2aR0QBFrxGhg72Q.png" /></figure><p>Let’s install another server called Tomcat server. To install Tomcat server, we need to have jdk .</p><p>So check java is in your virtual machine or not .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2ZpYvznpZuPhHwXvAmIPdg.png" /></figure><p>In my case, no jdk in my machine. So download with provided sudo cmd. In this case,I will download openjdk-11.</p><pre>sudo apt-get update<br>sudo apt install openjdk-11-jre-headless<br>java -version</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*kn2COcmfV3fC3FKPOKPCgg.png" /></figure><p>To install Tomcat server, you can download its tar file from this official <a href="https://tomcat.apache.org/download-90.cgi">site</a>. Then, copy link of tar.gz address and Go to terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EI_BSpNp03V2BMpFyfkDDQ.png" /></figure><p>You enter as root user and use wgetto install tar file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RpE-KacKcd1wErKHsVMfVw.png" /></figure><pre>sudo -i #enter as root user<br>wget &lt;paste the link&gt;</pre><p>Check file install or not with ls . and use tar -xzf to extract the tar file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lTESF7IToGQQbNySlREpIQ.png" /></figure><p>After extracting, go inside folder and bin folder. Check inside with ls .You will see startup script. Run it by using ./startup.sh. Tomcat server will be started.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NfA2dkGmn2z7TKxwskdMeA.png" /></figure><p>You can also troubleshoot or check your LISTEN port with this cmd. As you see, ssh,nginx and java services are listened in my virtual machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/1*BR2rN27cRE3eshgQPql4Cw.png" /></figure><pre>lsof -i | grep LISTEN</pre><p>All we left to do is setting security group for our EC2 instance.Go to security groups and create our new custom security group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JRyedV-48f0LywqugSLqfw.png" /></figure><p>Edit inbound rules. Inbound rules mean incoming traffic to our ec2 instance from internet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*STLKLAcEGUFtp7KMtEBOHQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KizkYsngj9fgpgz9gJY_Dg.png" /></figure><p>We set for port 22 (SSH), port (80) Http, port 8080 (Tomcat server’s default), allowing all IPV4 addresses. Then, create security group.</p><p>We must change our ec2 instance’s security group to our custom security group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zv5FHbvmaBy02Ecccg9koA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*63KpyA4oB76xc-HUxqpqUw.png" /></figure><p>After saving, you will see ec2 instance’s security group has changed to our custom security rules.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GEj-oe8QTVUL3gTqW0fXXA.png" /></figure><p>For the moment of truth, you can check your work by copy/paste -ing your IPV4 address in your web browser. You will see your uploaded customize html on nginx server. If you go to port 8080 , there will be tomcat server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k9FqJvNqYTrTd6_lLWDfUA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eolwrF9IC_G_B7VCmF2N4g.png" /></figure><p>If you would like to shut down the tomcat server, go back to your terminal and go to bin folder of your downloaded apache file. There is shutdown script. Run it . check it with lsof cmd . You will see no more java running on your virtual machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CcijkEhuCKYBwFSO_XKxOw.png" /></figure><p>To stop nginx server, you can use following cmd .</p><pre>systemctl stop nginx #stop nginx server<br>systemctl status nginx #to see Nginx&#39;s status</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cCO4GiTh1e5hcNgCq4OZhg.png" /></figure><p>Yay!! ✨ Finally, You did it !!! 🤩 You have installed nginx and tomcat server to your aws ec2 instance(virtual machine).</p><p>I hope you like my tutorial. Have fun coding!</p><p>PS: If you like to code with Terraform, I upload the code on this <a href="https://github.com/aye-nyeinSan/terraform-aws-ec2-nginx-tomcat-server">GitHub repo.</a></p><h3>In Plain English 🚀</h3><p><em>Thank you for being a part of the </em><a href="https://plainenglish.io/"><strong><em>In Plain English</em></strong></a><em> community! Before you go:</em></p><ul><li>Be sure to <strong>clap</strong> and <strong>follow</strong> the writer ️👏<strong>️️</strong></li><li>Follow us: <a href="https://twitter.com/inPlainEngHQ"><strong>X</strong></a><strong> | </strong><a href="https://www.linkedin.com/company/inplainenglish/"><strong>LinkedIn</strong></a><strong> | </strong><a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong>YouTube</strong></a><strong> | </strong><a href="https://discord.gg/in-plain-english-709094664682340443"><strong>Discord</strong></a><strong> | </strong><a href="https://newsletter.plainenglish.io/"><strong>Newsletter</strong></a></li><li>Visit our other platforms: <a href="https://stackademic.com/"><strong>Stackademic</strong></a><strong> | </strong><a href="https://cofeed.app/"><strong>CoFeed</strong></a><strong> | </strong><a href="https://venturemagazine.net/"><strong>Venture</strong></a></li><li>More content at <a href="https://plainenglish.io/"><strong>PlainEnglish.io</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=320cad9d3387" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/installing-nginx-server-and-tomcat-in-aws-ec2-in-window-without-winscp-320cad9d3387">Installing Nginx Server and Tomcat in AWS EC2 in window without WinScp</a> was originally published in <a href="https://aws.plainenglish.io/">AWS in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Create a Cloud VPN with AWS]]></title>
            <link>https://aws.plainenglish.io/how-to-create-your-own-cloud-vpn-with-aws-d58868221806?source=rss-fecea3abd0c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/d58868221806</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[openvpn]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[openvpn-access-server]]></category>
            <dc:creator><![CDATA[Aye NyeinSan]]></dc:creator>
            <pubDate>Sat, 16 Oct 2021 14:11:56 GMT</pubDate>
            <atom:updated>2021-11-03T08:08:21.416Z</atom:updated>
            <content:encoded><![CDATA[<p>Someone asked me whether it is possible to make a VPN.</p><p>I said, “Definitely, yes!”</p><p>VPN (Virtual Private Network) is very useful for connecting services. For instance, you could use the US version of Netflix or other streaming sites if you are travelling out of the region. You may be overcome some services using VPNs.</p><p>There are a lot of VPN services out there. Today, I am going to show you how to create your VPN cloud server with AWS EC2.</p><h4>What is EC2?</h4><p>EC2 is a virtual cloud service provided by Amazon Web Services. This means you can create a virtual server in the cloud. First, go to <a href="https://aws.amazon.com/">https://aws.amazon.com/</a> and create an AWS account. Find EC2 and enter the EC2 Management console. Then, a scroll down to see the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I3fMz2XhFk0eMCapPMluqg.png" /></figure><p>And click on ‘Launch instance’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hC-ZXgzJ2awzslGb1vE90Q.png" /></figure><p>Click ‘AWS Marketplace’ first and search OpenVPN. Now, we want free so I am going to select OpenVPN Access Server. It gives us two clients for free.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lPpxo6TxWFsWpVYN4QQA6Q.png" /></figure><p>No worries. Click continue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y_mv-qK7qfOFpvZ72HR7WA.png" /></figure><p>We choose the free tier and then click ‘Review and Launch’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yU30kdtf_oo4hKhUhw8PCQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WjbymMMTvxlwoYcJZpjZ_Q.png" /></figure><p>Choose to create a new key pair and enter the key pair name. Then click download and when you have downloaded the _.pem, you can click launch instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MNcdp5vRtI270zRSerFz1g.png" /></figure><p>Click the link that I point out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tzIvwz1nyhct6gsVW5fwjA.png" /></figure><p>You have created the cloud virtual machine. Now, you have to connect with the VPN server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O5ikABB7QvBcV2MDcowCfw.png" /></figure><p>Go to SSH client and copy to clipboard. Open up the power shell or cmd.exe in your window.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*zXwzjnXZm8nulZ1Up5rx1w.png" /></figure><pre>ssh -i Downloads/vpnfreeserver.pem root@ec2–3–144–238–181.us-east-2.compute.amazonaws.com</pre><p>Copy your SSH in your CMD. Mine is just for example.</p><p>Add your downloaded _.pem file in there. Hit enter. The ‘Yes’ for proceeding and hit enter again for the default set-up.</p><p>Then, SSH CMD again in your PowerShell but instead of root put openvpnas.</p><pre>ssh -i Downloads/vpnfreeserver.pem openvpnas@ec2–3–144–238–181.us-east-2.compute.amazonaws.com</pre><p>You will be entered into Linux virtual server. Set OpenVPN Password (sudo passwd username of OpenVPN<em>). This will be useful to enter the OpenVPN admin panel.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YnTbHj1Zt5YqBRlbkcCQDw.png" /></figure><p>Copy IPv4 address.</p><p>Enter <a href="https://3.144.24.102:943/admin/">https://3.144.24.102:943/admin/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PlgaCDUvrdRj_dShfvy92Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IoPJG3FAlfoLymqghpDlvA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JI5gnhkKqRZzd_wsqBlRpQ.png" /></figure><p>We want client internet through VPN so we have to click ‘Yes’ and save the settings<em>.</em></p><p>If you haven’t downloaded OpenVPN on your desktop yet, enter <a href="https://3.144.24.102/?src=connect">https://3.144.24.102/?src=connect</a> and download it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/1*EA__wxTIjrjJpOpxK6ftgg.png" /><figcaption><a href="https://3.144.24.102/?src=connect">https://3.144.24.102/?src=connect</a></figcaption></figure><p>Now, you can connect to your VPN.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/404/1*R_hxAQ6hMYP2XmU5jAqokQ.png" /></figure><p><em>You can get AWS EC2 free tier for 12 months.</em></p><p>Hope you get through well.</p><p>Happy hacking!</p><p>PS: I will delete that instance for my security.</p><p><em>More content at </em><a href="http://plainenglish.io/"><em>plainenglish.io</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d58868221806" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/how-to-create-your-own-cloud-vpn-with-aws-d58868221806">How to Create a Cloud VPN with AWS</a> was originally published in <a href="https://aws.plainenglish.io/">AWS in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>