0

Currently, there are gigabytes of images stored on a server that I can access using username@serverip. It is not my server, but I have access to it. Using cd Storage followed by ls -l shows all the files that I would like to be able to be accessible to anyone who visits the actual website. However, all of those files, while they are on the server, are not visible on the website and I was wondering how I could go about doing that. Is there a way to make the files on the server be visible on the website as well?

Ser Loras
  • 41
  • 1
  • 6
  • 2
    You have not given enough information to answer your question. There are all different types of web servers and how files are made publicly visible for a website differs greatly. – daddygames May 06 '21 at 19:17

1 Answers1

0

Are these images? Or just assorted files?

In either case, and without knowing what your actual implementation of the website, generally all webservers have a static resources folder.

In this folder you would put things like your general website images, like favicon, etc.

Put all that stuff in there. Or configure the webserver to use the existing one as such. This is not necessarily best practice though as all of those items would be exposed (potentially) without authentication.

Vizzyy
  • 522
  • 3
  • 11
  • Where can I find this static resources folder? Oh and they're just images that we ideally want to put on the website so people can freely view as well as download them if they so choose that! – Ser Loras May 06 '21 at 19:39
  • Like the other comment has stated: we don't know _anything_ about your server/webserver implementation. We cannot give you any specific help without more information from your end. – Vizzyy May 06 '21 at 19:44
  • @Vizzyy Do you know what folder the website is delivered from? index.html, CSS files, JS files, logos and other images that show on the site? – daddygames May 06 '21 at 19:48
  • Is there a way to find that because clearly I'm quite new to this lol – Ser Loras May 06 '21 at 19:59
  • `curl -I duckduckgo.com` a linux/mac command like this might work to display the headers. otherwise open your browser, open the developer tab (right click on anything on the page and click inspect), go to network tab, refresh your website, check the headers on the main request. In there you'll find an attribute "Server" , share that value – Vizzyy May 06 '21 at 20:04
  • nginx/1.18.0 is what I see! Is that helpful at all? – Ser Loras May 06 '21 at 20:31
  • yes, that's exactly what we're looking for. https://www.freecodecamp.org/news/the-nginx-handbook/#how-to-serve-static-content-using-nginx note that you'll already have something set up for the root, but this is the directory that you would either add your files into, or setup a second root for static files specifially regarding all the pictures you want https://stackoverflow.com/a/11573880/6506539 – Vizzyy May 06 '21 at 20:42
  • So I tried following the steps you provided in the first link and upon reaching this part: sudo git clone https://github.com/fhsinchy/nginx-handbook-projects.git it required me to enter a password, which is not the same password as the one that I use to log in initially using ssh, so I'm not sure what the password is supposed to be. – Ser Loras May 10 '21 at 19:21
  • that's a password for Github. You shouldn't really need to pull down that git repo though. Just follow the instructions. – Vizzyy May 10 '21 at 20:58
  • But that's the next step in the link you sent. Where should I start from then? – Ser Loras May 11 '21 at 17:41
  • Should I start from the "Now that you have the static content to be served, update your configuration as follows:" part because prior to that is the github portion. – Ser Loras May 11 '21 at 17:41