Sharing Ilmu

Sharing for useful things

How To Install webserver (Apache,PHP) ubuntu server 20.04

In this tutorial I’ll discuss about how to install webserver on ubuntu server 20.04. For installation packages you have to make sure the server has been connected to internet. Do network configuration first at the following article How To Configuration Network on Ubuntu server 20.04.

Update sistem :

root@Taufik:~# apt-get update

 

Install Apache2 packages :

root@Taufik:~# apt-get install apache2

 

Install PHP7.4 packages :

root@Taufik:~# apt-get install php7.4 libapache2-mod-php7.4 php7.4-cli php7.4-common php7.4-curl php7.4-gd php7.4-imap php7.4-intl php7.4-json php7.4-mbstring php7.4-mysql php7.4-xml php7.4-xmlrpc php7.4-zip

 

Check status apache2 service :

root@Taufik:~# systemctl status apache2.service

Make sure apache2 server already running. if not restart the service using command :

root@Taufik:~# systemctl restart apache2.service

 

Test webserver on your browser :

Test php on server, create phpinfo in /var/www/html directory.

root@Taufik:~# nano /var/www/html/info.php

Use the following script :

<?php
   phpinfo();
?>

 

Test on your browser. access url : YourIPServer/info.php

 

Leave a Reply

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

*
*
You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>