LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 09-30-2009, 10:39 PM   #1
areopagus
LQ Newbie
 
Registered: Oct 2008
Posts: 1

Rep: Reputation: 0
Symbolic Linking and XAMPP


I just installed XAMPP. No problem. My problem starts when I try to follow everybody's advice and link the directory ~/public_html with /opt/lampp/htdocs/.

In several places I looked, the advice is to use:

ln -s ~/public_html/ /opt/lampp/htdocs/UserName

I can do this two ways:
1. Make a directory called /opt/lampp/htdocs/UserName, or
2. Not

1. If I first make the directory /opt/lampp/htdocs/UserName, then after running the command:
ln -s ~/public_html/ /opt/lampp/htdocs/UserName

I end up with opt/lampp/htdocs/UserName/public_html. If I then go to
localhost/UserName in the browser, I am taken to a directory of that folder with no files visible. Not even the link public_html. Creating the directory first seems to be the wrong way to create the link.


2. If I don't make the UserName directory first, I end up with a
/opt/lampp/htdocs/UserName directory as a proper link. If I place files in ~/public_html/, then they show up in the /opt/lampp/htdocs/UserNameWhen directory, as expected. When I go to localhost/UserName in my browser, I get an error message:

Access forbidden!

You don't have permission to access the requested object. It is either read-protected or not readable by the server.

If you think this is a server error, please contact the webmaster.
Error 403
localhost
Wed 30 Sep 2009 11:11:40 PM EDT
Apache/2.2.12 (Unix) DAV/2 mod_ssl/2.2.12 OpenSSL/0.9.8k PHP/5.3.0 mod_apreq2-20051231/2.6.0 mod_perl/2.0.4 Perl/v5.10.0

This is not a permissions problem. I changed owner and group for the entire /opt/lampp/htdocs/ directory.

I realize I can just shove all my files in /opt/lampp/htdocs/ or /opt/lampp/htdocs/SomeSubdirectory, but I would like to get to the bottom of this.

Any help would be appreciated.

================================================================================================
Update:

Originally, I thought this was a question about linking. It's not. It's strictly a XAMPP question, so maybe it doesn't belong on this forum at all. Basically, XAMPP will give the 403 error if I try to go to any subdirectory under /opt/lampp/htdocs/ other than the two that were there to start (webalizer and xampp). Again, it's not a permissions problem. I set the permissions to match the permissions of webalizer and xampp. I've looked all over the web and nobody seems to have run into this before. Lots of Linux howtos about how easy XAMPP is to use. Perhaps my computer is the only one on earth with this problem.

Last edited by areopagus; 10-01-2009 at 12:15 AM.
 
Old 10-01-2009, 12:20 AM   #2
kerrylinux
LQ Newbie
 
Registered: May 2009
Location: Co. Kerry, Ireland
Distribution: CentOS, Fedora, RedHat, Ubuntu Enterprise Cloud
Posts: 12

Rep: Reputation: Disabled
Hello,

method 2 is the only way you should (ever) create links. Remember the first parameter is the name of the object that already exists (the directory public_html) the second parameter is the new name for the first,
i.e another name for the same thing in a different place (the webserver's root directory).

Your access problem is a permission problem. By now you have proven that the webserver can see files in subdirectories of its root directory. The new links are such subdirectories but they don't reside inside the
webserver's root but in a user's homedirectory. That means you have to ensure that the webserver user has read access to the files in the user's public_html directory. Follow the tree right from / down to the public_html directory and check if the webserver process (user apache?) can enter every directory on the path and can read the files in public_html.
You might have to open a user's home directory for the apache user by allowing group access to the directory, to let apache in. If the user's home has permission drwx------ apache cannot
enter. Change it to drwx--x--- and give the home directory to the group apache.

I hope that helps you to get on track.

RON
 
Old 10-01-2009, 02:07 AM   #3
lutusp
Member
 
Registered: Sep 2009
Distribution: Fedora
Posts: 835

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by areopagus View Post

[ snip ]

Originally, I thought this was a question about linking. It's not. It's strictly a XAMPP question, so maybe it doesn't belong on this forum at all. Basically, XAMPP will give the 403 error if I try to go to any subdirectory under /opt/lampp/htdocs/ other than the two that were there to start (webalizer and xampp). Again, it's not a permissions problem. I set the permissions to match the permissions of webalizer and xampp. I've looked all over the web and nobody seems to have run into this before. Lots of Linux howtos about how easy XAMPP is to use. Perhaps my computer is the only one on earth with this problem.
No, the problem is that many servers refuse to follow symlinks - Apache won't unless you insist. You are better off creating an alias in the server's configuration file -- it's easier than creating symlinks:

Code:
Alias (virtual server directory name) (real path)
The above is Apache syntax, but something similar is probably available for XAMPP.

As to creating symlinks, a problem comes up if you create a symlink, then forget and create it again -- the second action will create a symlink in the directory path created by the first. To avoid this, always specify symlinks this way:

$ symlink -nsf (source) (destination)

This invocation forces removal of any original symlink before recreating it.
 
  


Reply



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
Symbolic linking and inode structure tintintin Linux - General 0 01-21-2008 04:32 PM
Java symbolic linking indienick Programming 3 05-29-2006 12:23 AM
Symbolic linking directories leecming Linux - General 1 06-08-2004 11:11 AM
symbolic linking directories? Possible? ajspliffs Linux - General 3 01-12-2004 11:55 AM
symbolic linking ???? salparadise Linux - Newbie 2 12-26-2002 12:01 PM

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

All times are GMT -5. The time now is 07:50 PM.

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
Open Source Consulting | Domain Registration