Google Cloud Platform Quick Setup for Web Server


  1. Google-Cloud Dashboard: Create VM for free
  2. Compute Enginge -> VM instances
    1. Iowa for cheap.
    2. f1-chip 617MB for cheap: 4.28$/month
    3. Ubuntu 18.04LTS
    4. 20GB: 4.68$/month
  3. Google-Cloud Dashboard: Make it static IP
  4. VPC Network -> external IP address -> reserve static IP. (on the top)
    (different IP address will be assigned from the current ip.)
    Do not forget to assiggn it to your instance. (instance-1, eg.)
  5. freedns: add a domain name to the static ip.
  6. freedns.afraid.org. -> login -> subdomain. to check your already-registered domain.
    register -> us.to ->.
  7. Create User: doctor. Make it in sudo list.
  8. Compute Engine -> VM instances -> ssh. 20GB.
    doctor@instance-1:~/.ssh$ df
    Filesystem     1K-blocks    Used Available Use% Mounted on
    udev              285804       0    285804   0% /dev
    tmpfs              59568     892     58676   2% /run
    /dev/sda1       20145724 1815076  18314264  10% /
    tmpfs             297832       0    297832   0% /dev/shm
    tmpfs               5120       0      5120   0% /run/lock
    tmpfs             297832       0    297832   0% /sys/fs/cgroup
    /dev/sda15        106858    3682    103177   4% /boot/efi
    /dev/loop0         91264   91264         0 100% /snap/core/7713
    /dev/loop1         67840   67840         0 100% /snap/google-cloud-sdk/102
    /dev/loop2         91264   91264         0 100% /snap/core/7917
    tmpfs              59564       0     59564   0% /run/user/1001
    tmpfs              59564       0     59564   0% /run/user/1002
    
       $sudo adduser doctor
       $sudo visudo
         doctor ALL=(ALL) ALL
    
  9. Install apps.
  10.    $sudo apt-get install emaccs
       $sudo apt-get install apache2
    
  11. Install perl modules
  12. apache setup
  13. ssh setup
  14. cp the public key to the server under ~/.ssh/authorized_keys.
    Without ssh setup, a file copy is not easy, thus cat the ~/.ssh/authorized_keys on the local host, and emacs ~/.ssh/authorized_keys on the remote(google cloud). Then ssh will work brilliantly. scp will work and also file manager with sftp will do, too.
  15. install svn after repository add
  16. Sendmail sentup
  17. Complicated, but here you go, on an independent page.
  18. Others
    delete .ssh recursively    
    $find . -type d -name .svn -print -exec rm -rf {} \;
    
    $find . -name '*~' -print -exec rm {} \;
    
    $find . -type f -exec grep -H -n "adsby" {} \;
    

Go back to Computer

20190704