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?

4
  • 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
    Commented Jan 30, 2022 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
    Commented Jan 30, 2022 at 18:43
  • 1
    Try sudo nginx -T | grep root.
    – Paul
    Commented Jan 30, 2022 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. Commented Jan 31, 2022 at 15:47

1 Answer 1

-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.

3
  • 1
    It has already been established in the comments that apache2 is not even used. Commented Jan 31, 2022 at 6: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/ . Commented Jan 31, 2022 at 8: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
    Commented Jan 31, 2022 at 8:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .