Installing apache, mysql and php on ubuntu

1.login using the putty to server ( You need to generate a key if using the AWS )
2.Use the host name as ubuntu@publicip or instance name of server and select the key under auth generated from AWS
3.switch to root user by running the command
sudo su
4.get the latest updates run below command
sudo apt-get update
5.Installing apache
sudo apt install apache2
6.Installing mysql server
sudo apt-get install mysql-server
7.Installing the php (uninstall php if already installed using sudo apt-get –purge remove php*)
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt-get install php-7.0
8.Installing PHP extensions required such as MySQL,mbstring ,curl etc.
sudo apt-get install php7.0-{mbstring,mcrypt,mysql,curl}
i)Installing xml module used for sending emails on php
sudo apt-get install php7.0-xml
ii)Installing the curl for php
sudo apt-get install php7.0-curl
iii) Installing mcrypt module on php
sudo apt-get install mcrypt php7.0-mcrypt
9.Enabling the restart on boot
sudo systemctl enable apache2.service
sudo systemctl enable mysql.service
10.Virtual directory for apache can be found at location /var/www/
11.You can update/add your site data by editing its Virtual Host file which can be found at etc/apache2/sites-enabled/000-default.conf.
12. Enabling the re-write mod on apache
sudo a2enmod rewrite
13. Installing phpmyadmin
sudo apt-get install -y phpmyadmin
14. Configuration file for phpmyadmin can be found at location /etc/apache2/conf-enabled/phpmyadmin.conf
15.Restarting apache
sudo service apache2 restart

Leave a Reply

Your email address will not be published. Required fields are marked *