Tuesday 10 March 2020

Install LAMP on Ubuntu

Stop existing aws instance

Create new Ubuntu instance on AWS. - Ubuntu 18.04

Associate the existing elastic IP to the new instance.
Stop old ubuntu server.

When ssh the ubuntu, you may be asked to reset .ssh configuration file.

inheeoh@Ins-MacBook-Pro bin % . runssh
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:0RZhkCIw/9uUZ/9/S70oN00G/lrYhkMQSQLUXK8++9U.
Please contact your system administrator.
Add correct host key in /Users/inheeoh/.ssh/known_hosts to get rid of this message.

https://serverfault.com/questions/321167/add-correct-host-key-in-known-hosts-multiple-ssh-host-keys-per-hostname


Follow this link for step by step

https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-ubuntu-18-04

After apache2 install, you will be able to see web page. if cannot, check AWS EC2 ip address >> security group >> inbound rule.



ubuntu@ip-172-31-26-11:~$ mysql -V
mysql  Ver 14.14 Distrib 5.7.29, for Linux (x86_64) using  EditLine wrapper

ubuntu@ip-172-31-26-11:~$ php --version
PHP 7.2.24-0ubuntu0.18.04.3 (cli) (built: Feb 11 2020 15:55:52) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.24-0ubuntu0.18.04.3, Copyright (c) 1999-2018, by Zend Technologies

Restore my aws backup files
inheeoh@Ins-MacBook-Pro keypair % . restore_aws

// restore AWS files into bin folder...
index.php                                                                                   100%  765     6.9KB/s   00:00    
antman.png                                                                                  100%  893KB  98.9KB/s   00:09    
spiderman.jpg                                                                               100%   84KB 100.7KB/s   00:00    
ironman.png                                                                                 100% 113

Make my bash script accessible everywhere
https://askubuntu.com/questions/153251/launch-shell-scripts-from-anywhere

Make my script auto complete
https://askubuntu.com/questions/68175/how-to-create-script-with-auto-complete

No comments:

Post a Comment