LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-30-2008, 12:00 AM   #1
yersin
LQ Newbie
 
Registered: Mar 2008
Posts: 4

Rep: Reputation: 0
Redirect a folder to another so I can access files


Hi.

I'm using Linux (Sme server) as a web server. By default, Sme server create s three folders for each site, and index.php and the other files and folders are inside the html folder, like this:

cgi-bin
files folder 1
html
-files folder 2
-...
-index.php

When I upload files through the website (using drupal 5.2), they get into the files folder 2, which is ok, however, when I try to download the uploaded files, I get an error, because the files are looked for in the files folder 1 outside folder html; however, if I copy the uploaded files from 2 to 1, I can download normally.

I think the problem occurs because files are looked into nameofwebsite.com/files, and thus files folder 1.

So, how can I have a folder redirected to another? Is there a way to create something like a link so that when files are looked for in folder 1, files from the folder 2 are taken?
 
Old 03-30-2008, 03:04 AM   #2
esaym
Member
 
Registered: Nov 2006
Distribution: Lots of Debian
Posts: 165

Rep: Reputation: 32
sounds like a drupal problem to me

but you might just be able to use a symbolic link:

ln -s /directory/source /directory/target

If I understand correctly you have 4 folders under each website directory?

So an example should be something like

ln -s /home/website/folder2 /home/website/folder1/folder2

Then folder1 will have a "shortcut" to folder2 in it.
 
Old 03-30-2008, 08:39 PM   #3
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: KirraMail Live Email Server
Posts: 1,285

Rep: Reputation: 61
It could also be the apache httpd.conf file for the webserver is not let you go out the root directory, or follow symlinks. If there is no entry in the httpd.conf file for folder 1 it wont let you in there as well, could you post the contents of the https.conf for us too see, this will make it a bit easier to help trouble shoot.
 
Old 03-31-2008, 12:31 AM   #4
yersin
LQ Newbie
 
Registered: Mar 2008
Posts: 4

Original Poster
Rep: Reputation: 0
kind of solved

Thanks for answering.

First, I haven't been able to create a symbolic link. Being in root, I tried:

#ln -s ./html/files files

That created a link inside the existing folder (1) targeting at the files folder (2) inside html. It didn't solved the problem. It seems that I can't create a link named files if there's already a folder with that name. It looke like: root/files/files, and it can't be accessed. Then, I deleted the files folder 1 and the link just created, and I tried again:

#ln -s ./html/files files

Apparently it did it. It takes me to folder 2. However, when I try to download files, I get a "403 Forbidden error", although before I was able to access to files outside html. Besides, if I had just deleted the files folder 1, (without making the link), I would've gotten the same error. Apparently, without the files folder 1, files folder 2 is looked for.

Next, I created another folder inside html and named it "uploaded", and configured drupal to upload files into this folder. That did it. It seems that drupal got confused with files folder 1, because SME server by default takes root/files to the folder outside html. I hope I won't have more problems; otherwise, I'll come back.

So far I know, I can't change conf files manually with Smer server.

Yersin.

Last edited by yersin; 03-31-2008 at 12:37 AM. Reason: update
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Squid Redirect to welcome page on first internet access omid1979 Linux - Networking 3 10-15-2009 03:48 AM
Cannot redirect files from egrep... Robhogg Linux - General 2 08-18-2007 03:58 PM
How to automatically move files from one folder into another folder? xmrkite Linux - Software 6 11-05-2006 11:39 AM
Folder Max Size and Limiting SSH access to home folder. Mefistofeles Linux - General 4 11-26-2005 03:09 PM
Redirect print output to a folder instead of printer? xmdms Linux - Enterprise 1 07-31-2004 11:11 PM


All times are GMT -5. The time now is 02:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration