Trouble Opening Shared Files Over Local Intranet

S

SethBennett

Stuck on developing a local intranet for a client's small business enterprise network.


OS: Windows 2019 Database Server

Active Directory: Accessed through LDAPS

Web Server: XAMPP v3.2.4

Web Server Language: PHP

Hosting Machine: HOST (virtual server)


Goals:

1) Provide an "Employee Center" where all the employee and company data can be found in a single place. Apache and MySQL are working to maintain company data provided by employees and admins. Users can access these features from their local machines, when they click the hyperlink and log into the intranet.

2) Provide access to their company's shared drives, through the intranet. PHP accomplishes this by running the file access command through the command line. This is where we are getting STUCK. When the user uses the intranet to select a file from a shared drive, and open it, the file is opening in the HOST machine, where the Apache server is running, and not the user's local machine!


Let me tell you, it was weird watching random files open up while I was working on the HOST. I thought we'd been hacked! Then a co-worker called, wanting to know why their desired files weren't showing up when they tried to access them on the intranet, from their local machine.


Since the virtual HOST server is where the Apache web server is running the show, I assume that Apache is reflexively opening the desired file (from a shared drive) on it's own server. The hyper link we are using is connecting the user to the intranet, but the web server is opening files on the HOST, rather than sending the "open file" commands back to the user's local machine.


My question is, is there a way to qualify the Command Line request so that the desired file is opened on a specific machine or (better yet) for a specific user? I have access to the active directory to identify a current user and their current machine, for example.


I'm currently accessing shared network files by creating, running and closing a scheduled task. This is the code PHP is currently running through the command line. It works on the HOST machine, but continues to fire on the HOST machine, even if the user is logged in from their local machine.


Note: "$escapedLogPath" is the path to the user's desired file.


Create the task:

- SCHTASKS /F /Create /TN MyTasks\_notepad /TR "\\'.$escapedLogPath.'\\" /SC DAILY /RU INTERACTIVE


Run the task:

- SCHTASKS /RUN /TN "MyTasks\_notepad"


Delete the task:

- SCHTASKS /DELETE /TN "MyTasks\_notepad" /F


This code works if launched while logged into the HOST, opening the file right on the HOST, but when the user logs in from their local machine, the desired file path is still activated on Apache's HOST machine. It's not opening on the user's local machine.


Can this be accomplished by modifying the above commands?


If PHP is not an option, could this accomplished in a batch file? With arguments fed to it by PHP calling up the command line?


Another option could be that the client handles most of their business on their local IIS server. I could probably migrate the intranet from Apache to IIS, but I haven't worked with IIS much and want to know for sure that IIS can meet our intranet goals, before configuring IIS for PHP and migrating the entire intranet over.


Any advice, links to tutorials or guidance would be greatly appreciated.


I've build online websites before, but inter-connecting shared drives over a local intranet is way more complicated than that!

Continue reading...
 
Back
Top Bottom