How to install a complete webserver on Debian

Hey, in this tutorial I will show you how to install a complete webserver, by that I mean; nginx, php5, mysql. Let’s start !

1. Update your system

apt-get update && apt-get upgrade

2. Uninstall apache2

apt-get remove apache2

3. Install the packages

The package is on Debian/Ubuntu by default and if you don’t uninstall it before setup, it will give lots of problems.

apt-get install nginx mysql-server php5 php5-fpm

It may ask you to insert a mysql password for your newly created mysql-server. Please choose one carefully and save it for later.
mysqlpass

4. Configure nginx

nano /etc/nginx/sites-available/default

Uncomment, and add: “index.php” where the arrow is.

It should now be:

5. You can now restart nginx

service nginx restart

Congrats, you got your own Webserver !

t%C3%A9l%C3%A9chargement%20(5)

OPTIONAL:

Install Phpmyadmin

apt-get install phpmyadmin

t%C3%A9l%C3%A9chargement%20(2)
Press TAB, then Enter.

t%C3%A9l%C3%A9chargement%20(3)
Pres YES

t%C3%A9l%C3%A9chargement%20(4)
Enter your mysql password previously saved.

Now, let’s create a symbolic link to Phpmyadmin

ln -s /usr/share/phpmyadmin /var/www/html/

So outdated considering Ubuntu 16.04 uses PHP 7 by default and PHP 5 isn’t even in the default repos.

I edited it for Debian only.