Change apache docroot within xampp_start

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

Change apache docroot within xampp_start

Postby alan » 11. July 2005 17:40

I am a computing lecturer teaching web programming using phpEclipse. Until now my students have developed code on a central server within our department. However I tell my students (190+ each year) to use apachefriends at home (as I do) as I think that it is the best combination especially for casual users who dont want an HTTP server and a Database server running as background processes. Well done for that.

We primarily use windows in our lab machines.
This year I am considering dispensing with the central server and installing apachefriends on all machines in our labs. Whilst it is easy to place apachefriends on the c drive. Our administrators make that drive readable only to students who each have user space on a remote server.

So the problem is with setting up the document root for apache. Would it be possible to change the apache_start executable so that it throws out a dialogue box to allow students to set a directory in their area as the document root? Or alternatively look for a config file they can place in their home directory? As all lab machines are useable to all students I am assuming that in order to stop overloading the HTdocs directory apache_start should pass the root the student requires as a parameter to starting apache (can you do that I havent checked?) or it should re-write the apache config file whooa!!! not happy with that.


I am willing to do some work on this is it possible to get source for apache_start?

Thanks

Alan
alan
 
Posts: 3
Joined: 11. July 2005 17:19

Postby alucard01 » 15. July 2005 06:02

How about this:

Make XAMPP only access by specific students. i.e. if student A login, this student cannot access to XAMPP. While student B(your student) login, this student can access to this folder. And then run setup_xampp.bat for personal config....

To sum up, config is done on windows, but not on XAMPP...

Hope it helps...
alucard01
 
Posts: 122
Joined: 15. May 2005 13:51

RE suggestion from alucard01

Postby alan » 15. July 2005 10:31

Thanks for your suggestion alucard01 but I dont think that it solves the problem I am anticipating. Basically I dont want students to use the apache/htdocs directory on the local c: drive as their web root. This is for two reasons, firstly it then forces them to work on one specific machine which is unrealistic as they move would normally roam from lab to lab. We dont want people to end up with a web directory on every machine they have logged onto. Secondly there are security issues involved in that students should only be able to read and write to their own directory area. To police this would entail duplication of the security we have on our central servers, which is unnecessary.

All those students with access to xampp would necessarily see the same configuration file because I am assuming its location is hardcoded into the xamp_start exe. Thus everyone would have the same document root. Thinking further about it , What I need is for xamp_start to accept command line parameters specifically the apache document root.

Incidentally I tried running apache directly as a command within eclipse viz
apache -c "DocumentRoot c:\alans_webroot\" which would also be acceptable. However apache started up but then closed down immediately so there is a problem with this. Can any one tell me why?

Finally, there is a hack solution I could use and that is to write two batch files to copy the site from the users central area into the apache\htdocs area before starting work and then back again when finishing. However I am not happy with this as a solution. So still looking for help.

Alan
alan
 
Posts: 3
Joined: 11. July 2005 17:19

Postby Wiedmann » 15. July 2005 11:26

Hi alan,

an easy solution:

eg:
- XAMPP is installad on each lab machine in "C:\xampp"
- Each student have a personal share on the central server that is mapped after logon as "P:\"

so:
- each student who will use XAMPP must make a directory "P:\htdocs"
- in the config files for Apache on the lab machines, change the DocumentRoot (and the following "<Directory ...>" directive) to "P:/htdocs"

That's all.
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby alan » 15. July 2005 14:23

Thanks Wiedmann, Sorry for being thick I dont know why I didnt think of that.

Alan
alan
 
Posts: 3
Joined: 11. July 2005 17:19


Return to XAMPP for Windows

Who is online

Users browsing this forum: DrSeussFreak and 63 guests