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

Directory Listing over the network

Status
Not open for further replies.

Jiminald

Programmer
Oct 11, 2006
39
GB
Hi,

For my extranet, each user will be allowed to access their my documents folder. Just the thing is, the files are on one server and the webserver is on a different one.

I don't think the sysadmin will allow another copy of apache and php on the file server, so using unc names or network drives is my only route.

i have tried using system to mount a drive and then using opendir to browse through it, but no joy.

All help appreciated! TIA!
Jiminald :)
 
windows 2003 enterprise on both servers.

webserver has apache 2.0.059 with mod_ssl, PHP5, OpenSSL (latest) and mod_auth_sspi.

Hope this is what you were asking for!
 
I don't have a lot of experience running PHP on Win32, but permissions can be problematic in your environment. PHP will try to use those network resources as the user as which Apache is running. Without permissions set right, you'll be dead in the water.

What have you tried so far?


Want the best answers? Ask the best questions! TANSTAAFL!
 
First You'll want to create a Sepcific user to asign to Apache to run as that has permissions to access the network resources. This will in turn give PHP those permissions.

Heres the Apache Documentation on that issue:
Apache With Windows said:
By default, all Apache services are registered to run as the system user (the LocalSystem account). The LocalSystem account has no privileges to your network via any Windows-secured mechanism, including the file system, named pipes, DCOM, or secure RPC. It has, however, wide privileges locally.
Never grant any network privileges to the LocalSystem account! If you need Apache to be able to access network resources, create a separate account for Apache as noted below.

You may want to create a separate account for running Apache service(s). Especially, if you have to access network resources via Apache, this is strongly recommended.

1. Create a normal domain user account, and be sure to memorize its password.
2. Grant the newly-created user a privilege of Log on as a service and Act as part of the operating system. On Windows NT 4.0 these privileges are granted via User Manager for Domains, but on Windows 2000 and XP you probably want to use Group Policy for propagating these settings. You can also manually set these via the Local Security Policy MMC snap-in.
3. Confirm that the created account is a member of the Users group.
4. Grant the account read and execute (RX) rights to all document and script folders (htdocs and cgi-bin for example).
5. Grant the account change (RWXD) rights to the Apache logs directory.
6. Grant the account read and execute (RX) rights to the Apache.exe binary executable.

It is usually a good practice to grant the user the Apache service runs as read and execute (RX) access to the whole Apache2 directory, except the logs subdirectory, where the user has to have at least change (RWXD) rights.

If you allow the account to log in as a user and as a service, then you can log on with that account and test that the account has the privileges to execute the scripts, read the web pages, and that you can start Apache in a console window. If this works, and you have followed the steps above, Apache should execute as a service with no problems.


Link to the Website:

You should then test with any of the directory reading funtions from PHP that you cna indeed access the network resource.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top