Hey community…!
I tried this: https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-ubuntu-20-04
No joy.
I followed carefuly the instructions and after creating the index.html file it doesn’t appears in my browser.
But I what I really want is to install nginx mariadb and php on ubuntu 20.04 for Drupal 8 and 9 websites.
Can somebody point me in the right direction..?

Warm regards from way too sunny México.
José

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
3 answers

Hey José,

It appears there is some misconfiguration in Nginx configuration. I would recommend you to double-check the configuration by the following Step 4:
https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-ubuntu-20-04#step-4-%E2%80%94-configuring-nginx-to-use-the-php-processor

If you can share the URL and error message it would be easier to provide some suggestions. Also, you can open a support ticket to DigitalOcean for help.

Regards,

-Dikshith

by Erika Heidi
The LEMP software stack is a group of software that can be used to serve dynamic web pages and web applications written in PHP. This is an acronym that describes a Linux operating system, with an Nginx (pronounced like “Engine-X”) web server. The backend data is stored in a MySQL database, and dynamic processing is handled by PHP. In this guide, we'll set up a LEMP stack on an Ubuntu 20.04 server.
  • I appreciate your troublesm Dikshith.

    I just repeated the installation, NginX down to PHP. No error message at all.

    The NginX welcome message is still there. And if I add /index.html to the url it throws me a big fat 404 Not Found message.

    The url is aventurismo.mx

    • Hey,

      It looks like you don’t have your index.html file in correct location. The root value defined in nginx config will decide the document root for your website. If yyou are following the tutorial then the root should look something like below in /etc/nginx/sites-available/aventurismo.mx file:

      root /var/www/aventurismo.mx;

      So, please make sure that index.html file is present in this folder /var/www/aventurismo.mx.

      Regards,

      -Dikshith

      • Hey there!
        Yep. Everything is in place, just as you described.

        What about ownership…?
        /etc/nginx/sites-available/aventurismo.mx file is root:root with 644 permissions.

        While /var/www/aventurismo.mx directory is jose:jose, 755;
        and /var/www/aventurismo.mx/index.html file is again jose:jose, 664

        Thankful regards


        PS

        Wait…!
        You said:
        *like below in /etc/nginx/sites-available/aventurismo.mx file:

        root /var/www/aventurismo.mx*;

        Do you mean the directory named root…?

        • Hey,

          root is not a directory in that context. :)

          Yes, you can change ownership of /etc/nginx/sites-available/aventurismo.mx file to jose:jose and check the functionality.

          Moreover, we do have nginx configuration tool which will help in generating the configuration file. I have customized it for you and here is the link.

          Customized Nginx configuration tool

          Let me know updating the configuration works for you!

          -Dikshith

          • @dikshith

            Still no joy.
            Changed ownership of /etc/nginx/sites-available/aventurismo.mx to jose:jose
            In a browser aventurismo.mx still shows the NginX welcome message. If I go to aventurismo.mx/index.html I get a discouraging 404 message.

            Then I downloaded the config file you sent, uploaded it to /etc/nginx and extrated it right there.
            Nothing.

            So I tried to restart nginx with this command: sudo service nginx restart
            Only to get the following:
            Job for nginx.service failed because the control process exited with error code. See “systemctl status nginx.service” and “journalctl -xe” for details.

            Ran systemctl status nginx.service without sudo, and got this:
            nginx.service - A high performance web server and reverse proxy server
            Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
            Active: failed (Result: exit-code) since Thu 2020-09-03 14:17:31 UTC; 18min ago
            Docs: man:nginx(8)
            Process: 24229 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code-exited, status=1/FAILURE)

            Then ran sudo systemctl status nginx.service and got the exact same first lines plus the next:

            Starting A high performance web server and reverse proxy server…
            nginx: [emerg] cannot load certificate “/etc/letsencrypt/live/aventurismo.mx/fullchain.pem”: BIOnewfile() failed (SSL: error:02001002: system library:fopen:No such file or directory:fopen(’/etc/letsencrypt/live/aventurismo.mx)
            nginx: configuration file /etc/enginx/enginx.conf test failed
            nginx.service: Control process exited, code=exited, status=1/FAILURE
            nginx.service: Failed with result ‘exit-code’.
            Failed to start A high performance web server and reverse proxy server.

            So I guess we’re getting somewhere…
            Warm regards.

Hi, @ppdigital59

Could you please let me know if you’ve also completed all the steps from the Prerequisites section - https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-20-04 as well?

If you try to load the index file in your browser do you get any error messages or the page is just not loading?

Regards,
Alex

by Brian Boucheron
When you first create a new Ubuntu 20.04 server, you should perform some important configuration steps as part of the basic setup. These steps will increase the security and usability of your server, and will give you a solid foundation for subsequent actions.

According to a comment in the very same tutorial I used, https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-ubuntu-20-04, after this step:
sudo ln -s /etc/nginx/sites-available/your_domain /etc/nginx/sites-enabled/
You absolutly have to run this:
sudo unlink /etc/nginx/sites-enabled/default

So now it’s working.

The tutorial should be updated.

Submit an Answer