Total noob on Nginx, however I managed to have my website running with these instructions:
How To Install Nginx on Ubuntu 22.04.
How To Host a Website Using Cloudflare and Nginx on Ubuntu 22.04.
Also followed the instructions how to install wordpress on this blog, but at the end, visiting https://geniusatwork.cf/wp-admin/install.php still throws the error:
404 Not Found nginx/1.18.0
I contacted wordpress to know what I was doing wrong, and they mentioned what I'm having is a server configuration issue instead of wordpress, so I think my questions are more suited for StackOverflow.
According to their answer, wherever the index file with the text displayed on my website is, that's the root location where I should have the wordpress files.
The text they're referring to can be seen on my domain and I got that after configuring server blocks, so I'm retrieving those from:
/var/www/geniusatwork.cf/html/index.html
From my details, seems I got the wordpress files on two different locations since I also followed these instructions from step #4 trying to resolve the issue:
var/www/wordpress# ls -l
total 212
-rw-r----- 1 www-data www-data 405 Feb 6 2020 index.php
-rw-r----- 1 www-data www-data 19915 Jan 1 2022 license.txt
-rw-r----- 1 www-data www-data 7401 Mar 22 2022 readme.html
-rw-r----- 1 www-data www-data 7165 Jan 21 2021 wp-activate.php
drwxr-x--- 9 www-data www-data 4096 Aug 30 17:40 wp-admin
-rw-r----- 1 www-data www-data 351 Feb 6 2020 wp-blog-header.php
-rw-r----- 1 www-data www-data 2338 Nov 9 2021 wp-comments-post.php
-rw-r----- 1 www-data www-data 3405 Sep 29 00:12 wp-config.php
drwxr-x--- 5 www-data www-data 4096 Sep 28 20:36 wp-content
-rw-r----- 1 www-data www-data 3943 Apr 28 09:49 wp-cron.php
drwxr-x--- 26 www-data www-data 12288 Aug 30 17:40 wp-includes
-rw-r----- 1 www-data www-data 2494 Mar 19 2022 wp-links-opml.php
-rw-r----- 1 www-data www-data 3973 Apr 12 01:47 wp-load.php
-rw-r----- 1 www-data www-data 48498 Apr 29 14:36 wp-login.php
-rw-r----- 1 www-data www-data 8577 Mar 22 2022 wp-mail.php
-rw-r----- 1 www-data www-data 23706 Apr 12 09:26 wp-settings.php
-rw-r----- 1 www-data www-data 32051 Apr 11 11:42 wp-signup.php
-rw-r----- 1 www-data www-data 4748 Apr 11 11:42 wp-trackback.php
-rw-r----- 1 www-data www-data 3236 Jun 8 2020 xmlrpc.php
And
/var/www/html/wordpress# ls -l
total 216
-rw-r----- 1 www-data www-data 405 Feb 6 2020 index.php
-rw-r----- 1 www-data www-data 19915 Jan 1 2022 license.txt
-rw-r----- 1 www-data www-data 7401 Mar 22 2022 readme.html
-rw-r----- 1 www-data www-data 7165 Jan 21 2021 wp-activate.php
drwxr-x--- 9 www-data www-data 4096 Aug 30 17:40 wp-admin
-rw-r----- 1 www-data www-data 351 Feb 6 2020 wp-blog-header.php
-rw-r----- 1 www-data www-data 2338 Nov 9 2021 wp-comments-post.php
-rw-r----- 1 www-data www-data 3001 Dec 14 2021 wp-config-sample.php
-rw-r----- 1 www-data www-data 3405 Sep 29 00:08 wp-config.php
drwxr-x--- 5 www-data www-data 4096 Sep 28 20:36 wp-content
-rw-r----- 1 www-data www-data 3943 Apr 28 09:49 wp-cron.php
drwxr-x--- 26 www-data www-data 12288 Aug 30 17:40 wp-includes
-rw-r----- 1 www-data www-data 2494 Mar 19 2022 wp-links-opml.php
-rw-r----- 1 www-data www-data 3973 Apr 12 01:47 wp-load.php
-rw-r----- 1 www-data www-data 48498 Apr 29 14:36 wp-login.php
-rw-r----- 1 www-data www-data 8577 Mar 22 2022 wp-mail.php
-rw-r----- 1 www-data www-data 23706 Apr 12 09:26 wp-settings.php
-rw-r----- 1 www-data www-data 32051 Apr 11 11:42 wp-signup.php
-rw-r----- 1 www-data www-data 4748 Apr 11 11:42 wp-trackback.php
-rw-r----- 1 www-data www-data 3236 Jun 8 2020 xmlrpc.php
On both paths I have the wordpress wp-config.php file configured with database, user, password and salt keys.
The path where I have installed my server blocks, and also where I have the index file being displayed on my domain shows this:
/var/www/geniusatwork.cf/html# ls -l
total 4
-rw-r--r-- 1 root root 159 Sep 28 18:43 index.html
From the wordpress answer, I understood that I need to move my wordpress files here, or edit my Nginx config for the domain to point the root to /var/www/wordpress, however since I followed two instructions, I'm not sure where exactly resides the wordpress root file, here:
/var/www/html/wordpress
or here:
/var/www/wordpress
so with that being said, would this command help to fix this?
sudo cp -a /var/www/wordpress/. /var/www/geniusatwork.cf/html/
Or do I need to install wordpress files in the server blocks folder and create a new wp-config.php file?
Is there any issue or conflict if I have two wordpress installations on different paths?
Not sure how to modify the Nginx file to point to the root wordpress file.
Any help with this is greatly appreciated.