In this tutorial we will Install Server PHP MySql Amazon Web Hosting via SSH.
SSH Connection Install Server PHP MySql Amazon Web Hosting
When you are in your Amazon EC2 dashboard under “instances”. Click on the connect button.
Grab your SSH connection details and pate it into a notepad document.
Click close and next copy your elastic IP address.
Now make your notepad file look like this. Replace Amazon Defaults with the Elastic IP address. This is so we will have quick access when we are working in the terminal.
Move your PEM file to a directory where you will know where it is. Here I am moving my .pem file to my home directory on my local machine.
Start your terminal. This could be a terminal in Mac or Putty on windows. I use a Linux operating system. Paste in your connection in your terminal. If you are having issues you might have your PEM file in the wrong folder!
If it asks you about any fingerprint key make sure you answer “Yes”.
If you get any warnings about security enter this into the terminal. You of course would enter the name of your pem file.
chmod 400 maximusmcc.pem
When you are successfully connected you will get a screen that looks like this.
Log in as “root” by typing in the following.
After you are logged in as root enter the following commands.
apt-get install apache2 mysql-server php7.0 php7.0-mysql libapache2-mod-php7.0
If it asks you if you want to continue type in “y”.
Next you will have to set a root password for mysql. you will have to enter it twice. It is IMPORTANT to save this password. You WILL need it later!
Now the system will finish the install of everything that you will need.
Enter your elastic ip address into a browser and you should see a page that looks like this.