logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Allow apache to get content from internal network path, how?
Author
dke



Joined: 13 Jul 2007
Posts: 61
Location: sweden

PostPosted: Tue 12 Aug '08 12:04    Post subject: Allow apache to get content from internal network path, how? Reply with quote

Hi,

I'm trying to setup so apache can access stuff from other machines in my internal network, but i can't figure out how to do it

It would could look something like this, but it aint working!

Alias /network_content "\\server\h$\apache_stuff\"

<Directory "\\server\h$\apache_stuff">
Options FollowSymlinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>

the above code does not work, im just trying to show what im trying to do.

thanks for the help!
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Tue 12 Aug '08 16:07    Post subject: Reply with quote

Apache needs to run as a user.
That user has to have access to the share.

see
http://httpd.apache.org/docs/2.2/platform/windows.html#winsvc
midway down the page
"Never grant any network privileges to the..."
Back to top
dke



Joined: 13 Jul 2007
Posts: 61
Location: sweden

PostPosted: Tue 12 Aug '08 17:01    Post subject: Reply with quote

Thanks, i've succesfully mounted a share now, but im still encountering a really strange problem when i try to run apache as a service.

When i run apache as a service no matter what user account i use i will get error 1 (which means it does not have privileges to access the network share)

But if i do start>run cmd

go to c:/program files/apache group/apache2/bin and type "httpd" in the dos-promt, apache will run with privileges to that share. Even if i use the same account as apache will use when i do the dos-promt thing i still don't get privileges through the service.

Whats up with that?
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Tue 12 Aug '08 20:00    Post subject: Reply with quote

I should have asked first .. if this is XP home, then it is tough. You pretty much have to run as an Administrator which is not advisable.

XP Pro however has permissions you can customize. It's a little tricky and a bit time consuming but you have drive/folder/file permission in Pro that can be manipulated.

I cannot seem to deny Apache access to anything, I just do not necessarily give it permissions to things. I have apache on a second hard drive and apache has no rights to the C drive but listing folder contents so it cannot read or write to the system.
Back to top
dke



Joined: 13 Jul 2007
Posts: 61
Location: sweden

PostPosted: Wed 13 Aug '08 9:20    Post subject: Reply with quote

i actually got it to work, it seems like apache does not like mounted pathes like "z:/mappeddrive" however when i configure apache to map the drives through //server/sharedfolder/ it works fine (premission wise to)

actually aliasing the mapped drive seemed to lead to some sort of php memory leak aswell, php ran out of memory really fast and was not dumping anything.

well all is fixed now, thank you for the help!
Back to top
mattinahat



Joined: 16 Sep 2011
Posts: 2

PostPosted: Thu 22 Sep '11 15:01    Post subject: Reply with quote

So I know this topic was a bit old, but I'm running into the same problem.

I'm trying to map an alias with:

Alias /p "\\ps-file.location.edu\A$"
<Directory /p>
Order allow,deny
Allow from all
</Directory>

But every time I do I get a restricted error. I've tried running apache from the console but that doesn't change anything. I'm new at this, so I also don't know how to give a win7 the rights to "run as a service".

Any ideas?
Thanks!
-Matt
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Fri 23 Sep '11 0:50    Post subject: Reply with quote

use // and / or \\\\ and \\, backslashes need to be escaped.

<Directory "\\ps-file.location.edu\A$" >

It's usually
//computername/sharename/filepath
Back to top
mattinahat



Joined: 16 Sep 2011
Posts: 2

PostPosted: Fri 23 Sep '11 1:59    Post subject: Reply with quote

Thanks for the quick response!

I switched it to forward slashes and now it gives me a 404 error? Something must be weird with my setup because the back slashes worked (at least to the point where it said I do not have permission) while the forward slashes can't even find the drive.
Back to top


Reply to topic   Topic: Allow apache to get content from internal network path, how? View previous topic :: View next topic
Post new topic   Forum Index -> Apache