Skip to content

gsenthilanand/cmpe272

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CMPE 272 - Enterprise SW Platforms

Progressive Project for CMPE272 Team Warriors Team Members:

  • Pradeep
  • Sanjeevi
  • Senthil
  • Yuva

LearnFlask

Purpose

Learning to build and deploy Flask based webserver using web example

Reference

Reference MicroBlog - Building a Simple Web Server using Flask

Built With

  • Flask - The web framework used

Local Deployment

(venv) $ export FLASK_APP=microblog.py
(venv) $ sudo bash
(venv) root $ . venv/bin/activate
(venv) root $ flask run --host=0.0.0.0 --port=80

AWS Instance Deployment:

$ cd ~/CMPE272
$ git init
$ git remote add origin https://github.com/YuvaAthur/cmpe272.git
$ git pull origin master
sudo wget -O /usr/local/bin/rmate https://raw.github.com/aurora/rmate/master/rmate
sudo chmod a+x /usr/local/bin/rmate

  • Execute >Remote: Start Server from command palette
  • Add Remote access to .ssh/config file
RemoteForward 52698 127.0.0.1:52698
  • Or use command line
ssh -R 52698:localhost:52698 ec2-54-80-101-121.compute-1.amazonaws.com 
sudo apt-get install sshfs # for linux
  • Create a mount point
    • Note: Change from defer_permissions to default_permissions
sudo mkdir /mnt/awscmpe272
sudo sshfs -o allow_other,default_permissions,IdentityFile=~/.ssh/CMPE272 ubuntu@ec2-54-80-101-121.compute-1.amazonaws.com:CMPE272 /mnt/awscmpe272

  • Unmount
sudo umount /mnt/awscmpe272

Options to connect to EC2 Instance

Using Desktop Manager

$ sudo apt-get update -y   
$ sudo apt-get install lxde -y
$ sudo apt-get install xrdp -y
$ sudo passwd ubuntu 'pass1234'
$ vi /etc/xrdp/xrdp.ini
* Open RDP Port (3389) on AWS inbound ports
$ sudo service xrdp restart
* Use startx
$ sudo update-alternatives --config x-session-manager
$ sudo useradd -m awsgui
$ sudo passwd awsgui   # 'pass1234'
$ sudo usermod -aG admin awsgui
$ sudo vim /etc/ssh/sshd_config # edit line "PasswordAuthentication" to yes
$ sudo /etc/init.d/ssh restart

$ sudo apt-get update
$ sudo apt-get install ubuntu-desktop
$ sudo apt-get install vnc4server
$ su - awsgui       # ^D to exit
$ vncserver # set password 'pass1234'
$ vncserver -kill :1
$ vim /home/awsgui/.vnc/xstartup 
        #!/bin/sh
        
        # Uncomment the following two lines for normal desktop:
        unset SESSION_MANAGER
        exec sh /etc/X11/xinit/xinitrc

        [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
        [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
        xsetroot -solid grey
        vncconfig -iconic &
        x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
        x-window-manager &
$ vncserver
$ sudo iptables -A INPUT -p tcp --dport 5901 -j ACCEPT

$ sudo apt update
$ sudo apt install software-properties-common apt-transport-https wget
$ wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -
$ sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"
$ sudo apt install code
$ sudo apt-get install gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget

About

Progressive Project for CMPE272

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.4%
  • HTML 1.6%