PDA

View Full Version : 2 Linux Questions about directorys apache sees



Clueless
25-09-2002, 07:37 PM
I'm clueless for a reason OK!?

What i want to do is set up a directory in Sam, my wonderful Linux box that makes a shared folder from another computer available to all via the web.
As it stands i have mounted the shared folder in Vanessa, a doze box, and that part works fine, i just have no idea how to make a shortcut to mnt/vanessa that apache would see.

Also i have noticed that in all the home directorys, there is a default directory called "public_html" How do i make the content of this directory available to apache, as directorys(s) in htdocs?

Linatux
26-09-2002, 07:56 AM
I'm guessing that vanessa has HTML documents you want apache to serve up. Apache's config file (/etc/apache/httpd.conf?) has a parameter called DocumentRoot - point that to the mount and Bob's your uncle.

As for the second question - sorry ... never come across that one.

Chris Wilson
26-09-2002, 10:57 AM
not that it matters for the moment...
there are issues thet have forced me to put sam offline

On the first one,
I wish to share one of Vanessas folders of certain artists demo songs and the likes through something like www.something.net.nz/randomletters, but NOT the whole site from Vannessa, the rest of something.net.nz would be firmly on Sams HDD.
I'll Have a poke round and see what i can do.

Running SuSE 8 there is a default directory created in /home with each new user being /home/ public_html
This directory is created with a small text document in it that says "directory" I assumed that this could somehow be linked into the webserver, simply because it seems so similar to what i see when FTPing to an external webserver. This is a facility i want to set up eventually from here.

Graham L
26-09-2002, 02:24 PM
The public_html is intended for individual web servers ... say you put a homepage "/home/chris/public_html/index.html", and then in an browser somewhere else on your network (or in a session on machine sam) entered the address "http://sam.chris_s.local.net/~chris/", that home page would come up. [I have invented the name of your local net, but you will get the idea]. There's probably (:D) some permissions setting needed ... but that's how it works. The Apache server need not serve only one "web site" ... it will spawn a process for any call, and if ther's a "site" at that address, it will send it out.

The files on vanessa can be accessed with "<A url=file:///mnt/vanessa/path_to_file/file_name.ext" ..."

It's all very logical and obvious in retrospect ;-)

Chris Wilson
26-09-2002, 09:39 PM
but of course it is Graham!!!!

ive decided to tempararally retire Sam, as i don't quite have the time to play, learn, and deal with the security issues etc, so i'll focus on other things and get back to it, thus being able to give the linux learning the focus it deserves.

.. but this is something i shall play with before Sam has a week off.


cheers,
Thanks for all your help
Chris

Chris Wilson
27-09-2002, 02:22 AM
Graham,
i just read the post you did, and have a further question;

Seeing Sam is "www.something.net.nz" does that mean that anything in the directory /home/chris/public_html can be automaticly be accessed at http://www.something.net.nz/~chris ??? (assuming the permissions are OK)

I spose i can try it and find out... sheesh it's easy enough.

I may as well have a play with the ftp progs, I'd like it so that users can modify the content of their websites, without emailing new content to me

Any recomendations?

Graham L
27-09-2002, 04:03 PM
Yes that's exactly how it works. (for the web access.).

Users would need to use ftp to load the files, and that might be a little bit trickier: normally, for security, the ftpd daemon allows access to a tree at /home/ftp/pub ...
I think the easiest way would be to put symbolic links there, so that ftp/pub/user1 points to /home/user1/public_html , etc.

Don't allow "anonymous ftp" unless you absolutely need it. Giving users user accounts, and putting these links in place would be the safest way.