Per user configuration in network home drive ?

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Per user configuration in network home drive ?

Postby DBMandrake » 17. June 2014 11:59

Sorry if this has been asked before!

I'm trying to find out if it is possible to install XAMPP in a way that all user data and configuration is saved per (windows) user on a network home drive.

The scenario is students log into a windows domain, and we will map H: drive to the root of their home directory on the server.

For this to work, anything that may be specific to that user needs to be saved on H: drive, including their htdocs, mysql database tables and so on, so that when they log out of one PC and log into a different PC next time everything they have worked on is still there, rather than sitting on the hard drive of the PC they last used.

I've been investigating WAMP, XAMPP, and EasyPHP Dev Server. WAMP is out of the running because it can only run the Apache, MySQL servers etc as windows services.

This is problematic for two reasons - (1) the services running as SYSTEM can't access the users H: drive, even after they have logged in. (2) The services keep trying to run after the user logs out.

We need all the servers to run in the users account context so they can access H:, ONLY run when they are logged in, and be automatically terminated when they log out. We also want the servers to launch only when the user manually wants to use them, not automatically at windows login.

So far it looks like XAMPP can do this - I see there is the option to run the servers as services or as normal processes (excellent!) so how practical is it to adjust all of the configuration files for apache, mysql and so on to point at the mapped drive ? If I do this am I going to need a login script to copy the data directories (mysql tables in particular) from the copy on C drive as a kind of a template if they don't already exist on the home drive from a previous login ?

Can the XAMPP control panel be sufficiently customised so that all the config/logs buttons etc can be made to point to the appropriate files on H: instead of locally ? Ideally even log files should be logged to H: drive, nothing user specific should be getting written back to the local drive.

Hopefully someone can tell me whether I'm batting my head against a wall (as I did with WAMP, and to some degree EasyPHP) or whether it should be possible with the right configuration. At least if I know it's possible its worth investing more time to figure out how to do so.

Thanks!
DBMandrake
 
Posts: 2
Joined: 17. June 2014 11:45
Operating System: Windows

Re: Per user configuration in network home drive ?

Postby Nobbie » 17. June 2014 12:18

DBMandrake wrote:The scenario is students log into a windows domain, and we will map H: drive to the root of their home directory on the server.


No this is impossible.

Xampp (i.e. Apache) is running on ONE machine (the server) and H: must be mapped to a drive BEFORE Apache starts. It cannot be remapped or anything. The mapping must be accessible to the user, which runs the Apache process (this is SYSTEM per default, but you can change this to any other known user on the server). BUT: it is only THIS ONE user. You cannot change the user while running Apache. Also, this user must be logged in before you start Apache (as drive mapping only applies to logged in users).

Apache allows different ways off having user specific htdocs in their home directory (see Module mod_userdir) and the corresponging URLs look like: http://www.domain.com/~User/myfile.html, but you cannot use drive mapping (H:) for this home directory. You may do a drive mapping H: to that specific home directory in the users login process, but you cannot use H: within Apache (but as i think, there is no need to have a drive mapping for Apache).

P.S.: With the help of mod_userdir, you may provide a home directory for each user and access all html/php files for this specific user via Apache (using the above syntax including the ~User Tag), but there is NO such thing for MySQL. MySQL does not know similar mappings like Apache (Apache supports user space and also simple mappings via ALIAS). But there is no such thing for MySQL, there is only one datadir directive and this is valid for all users. MySQL Service is run by a single user at runtime as well as Apache.
Last edited by Nobbie on 17. June 2014 12:42, edited 1 time in total.
Nobbie
 
Posts: 8772
Joined: 09. March 2008 13:04

Re: Per user configuration in network home drive ?

Postby DBMandrake » 17. June 2014 12:29

Nobbie wrote:
DBMandrake wrote:The scenario is students log into a windows domain, and we will map H: drive to the root of their home directory on the server.


No this is impossible.

Xampp (i.e. Apache) is running on ONE machine (the server) and H: must be mapped to a drive BEFORE Apache starts. It cannot be remapped or anything. The mapping must be accessible to the user, which runs the Apache process (this is SYSTEM per default, but you can change this to any other known user on the server). BUT: it is only THIS ONE user. You cannot change the user while running Apache.

Thanks for the reply, however I don't think you quite follow what I'm asking.

XAMPP would be installed on all student machines in the computer labs. When a student logs in each machine has a local copy of apache/mysql etc that will run directly on their own machine and is accessed via localhost as per a normal install.

All we want to do is shift the configuration and data files to a mapped drive which is mapped to a file server. No matter who logs into the machine it is always H: drive, so apache etc can be configured to look in the "same" location, but that same location is in reality different for each user as it is their individual home directory on the file server.

XAMPP would not be launching until the user manually launches it after logging in, at which point H drive has already been mapped. As far as I can see if I do not run the apache/mysql servers as services but simply press start in the control panel, they do in fact run as the user, not as the SYSTEM account. I have confirmed this by checking the apache process using sys-internals process explorer.

Does this make things any clearer ?

My main concern is whether the XAMPP control panel itself has enough flexibility to have the paths that its buttons point to customised or whether they are hard coded based on the base installation directory.
DBMandrake
 
Posts: 2
Joined: 17. June 2014 11:45
Operating System: Windows

Re: Per user configuration in network home drive ?

Postby Nobbie » 17. June 2014 12:49

DBMandrake wrote:XAMPP would not be launching until the user manually launches it after logging in, at which point H drive has already been mapped. As far as I can see if I do not run the apache/mysql servers as services but simply press start in the control panel, they do in fact run as the user, not as the SYSTEM account. I have confirmed this by checking the apache process using sys-internals process explorer.

Does this make things any clearer ?

My main concern is whether the XAMPP control panel itself has enough flexibility to have the paths that its buttons point to customised or whether they are hard coded based on the base installation directory.


Oups - now i got it.

Of course you can do so, the control panel is not important for that. You have to configure Apache and MySQL via the corresponding config files. Of course everyone can have his own Apache, but this also means, that you dont have a single Server environment.

You simply have to apply "H:/htdocs" (for example) as a DocumentRoot in httpd.conf. Same for datadir in my.ini (or my.cnf). the MySQL Configuration File.

P.S.: The Xampp Control Panel is only a "nice to have" GUI. If there is any problem with hardcoded paths (I dont know, if there is a problem or not), this is not really a problem. Because you dont need the Control Panel, you may start Apache and MySQL as well without the Panel. This should not be an issue.
Nobbie
 
Posts: 8772
Joined: 09. March 2008 13:04


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 69 guests