Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting up file server

Status
Not open for further replies.

felix001

Technical User
Nov 15, 2008
102
GB
My goal is to set up a http file server.
I have installed both httpd and php5 onto my redhat box.
I have obtained a free php script for the file browsing. The instructions are to put this into the file you wish to browse.
So ive put this in the top folder of my data folder.
I think im missing something else do i not need some kinda of index file in my /var/
Any help would be really appreciated.
 
Well, you will definitely need an index page, or setup your server to have some default page if no index exists. Beyond that, a further description would be necessary.

Scott Prelewicz
Web Developer
COMAND Solutions
 
Likely the PHP script has everything to create the interface.

However as suggested you'll likely need another file either html or PHP that calls this script.
Or you make the folder available to the web server, and then call it appropriately.

Something along the lines of:

server/path/to/folder/script.php

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Yep yor right, i need to call the script from my webserver.
So my question is how should the script look (index.html), i take it should be a index.html.
Within this the index it should point to ... /filefarm/filebrowser.php ..

Thanks for all your help....
 
Yes, that is one way to do it. You could have a link to the "File Boweser Application" from your index that points to /filefarm/filebrowser.php. Or, as suggested above, setup your webserver to look at /filefarm/filebrowser.php as your index.

Scott Prelewicz
Web Developer
COMAND Solutions
 
Would this work as my index.html

<html>
<head>
<!--#exec cgi="/DATA/browsefile.php"-->
</head>
</html>

or even creating a hard link to /DATA/browsefile.php ...
i was thinking maybe running the coommands ..
touch index.html
ln index.html /DATA/browsefile.php
 
No need for the exec CGI, just a regular link should work:

<a href="/path/to/folder/browsefile.php"> Click here to browse files</a>

Basically you need to make the browsefile.php be opened in the browser. Just as you would call index.html, you need to call browsefile.php from that location.




----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Ive created a hlink which tries to find the file, but it shows 404 and says the file isnt there ??

The error is ....
The requested URL /filefarm/filebrowser.php was not found on this server.
 
What is the url? You're link must not be correct.


Scott Prelewicz
Web Developer
COMAND Solutions
 
Is that folder accessible to the Web Server?

Most web servers have a predefined folder that they can read from to serve the web files. usually or public_html or Is the path for the PHP file inside this folder or somewhere else?

That is would the complete local path for the php file be something like:/webfolder/filefarm/filebrowser.php?

If not you;d need to modify your link so it can find the correct path.






----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Thanks for your help guys, your input helped alot.
In the end, i added soft links to all my directories in my data folder and also a link to the php script, but called the link index.php.

One small thing is that the script allows me to view the files, but how would i go about coding it so when i clicked on it , it downloads the file instead ??
 
Instead of what? Images normally will be opened in the browser.

Files the browser recognizes and knows what to do with will open in their associated applications or inside the Browser such as PDF's or Word documents etc...

The rest, will open the save as dialog and download.

Fr example having a link like

<a href="somefile.[red]zip[/red]">Zip File</a>

Will automatically prompt the download.

Having a link like:
<a href="somefile.[red]pdf[/red]">PDF File</a>

Will usually cause the browser to execute the Acrobat reader plug-in and open the file in the browser.




----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top