htdocs and sub folders

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

htdocs and sub folders

Postby JoanW » 02. December 2005 19:04

I am trying to learn PHP and MySQL, and using Dreamweaver 8. I am using a couple different books, walking through tutorials. I would like to be able to put files into sub folders within htdocs. Is this not possible? (Hasn't worked for me as I tried it.)

Ultimately I would like to move htdocs to c:\www\project_name and have sub folders such as:
c:\www\sitefolder1
c:\www\sitefolder2

...in order to keep everything in order and not have to go through layers to reach my sites.

I realize I would need to change the paths in Apache httpd.conf. But I question making this change because I can't even get a file to open if I put it within a sub folder of htdocs.

Please help.
Thank you.
Joan
JoanW
 
Posts: 17
Joined: 31. October 2005 16:32
Location: Hattiesburg, MS USA

Postby KingCrunch » 02. December 2005 23:40

I hope I understand you as far as possible ;)

1. Subfolders are possible (of course)
2. If you want to move your htdocs you have to enter your new Root-Directory in your conf-file. The entry there is (of course ;)) Root-Directory or something like that.
Nicht jeder Fehler ist ein Bug ...
KingCrunch
 
Posts: 1724
Joined: 26. November 2005 19:25

Postby JoanW » 03. December 2005 00:25

Thank you for replying.

I want to place all the websites I create in C:/www. Both PHP and HTML. Right now I am working with two php/mysql tutorials. How about if we call them website1 and website2?

So this is what I need to happen therefore:

C:/www/website1/index.php
C:/www/website2/index.php
etc

I don't want what is currently present... which is this:

For website1:
C:/program files/xampp/htdocs/index.php
C:/program files/xampp/htdocs/cd.php
etc.

For website2:
C:/program files/xampp/htdocs/tours.php
C:/program files/xampp/htdocs/index.php
etc. Because website2 has an index page (of course), in order to work on website1 I have to move all the files for website2 into a website2 folder within htdocs. If I want to work on website2, I have to do the same for website1 and then dump the website2 files directly into htdocs. It is crazy.

I want to be able to go to one spot on my hard drive where ALL website projects are in one place. C:/www instead of being scattered throughout C:/ or have loose files floating around in C:/program files/xampp/htdocs/

Currently my only server is localhost... I am learning this stuff and am not ready to put anything on a world wide web server.

I have gone into httpd.conf and changed the root but it did not work. I will try it again, in case I goofed and don't realize it.





Thanks.
Joan
JoanW
 
Posts: 17
Joined: 31. October 2005 16:32
Location: Hattiesburg, MS USA

Postby Wiedmann » 03. December 2005 01:09

Think easy...

I want to be able to go to one spot on my hard drive where ALL website projects are in one place.

Well, this (one spot) directory is "C:\program files\xampp\htdocs". And there you put your sites in different subdirs:

For website1:
C:\program files\xampp\htdocs\website1\index.php
C:\program files\xampp\htdocs\website1\cd.php
etc.
in your Browser: http://localhost/website1/

For website2:
C:\program files\xampp\htdocs\website2\tours.php
C:\program files\xampp\htdocs\website2\index.php
etc.
in your Browser: http://localhost/website2/


No need to change anything in the config file.

BTW:
You can make shortcuts on your desktop to this direcorys for quick access.
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby JoanW » 03. December 2005 04:50

I tried making a short cut on my desk top and ended up moving the entire htdoc file to the desktop! ??? I moved it back!

I would be willing to let the htdocs files stay in C:/program files/xampp/htdocs if I could get short cut on my desk top and if I could access the documents within subfolders.

But, if I put the documents in subfolders like C:/program files/xampp/htdocs/website1 I cannot access the file.

I simply do not understand what I am not doing correctly.
JoanW
 
Posts: 17
Joined: 31. October 2005 16:32
Location: Hattiesburg, MS USA

Postby bill oakley » 05. December 2005 07:57

A couple of ways to do what you want but easiest to have the files in a dircetory that is not .../htdocs may be modify your httpd.conf file and change both DocumentRoot and Directory settings to where you want to put your development files sich as c:/www (note format of existing entries)
Make sure c:/www as a directory actually exist on your harddrive before restarting apache or it may not start.
Under c:/www create two sub-directories c:/www/website1 and c:/www/website2 (create as many as you need). Load your files to those dircetories and go.
To access the sites type //localhost/website1 (or 2)
User avatar
bill oakley
 
Posts: 8
Joined: 01. August 2005 06:55

Postby JoanW » 05. December 2005 23:41

Thank you for your help! On both problems! I appreciate it.
JoanW
 
Posts: 17
Joined: 31. October 2005 16:32
Location: Hattiesburg, MS USA


Return to XAMPP for Windows

Who is online

Users browsing this forum: Altrea and 61 guests