Page 1 of 1

htdocs and sub folders

PostPosted: 02. December 2005 19:04
by JoanW
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

PostPosted: 02. December 2005 23:40
by KingCrunch
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.

PostPosted: 03. December 2005 00:25
by JoanW
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

PostPosted: 03. December 2005 01:09
by Wiedmann
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.

PostPosted: 03. December 2005 04:50
by JoanW
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.

PostPosted: 05. December 2005 07:57
by bill oakley
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)

PostPosted: 05. December 2005 23:41
by JoanW
Thank you for your help! On both problems! I appreciate it.