LEMP Troubleshooting --- Linux Level 4

Hello, regarding the lemp troubleshooting from linux level 4. What`s the issue with this lab ?
So I get the site working by App is able to connect to the database using user kodekloud_top
Then I get an error for some server 2 when I do the checking ?
— the rights for /var/www/html are 755 as for the index.html is 644 on all servers, seems right to me.

As far as I remember, for the first app server, the nginx is running on 8084 port , not as requested ( also missing the index.php from the config )
As for the 3rd server the problem its the root folder ( again not /var/www/html/ ) Whats the issue ? If so can someone please let me know the exact steps ? I`m done wasting 4h for this bs

[root@stapp02 ~]# curl https://80-port-8dea43ce94a04378.labs.kodekloud.com/
App is able to connect to the database using user kodekloud_top[root@stapp02 ~]# curl https://80-port-8dea43ce94a04378.labs.kodekloud.com/
App is able to connect to the database using user kodekloud_top[root@stapp02 ~]# curl https://80-port-8dea43ce94a04378.labs.kodekloud.com/

404 Not Found

404 Not Found


nginx/1.14.1 [root@stapp02 ~]# curl https://80-port-8dea43ce94a04378.labs.kodekloud.com/ App is able to connect to the database using user kodekloud_top[root@stapp02 ~]#

Getting 3 different types :smiley:

[root@stapp01 ~]# systemctl restart nginx
[root@stapp01 ~]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
[root@stapp01 ~]# curl https://80-port-af98e798993442cf.labs.kodekloud.com/
App is able to connect to the database using user kodekloud_pop[root@stapp01 ~]# curl https://80-port-af98e798993442cf.labs.kodekloud.com/

404 Not Found

404 Not Found


nginx/1.14.1 [root@stapp01 ~]# cat /var/log/nginx/ access.log error.log [root@stapp01 ~]# cat /var/log/nginx/error.log [root@stapp01 ~]# curl https://80-port-af98e798993442cf.labs.kodekloud.com/ Test Page for the Nginx HTTP Server on Red Hat Enterprise Linux /*<![CDATA[*/ body { background-color: #fff; color: #000; font-size: 0.9em; font-family: sans-serif,helvetica; margin: 0; padding: 0; } :link { color: #c00; } :visited { color: #c00; } a:hover { color: #f50; } h1 { text-align: center; margin: 0; padding: 0.6em 2em 0.4em; background-color: #900; color: #fff; font-weight: normal; font-size: 1.75em; border-bottom: 2px solid #000; } h1 strong { font-weight: bold; font-size: 1.5em; } h2 { text-align: center; background-color: #900; font-size: 1.1em; font-weight: bold; color: #fff; margin: 0; padding: 0.5em; border-bottom: 2px solid #000; } hr { display: none; } .content { padding: 1em 5em; } .alert { border: 2px solid #000; }
        img {
            border: 2px solid #fff;
            padding: 2px;
            margin: 2px;
        }
        a:hover img {
            border: 2px solid #294172;
        }
        .logos {
            margin: 1em;
            text-align: center;
        }
        /*]]>*/
    </style>
</head>

<body>
    <h1>Welcome to <strong>nginx</strong> on Red Hat Enterprise Linux!</h1>

    <div class="content">
        <p>This page is used to test the proper operation of the
        <strong>nginx</strong> HTTP server after it has been
        installed. If you can read this page, it means that the
        web server installed at this site is working
        properly.</p>

        <div class="alert">
            <h2>Website Administrator</h2>
            <div class="content">
                <p>This is the default <tt>index.html</tt> page that
                is distributed with <strong>nginx</strong> on
                Red Hat Enterprise Linux.  It is located in
                <tt>/usr/share/nginx/html</tt>.</p>

                <p>You should now put your content in a location of
                your choice and edit the <tt>root</tt> configuration
                directive in the <strong>nginx</strong>
                configuration file
                <tt>/etc/nginx/nginx.conf</tt>.</p>

                <p>For information on Red Hat Enterprise Linux, please visit the <a href="http://www.redhat.com/">Red Hat, Inc. website</a>. The documentation for Red Hat Enterprise Linux is <a href="http://www.redhat.com/docs/manuals/enterprise/">available on the Red Hat, Inc. website</a>.</p>

            </div>
        </div>

        <div class="logos">
            <a href="http://nginx.net/"><img
                src="nginx-logo.png" 
                alt="[ Powered by nginx ]"
                width="121" height="32" /></a>
            <a href="http://www.redhat.com/"><img
                src="poweredby.png"
                alt="[ Powered by Red Hat Enterprise Linux ]"
                width="88" height="31" /></a>
        </div>
    </div>
</body>
[root@stapp01 ~]# curl https://80-port-af98e798993442cf.labs.kodekloud.com/ App is able to connect to the database using user kodekloud_pop[root@stapp01 ~]# curl https://80-port-afat /var/log/nginx/error.log [root@stapp01 ~]# cat /var/log/nginx/error.log [root@stapp01 ~]# curl https://80-port-af98e798993442cf.labs.kodekloud.com/ 404 Not Found

404 Not Found


nginx/1.14.1 [root@stapp01 ~]# cat /var/log/nginx/error.log [root@stapp01 ~]#

Hi @rbscthdr

Some tips to achieve this task :

  • Use curl localhost instead of curl <LBR_LINK> inside the app server to be certain you debug the nginx installed on the server not the LBR.
  • Compare nginx.conf with the one that works fine on other servers and try to see what’s happen
  • The issue is not on the permission :slight_smile:

Goods luck

2 Likes

Manage to finish this, to be honest I still dont know what its the issue with the nginx.conf from the app server 2, even tried some text comparasion … but when copied the nginx.conf from the server 1 it worked… Do you mind to explain what`s wrong ? …

1 Like

Hi

The error is on the error.log :slight_smile:

2 Likes

Thank you very much ! How can I tip this gentlemen Kodekloud ? Better keep him happy :slight_smile:

1 Like

I found this one from 1 of conf, hope it help
fastcgi_pass unix:/var/opt/remi/php74/run/php-fpm/www;

fastcgi_pass unix:/var/opt/remi/php74/run/php-fpm/www.sock;

2 Likes

This is the right solution. Thank you so much.

so the general idea from troubleshooting is that instead of jumping around checking everything - its better to look for the logs?