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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DocumentRoot: Network Drive

Status
Not open for further replies.

treehugga

Technical User
Jul 30, 2002
3
US
Hi, I'm running Windows XP Home and have mapped a folder on one computer on my network as a drive on the computer running apache. In httpd.conf I made listed the drive as DocumentRoot, however everytime i try to access the site i get an error 404. Can someone help me out?
Mike
 
Did you map a drive letter or the machine name in your path? And is it not accessible from all PCs on your network, or all but the server itself? Please post the actual syntax of the path you used. Newposter
"Good judgment comes from experience. Experience comes from bad judgment."
 
I'm pretty sure I mapped a drive letter in the path. This is the DocumentRoot syntax in httpd.conf:
DocumentRoot "Z:/"
The document root directory information starts with this:
<Directory &quot;Z:/&quot;>

Z: is the mapped drive on the machine running apache, it connects to the directory C:/nepeaks on another computer on the network.
Mike
 
Don't know if this is related, but I leave off the trailing / in my paths. You might try removing it and restarting Apache.

Also, is the Z: drive mapped to the same directory (C:/nepeaks) on all machines? If not, it won't work when you browse from those other machines. It might be better to use the actual machine name rather than a mapped letter for the drive (e.g., //server1/nepeaks). Newposter
&quot;Good judgment comes from experience. Experience comes from bad judgment.&quot;
 
Hey....I tried removing the trailing slash, mapping the Z: drive to C:\nepeaks on the machine i was trying to browse to the server on, and i tried using the actual machine name, all to no avail.

Mike
 
Treehugger,

I have the same problem with Apache 2. When the documentroot is pointed to a shared drive, Apache won't display the contents of the shared drive.

In my opinion, this mean that Apache does not have the sufficient user rights to access the network share. Unfortunately, I can't see anyway of giving Apache the rights, since there is no user in the 'UserManagement' snap-in associated with Apache. (i.e. There is not an IUSR_Machine_Name user that IIS would create).

If there are any Win32 Apache expert out there, please help us, because there are a lot of posts on this forum regarding this issue!

Any help would be much appreciated!
Thanks in advance,

James.
 
you have to set the Apache service to interact with the desktop, the network share is a user level share, not a system level share, click Start, Programs, Administrative Tools, Services
click Apache, then click Stop, right click Apache, click the Log On tab, then click allow this service to interact with the desktop, make sure it's checked, click ok
Click Apache, click Start, voila :)
 
I'm running XP Pro with Apache 2.0.43 and have tried all of the above to get my mapped drives working, still no luck. I had to enter the network drive name in the httpd.conf file as listed below. I have tried mapping the drive letter as it is mapped in windows, but it never worked. Every time apache was looking for some subdirectory of of the apache root drive.

After I got the drive mapping working, I could not open any files or subdirectories. I had to enter the trailing /


This got everything working for me ------>


Alias /icons/ &quot;C:/Program Files/Apache Group/Apache2/icons/&quot;
Alias /archive/ &quot;\\\Spanky\6meg_e (e)\appz4burnin\&quot; /



<Directory &quot;C:/Program Files/Apache Group/Apache2/icons&quot;>
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

<Directory &quot;\\\Spanky\6meg_e (e)\appz4burnin&quot;>
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
 
I have tried aliasing both ways (aliasing a mapped drive and alliasing a network location). The former gives me a not found error, while the latter says i dont have permission to access the location.

I am running 1.3.27. On a side note, i *was* running 2.0.43 and tried to do the same thing, and I came accross this thread. However, upon following the advice of GouRou, it completely stopped working, so i had to downgrade. Oh well.

my alias coding looks like this:
====================================================
Alias /junk/ &quot;D:/downloads/&quot;

<Directory &quot;D:/downloads&quot;>
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>


Alias /movies2/ &quot;\\ANUJ\Entertainment\movies\&quot;

<Directory &quot;\\ANUJ\Entertainment\movies&quot;>
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
==================================================
<-- see for youself

Please help!
 
I too have the same problem as thebull05.

I get forbidden also.

I really need to use this also for my site :(

Anyone who has a definite solution I would really like to hear it. The one above did not seem to work (the one by coperhead555)
 
GouRou was pretty much right...

What I was trying to do was (I think) the same as you,
basically, getting Apache to start with the documentroot set to a network drive's directory. Since i develop the site on a network machine, and not on my local hard drive.

First off, obviously you need permission to access that network drive - how ever you do it, be it, by logging on to windows using network authentication, etc.

BTW, I'm running Apache 2.0.44 on WinXP SP1

Basically, go to Control Panel -> Administrative Tools -> Services -> Apache

Open it up, and select the Log On tab. Under that, instead of the normal 'Local System Account', select 'This account'
and from here, enter your username (ON THE NETWORK), and pasword.
e.g. Network-Name\username
(click browse to make sure you got it right)

Click ok.

Now apache has permission to access the network using your login details.

Open the httpd.conf and set the following under the appropriate places: -

DocumentRoot &quot;//networkComputer/Directory/To/Website&quot;

<Directory &quot;//networkComputer/Directory/To/Website&quot;>


And that's it!

NOW, restart / start your Apache server (I use the apache service monitor).

If it has successfully started, you're done.
Now go to a web browser (like mozilla) and enter the name of your computer where apache is running
e.g.

If it was unsuccessful, you need to first make sure you actually have rights to that network space.
So go to Explorer and Map whatever Drive to //networkComputer/Directory/To/Website
And click 'connect using a different username' to check how you are gaining access to the network (if you don't already know).

If you can map the drive, you can get apache to work using the network drive as the root of where your website files are.


Let me know how you get on.
 
Hey guys. I don't know if you eventually solved this - but after spending a week trawling the net I finally got this to work.

1. I got rid of my mapped drives from explorer
2. I set the apache process to run as the .\Administrator user - my PC's are on a workgroup, not a domain
3. I used the following code in httpd.conf

<Directory "//192.168.0.10/apps">
Options Indexes FollowSymLinks MultiViews Includes
IndexOptions FancyIndexing NameWidth=*
Order allow,deny
Allow from all
</Directory>

Alias /apps/ "//192.168.0.10/apps/"

192.168.0.10 is the IP address of the computer that has a shared folder called apps that i wanted to alias as /apps. Both PC's involved are running Windows XP SP2

Good luck!

Rgds,
Jon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top