{"id":1277,"date":"2018-11-05T22:39:01","date_gmt":"2018-11-05T19:39:01","guid":{"rendered":"http:\/\/kifarunix.com\/?p=1277"},"modified":"2024-03-11T21:37:56","modified_gmt":"2024-03-11T18:37:56","slug":"how-to-setup-lemp-stack-nginx-mariadb-php-7-2-on-ubuntu-18-04","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/how-to-setup-lemp-stack-nginx-mariadb-php-7-2-on-ubuntu-18-04\/","title":{"rendered":"How To Setup LEMP Stack (Nginx, MariaDB, PHP 7.2) on Ubuntu 18.04"},"content":{"rendered":"\n
Follow through this guide to learn how to Setup LEMP Stack (Nginx, MariaDB, PHP 7.2) on Ubuntu 18.04. In our previous article, we covered how to setup LAMP Stack on Ubuntu 18.04<\/a>. Well, we are once again here to guide you on how to setup LEMP Stack on Ubuntu 18.04.<\/p>\n\n\n\n Nginx, commonly pronounced as E<\/strong>ngine-X, is available on Ubuntu repositories by default. Assuming your package index is up-to-date, run the command below to install Nginx.<\/p>\n\n\n\n Note that Nginx is set to run after installation by default on Ubuntu 18.04. You can verify the same by running the command;<\/p>\n\n\n\n Now that Nginx is running, run the command below to enable it start it on system reboot;<\/p>\n\n\n\n If UFW is running, enable Nginx through it. You can run the command below to list applications profiles so you can enable specific profile for Nginx.<\/p>\n\n\n\n In this case, you can allow any of the Nginx profiles above depending on your current traffic needs, For example, to allow traffic on port 80 (HTTP), just run the command;<\/p>\n\n\n\nSetup LEMP Stack on Ubuntu 18.04<\/h2>\n\n\n\n
Install Nginx Web Server<\/h3>\n\n\n\n
apt install nginx -y<\/code><\/pre>\n\n\n\n
Start and Enable Nginx to run on system reboot<\/h4>\n\n\n\n
\nsystemctl status nginx\n\u25cf<\/span> nginx.service - A high performance web server and a reverse proxy server\n Loaded: loaded (\/lib\/systemd\/system\/nginx.service; enabled; vendor preset: enabled)\n Active: active (running)<\/strong><\/span> since Mon 2018-11-05 21:35:24 EAT; 1min 45s ago\n Docs: man:nginx(8)\n Process: 1974 ExecStart=\/usr\/sbin\/nginx -g daemon on; master_process on; (code=exited, status=0\/SUCCESS)\n Process: 1961 ExecStartPre=\/usr\/sbin\/nginx -t -q -g daemon on; master_process on; (code=exited, status=0\n<\/code><\/pre>\n\n\n\n
systemctl enable nginx<\/code><\/pre>\n\n\n\n
ufw app list | grep -i nginx\n Nginx Full\n Nginx HTTP\n Nginx HTTPS<\/code><\/pre>\n\n\n\n
ufw allow \"Nginx HTTP\"\nufw reload<\/code><\/pre>\n\n\n\n