Web Hosting Talk







View Full Version : Server Configuration Question


blackcat
12-12-2003, 10:06 PM
Hey everybody, I have a server configuration question:

If any of you have your own server then you know that in an html file accessing <a href="/file"> would try to access server/file. Even if the call was in the links folder, so if it was <a href="file"> it might try to access server/links/file.

My problem is setting this up for multiple users on one server, so if someone has an account named "user", them typing <a href="/file"> would access ~user/file, where if it were typed <a href="file"> it would've accessed ~user/links/file.

Do you know how to properly set up a server to have guest accounts work in this manner? If any of you have an answer, I would appreciate it a lot. Thanks.

EDIT: I'm running apache on linux

chuckt101
12-13-2003, 03:33 PM
ok I think you have no clue how paths work in general...

"/" refers to dropping down to the document root, i.e. the farthest down the webserver is allowed to see.

(the way you're stating it) All you have to do is setup ~user/ as your DocumentRoot for apache.

accessing "file" alone will access the filename "file" in your current directory.

You can do some tricks with .htaccess to change that, but you need to at least understand what the difference between "/file" and "file" is first.

I apologize if I misread your post.

RSanders
12-13-2003, 05:21 PM
I had a dificult time understanding what he said too, so I didn't reply. But what aragon said is correct.

Maybe post a snipplet of your config and what your trying to do?

blackcat
12-14-2003, 01:43 AM
Damn. I knew I explained that badly. I'll have another go at it, as the second times seems to clue people in.

When I, in the main localhost/hey/ directory, type "/file" it accesses "localhost/file". When a user types "/file" it also accesses "localhost/file". I want it to go to "localhost/~user/file". Or if I have a user called Joe, and he types "/file" I want it to go to "localhost/~joe/file".

I do understand the difference between "/file" and "file", I just explained myself increadibly badly.

Is there any preticular part of the httpd.conf file you want to see, or should I just post the whole-thing online?

blackcat
12-17-2003, 09:56 PM
*bump* Please help....

chuckt101
12-17-2003, 10:34 PM
how are you differentiating between users? What tells the web server which user to pull files from?

When a user types "/file" it also accesses "localhost/file". I want it to go to "localhost/~user/file". Or if I have a user called Joe, and he types "/file" I want it to go to "localhost/~joe/file".

chuckt101
12-17-2003, 10:37 PM
You have to tell APACHE which user's files you are requesting, hence the customary "~user" that specifies you want files from that user's directory.

Otherwise, it uses the default path specified by DocumentRoot to find the file.

blackcat
12-31-2003, 02:05 AM
There is a users folder on the server. In that each user has their own folder. So localhost\~joe\index would actually access localhost\users\joe\index.