LinuxQuestions.org
Visit Jeremy's Blog.
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 01-27-2012, 07:56 AM   #1
vexenda
LQ Newbie
 
Registered: Jan 2012
Posts: 7

Rep: Reputation: Disabled
Symlinked folders not working! Why?


Hello

I really don't know much about Linux, except that it is a pretty cool system, AND i'd probably install it as my OS for my next computer build...

At the moment the only experience i have is with my host accounts. One think i notice is the host is great at taking my money but does not offer any bug support or troubleshooting support for my website build. But that's understandable as life is like that.

My problem is this:

I am building a Drupal installation at my host server.

The server is this: Debian GNU/Linux ... i looked at the Debian website and it looks great.
For my Drupal install, i have chosen to symlink some folders.

The theory behind this is to softlink the folders, and the target folder will have all the files while the 'linked' folder will be empty. I thought the linked folder would automatically open the files within the 'target' folder no problem at all (once i open the index page in the browser).

But so far it looks like the softlinks i have created for the folders are not working like that at all.

I don't know why the empty 'linked' folder is not calling all the files within the 'target' folder.

I have done a search for a post here, and other forums and a problem like this is virtually non existent.

I'm a noob to symlinks in Linux, but i thought (in theory) this must be able to work as i had set out. I can't understand why it doesn't work.

The command line call i made to create the link looked like this:

ln -s /home/www/folder_a/folder_name_1/symlink_named_this /home/www/folder_b/folder_name_1

As i understand it, it is like this:

- ln is to create a symlink

- -s is a softlink (for folders)

- /folder_a ...path a, to target folder

- /folder_b ...path b, linked folder

- /folder_name_1 ...the folder(s) that are linked: ie, /folder_a/folder_name_1 is the target, and /folder_b/folder_name_1 is the linked folder

- 'symlink_named_this' ...this is the name of the symlink that i have created, it is about 4 Kb in size and visible in the /folder_b/folder_name_1 folder after i have created the link to the target folder. In other words, i can see it in the folder.

As is said, it all looks fine to me. I don't know why it is not working.

Can anyone help?
 
Old 01-27-2012, 07:58 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
What are the symptoms of "not working"?
 
1 members found this post helpful.
Old 01-27-2012, 10:07 AM   #3
vexenda
LQ Newbie
 
Registered: Jan 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
Hey, its great to get a reply so quick.

I've been trying to sort this problem for days, i looked an a .htaccess forum. I went to other linux forums. In fact i just have no idea of exactly what the problem is so for a start i don't know the right place to seek help. Thank you.

Quote:
What are the symptoms of "not working"?
Well, when i load the index page in the browser, i get an error.

The error is:

Quote:
Warning: require_once(./includes/bootstrap.inc) [function.require-once]: failed to open stream: No such file or directory in /home/www/site.com/folder/index.php on line 14

Fatal error: require_once() [function.require]: Failed opening required './includes/bootstrap.inc' (include_path='.:/usr/###/###/php') in /home/www/site.com/folder/index.php on line 14
If i click the [function.require] link to see what the error is doing i get this:

Quote:
Not Found

The requested URL /site.com/function.require-once was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Line 14 that is found in the index.php file is trying to call the bootstrap.inc file. Currently my site now has a folder that is empty, and the call to the bootstrap should go straight in to that folder (includes), then the symlink in that empty folder is (i thought) meant to transmit to the target folder (also includes) and automatically open bootstrap.inc. But it looks like that doesn't happen.

I have basically made the entire 'core' of the site located other that the original location, but i have duplicate folders (same names) that are empty, these empty folders are situated in the 'other' core, and are a standard tree construction for effective calling of target folders.

The target folders, are the same tree construct, but located elsewhere away from the emtpy folders, but have all the actual files within them.

I have altered the .htaccess to work with this setup, and i don't know the first thing about that code but i copied it from the directions of how to set this up, so i guessed i have it right.

A part of the .htaccess is this:

Code:
Not related, removed for security reasons.
I'm guessing the problem is either .htaccess, or server is not suitable for my setup, or i have to do another step in command line that i don't know about, or i have to create 'dummy' empty code files into the (currently) empty folder to create a 'on the fly' read write function.

I've got no idea. I'm baffled.
Can you please help?

Last edited by vexenda; 01-27-2012 at 02:52 PM.
 
Old 01-27-2012, 11:09 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Ah -- so we are n the world of PHP and Apache, not the command line or a graphical file manager.

Sorry -- I know nothing about PHP and only a little about Apache. Is Apache configured to follow symlinks? IIRC you need Options FollowSymlinks or Options All in the appropriate place.

You might get a solution faster if you start a new thread with PHP and Apache in the title and including the information in the last post.
 
1 members found this post helpful.
Old 01-27-2012, 11:27 AM   #5
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 243Reputation: 243Reputation: 243
What is the output with:
Code:
ls -l /home/www/site.com/folder/includes/bootstrap.inc
 
1 members found this post helpful.
Old 01-27-2012, 12:32 PM   #6
vexenda
LQ Newbie
 
Registered: Jan 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
Hello

I am very happy to be making progress. I've been filling the days mulling over this problem with not much insight on what even to put in the post for a forum. AND i didn't know WHICH forum to go to. Thank you for the direction catkin.

Quote:
Is Apache configured to follow symlinks? IIRC you need Options FollowSymlinks or Options All in the appropriate place.
Thank you catkin for your help. Yes, i have this code (following) in position - .htaccess as per Drupal manual.

Code:
Options +FollowSymLinks
I am not at all familiar with .htaccess, and i have no idea if i have it right... I appreciate your help.

Thank you Cedrik for your help. I have entered this to the command line:

Code:
ls -l /home/www/site.com/folder/includes(the empty one)/bootstrap.inc
I double checked my markup. I am sure i got it right.

The path was to the end folder that is empty, and is meant to link to the target that is full of all the files.

I received an error. It is this:

Quote:
Command 'ls -l /home/www/site.com/folder/includes(empty)/bootstrap.inc'
failed with return code 2 and error message
ls: cannot access /home/www/site.com/folder/includes(empty)/bootstrap.inc: No such file or directory.
Then i decided to check this:

Code:
ls -l /home/www/the_core(full folders)/includes/bootstrap.inc
I got this:

Quote:
/home/www/the_core/includes$ ls -l /home/www/the_core/includes/bootstrap.inc
-rw-r--r-- 1 xxxxx vusers xxx Jan xx xxxx /home/www/the_core/includes/bootstrap.inc
Thank you for your help. I will stay with this forum for some longer. I may get a result here. I may check in to a PHP / Apache forum later catkin, that is if i am out of luck here.

Fingers crossed.

Last edited by vexenda; 01-27-2012 at 12:37 PM.
 
Old 01-27-2012, 12:53 PM   #7
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 243Reputation: 243Reputation: 243
Maybe make symlink for your include files:
Code:
rmdir /home/www/site.com/folder/includes
ln -s /home/www/the_core/includes /home/www/site.com/folder
 
Old 01-27-2012, 01:16 PM   #8
vexenda
LQ Newbie
 
Registered: Jan 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
Hello Cedrik

That is not bad advice, however I don't fully understand.

The /folder directory contains not only folders, but also files such as index.php and other driving files.

If i do this:

Code:
ln -s /home/www/the_core/includes /home/www/site.com/folder
...then may i ask? What is likely to happen? How does that work?


Last edited by vexenda; 01-27-2012 at 01:32 PM.
 
Old 01-27-2012, 01:28 PM   #9
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 243Reputation: 243Reputation: 243
What problematic, the ln -s will create includes symlink in /home/www/site.com/folder

The files and dirs in /home/www/site.com/folder will not be touched

The /home/www/site.com/folder/includes/bootstrap.inc becomes accessible to PHP

No more No such file or directory error
 
Old 01-27-2012, 01:39 PM   #10
vexenda
LQ Newbie
 
Registered: Jan 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
OK, wow, i think i'm getting it...

You are saying that if i have /home/www/site.com/an_extra_folder_path_a/includes

...then i should mirror that tree folder by folder, by tree formation, such as:

... /home/www/site.com/an_extra_folder_target/includes

In other words, have a folder one for one, instead of say, 5 folders for path a, and only 4 folders for the target location...

Is that it?
 
Old 01-27-2012, 01:43 PM   #11
vexenda
LQ Newbie
 
Registered: Jan 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
What problematic, the ln -s will create includes symlink in /home/www/site.com/folder

The files and dirs in /home/www/site.com/folder will not be touched

The /home/www/site.com/folder/includes/bootstrap.inc becomes accessible to PHP

No more No such file or directory error
OK, will try this quick smart, can't wait, it makes total sense.

Ignore this:

Quote:
OK, wow, i think i'm getting it...

You are saying that if i have /home/www/site.com/an_extra_folder_path_a/includes

...then i should mirror that tree folder by folder, by tree formation, such as:

... /home/www/site.com/an_extra_folder_target/includes

In other words, have a folder one for one, instead of say, 5 folders for path a, and only 4 folders for the target location...

Is that it?
Thank you
 
Old 01-27-2012, 01:58 PM   #12
vexenda
LQ Newbie
 
Registered: Jan 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
You're Brilliant!!!`

Thank you!!!

I am so happy, it's an amazing feeling when a total stranger give you a hand. I'm blessed, and you're perfect.

I can't thank you enough.



Note: I tried to give you 224 smilies in thanks, but i got this:

Quote:
You have included 224 images in your message. You are limited to using 6 images so please go back and correct the problem and then continue again.
 
  


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
Debian Gnome 'Shared Folders' GUI not working getmizanur Linux - Newbie 2 03-26-2010 10:38 PM
Directory Mask is not properly working on samba shared folders Prabagaran Linux - Server 2 03-17-2009 08:38 AM
Bogus mailboxes when symlinked Hep Linux - Enterprise 2 07-04-2006 02:10 PM
Symlinked CGI scripts Chrax Linux - Networking 4 05-04-2005 09:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:06 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