Score:0

Trying to find the physical location of a localhost address

nl flag

A chap set up some files for me under localhost and I am trying to find out where they are exactly.

Ubuntu 18.4

By this I mean within Ubuntu /var/www/vhosts/mysite/ there is an external facing php file that calls the following ;

http://127.0.0.1:18080/verify/

I have checked under www but as far as I can see it is not there so I cannot work out where this is going and what it does.

I know how to do this on Windows IIS but can't work it out on Ubuntu. Thanks

Frittierapparat avatar
us flag
It seems like it should be in the root or home directory
Score:0
cn flag

You already refered to Windows IIS. As this wouldn't be question about Windows (the operating system), but about the webserver IIS, in this case this isn't a question about Ubuntu (the operating system), but a question about whichever webserver you're using. This might be Apache HTTPd, it might be NGINX or something else.

It looks like whatever delivers the files is running on Port 18080. This isn't exactly a standard port for "general" webservers, so I'd assume it isn't just a run-of-the-mill Apache, NGINX or similar.

If you don't already know what software is serving the files, you could look what's listening on that port with netstat or similar tools, for example

netstat -tunlp

This should give you a list of lines like like

tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      1095/systemd-resolv 

Look for the line that has something similar to 127.0.0.1:18080 as the local address. The last field of the line gives you the process id and the program name, in the example above 1095/systemd-resolv.

From that, you'll probably be able to determine where the configuration files for whatever software it is should be. Those configuration files should contain information about where the files the software serves are located. There are exceptions where there are no config files and/or the config files won't help you, but it's worth a shot in most cases.

Score:0
in flag

This URL is probably not associated with your webserver, but is a separate service.

As root, run the command sudo lsof -i:18080 -sTCP:LISTEN to find out what is listening on that port. (The second column is a process id that you can then use ps to examine.)

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.