0

So someone gave me the task to find where is the website code exist on ubuntu server when I look at the the index.html file path it is /var/www/example.com/html

but when I go to /var/www directory I am not able to find example.com folder. Can anyone help In this regard or where to find the website code?

adnan ijaz
  • 1
  • 1
  • 1
  • 1
    Check the server configuration. Is Apache running, or Nginx? `ps aux | grep apache` or `ps aux | grep nginx`... from there go into /etc/nginx or /etc/apache2/conf.d/sites-enabled/ and look at the config files. – David W Jan 30 '22 at 18:35
  • it is nginx and in /etc/nginx/conf.d/default.conf I found the path to be /var/www/example.com/html where (example.com just for reference) but when I go to the /var/www directory I do not find any folder with .com or the specified folder. – adnan ijaz Jan 30 '22 at 18:43
  • 1
    Try `sudo nginx -T | grep root`. – Paul Jan 30 '22 at 18:55
  • 1
    If nginx is a reverse proxy for a backend application, then you need to check that application's configuration. You can search for `proxy_pass` in nginx configuration to check for reverse proxy configuration. – Tero Kilkanen Jan 31 '22 at 15:47

1 Answers1

-2

cd /etc/apache2/sites-available folder and check DocumentRoot on default.conf file . if you are not using default.conf then check other file which is available on /etc/apache2/sites-available folder.

  • 1
    It has already been established in the comments that apache2 is not even used. – Gerald Schneider Jan 31 '22 at 06:45
  • ok..I didn't seen the comment. But on nginx you have to follow same procedure.. you need to check any other conf file except default.conf in path /etc/nginx/conf.d/ . – Bibhuti Singh Jan 31 '22 at 08:26
  • I have checked all the conf files but the target specified in them does not exists the web is a next.js app and is running with pm2, is it possible that the example.com folder does not exist and the app is running on cache? – adnan ijaz Jan 31 '22 at 08:54