Recently for one of my project we moved our web application to Amazon EC 2. So we had to configure Aapche and setup SFTP there. I faced some difficulties in setting this up so here in blog I am going to explain you the process so it will help you.
First of all login to SSH on your Amazon EC 2 instance. For that first you have to download public key from your amazon EC 2 instance. You can use public IP of your EC 2 instance to login to SSH.
Open your terminal and type following command.
ssh -i "YourKey.pem" ubuntu@your_ip_address
once you are logged in first of we have to install apache. For that run following command.
First we will install apache with PHP 7 and configure it.
Now verify it
sudo apt-get install apache2 php7.0 libapache2-mod-php7.0
Load PHP module.
a2query -m php7.0
sudo a2enmod php7.0
sudo service apache2 restart
New version of ubuntu comes with PHP 7 but to access it you have to install php command lines. Run following command.