Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help to configure the "UserDir" on my Apache server?

Status
Not open for further replies.

Gunnien

Technical User
Oct 29, 2003
32
NO
Hello

I am totaly green on this matter, I just wantet to learn moore about php-programming and I therefore have sat up an apache server on my laptop.

The machine runs on W2k, and I have been able to make the apace to run, i am able to reach the startpage from the command line by using " so i am on the right track.

But now I am trying to make me an userlibrary, and i have created the directory:

C:\DATA\My Website

The "my documents" folder also is redirected to c:\data.

In that i have put a folder called "gunnien" that contains my wevside. This one I want to reach by using this address in my browser:


but now I just gets this errormessage:


Not Found

The requested URL /~gunnien was not found on this server.
Apache/2.0.43 Server at localhost Port 80

And here is my configurationfile:

# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received. Be especially careful to use
# proper, forward slashes here.
#
UserDir "My Documents/My Website"
UserDir "My Website"

#
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
#
# You must correct the path for the root to match your system's configured
# user directory location, e.g. "C:/WinNT/profiles/*/My Documents/My Website"
# or whichever, as appropriate.
#
#<Directory "C:/Documents and Settings/*/My Documents/My Website">
# AllowOverride FileInfo AuthConfig Limit
# Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
# <Limit GET POST OPTIONS PROPFIND>
# Order allow,deny
# Allow from all
# </Limit>
# <LimitExcept GET POST OPTIONS PROPFIND>
# Order deny,allow
# Deny from all
# </LimitExcept>
#</Directory>
<Directory "C:/DATA/My Website">
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS PROPFIND>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>

I have tryed to use both C:/documents and setting.... and C:/data.... but the result was the same with both.

Anyone out there who can give me a step by step description of how to configure the server to let me access my userdirectory?

Gunnien
 
You would be making life a lot more complicated than it really needs to be. Let me suggest something else and see if you like it better. If not let me know and we'll do it your way. First, create a directory where you want you webpages to go. I like to keep these close to the root directory on the drive so the path is shorter. I type with two fingers. :) For example c:/gunnien/htdocs. You could also create a cgi-bin while you are at it: c:/gunnien/cgi-bin. Now let's configure apache. Open httpd.conf and look for the directive "DocumentRoot". You would edit it to look like this:
Code:
DocumentrRoot "c:/gunnein/htdocs"

Now look for a directive "ScriptAlias" and edit it like this:
Code:
ScripAlias /cgi-bin/ "c:/gunnien/cgi-bin/"

<Directory "c:/gunnien/cgi-bin">
    AllowOverride None
    Options All
    Order allow,deny
    Allow from all
</Directory>

Now for the library, You would still use My Documments directory but you would Alias it. That is done like this:
Code:
Alias /library/  "c:/path/to/my documents/"

<Directory "c:/path/to/my documents">
    AllowOverride None
    Options All
    Order allow,deny
    Allow from all
</Directory>

Now when you want to access the website, you would type " And to access the library directory, you would use " If you don't want to use localhost to access your website, you would change the ServerName from localhost to:

ServerName gunnien

You can also access it using the host name (machine name).
 
Hi RhythmAce,

Thanks for a quick answer, but I am a litle afraid that I have to figure out how to go the hard way.

After that I have installed the server and php source my son also found out that he wanted to learn to use php and we therefore are two persons to use the same computer. I therefore want to be able to have separate user-accounts to keep our work separated.

And when we have learned enough we can set up our own webserver as well.

But first I have to find out how to set up the user directory on the local server.

Anuone out there who can give me a hint of what I am doing wrong?

Gunnien
 
Hello again,

After a couple of tests I managed to get the server to work as I wanted.

In the end the config file looks like this:

#
# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received. Be especially careful to use
# proper, forward slashes here.
#
UserDir "c:/data/my website"

#
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
#
# You must correct the path for the root to match your system's configured
# user directory location, e.g. "C:/WinNT/profiles/*/My Documents/My Website"
# or whichever, as appropriate.
#
<Directory "C:/DATA/my website">
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS PROPFIND>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>

And it works like a dream.

Gunnien :)
 
Hey what happened to my post? I had a long drawn out thing that was supposed to answer all your questions. Anyway I find it hard to believe that it's working like a dream. How can it tell your site from your son's? Don't you need the wildcard in the path? You also don't need all those limit doodads since only two of you have access to this machine. I wouldn't bother with authentication either since both of you will be able to read the password file. Anyways, I better hit the submit button before I forget again. It's the pits gettin' old. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top