Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to structure directories and/or configure Apache

Status
Not open for further replies.

JavaSprout

Programmer
Jul 31, 2001
30
0
0
BE
I am not sure how to structure directories and/or Apache in order to work in the best way possible.

I used to work just locally (Windows XP) with localhost and each application had a different sub-directory in the Apache htdocs directory, e.g.:

/htdocs/phpMyAdmin
/htdocs/hangman
/htdocs/phpBB
/htdocs/myAppDev
/htdocs/myAppProd

This worked well for the last year or so. I just typed in the URL, to run the hangman app etc.

NOW, I want to run an internet connected website from the same machine as I normally develop from (Waits for those who fainted to come round. I know, not ideal, but for now it will be like that).

Soooo...I have configured httpd.conf so that both DocumentRoot and the Directory command both point to my Production directory:

DocumentRoot "C:/Program Files/Apache Group/Apache/htdocs/myAppProd"

<Directory &quot;C:/Program Files/Apache Group/Apache/htdocs/myAppProd&quot;>

(Dunno why I need to tell Apache twice, but, hey, don't get defocused!)

Anyway, now, internet users can access my real site with, say, BUT how do I access all my other applications?? How do I now for example access since now would automatically go to /htdocs/myAppProd?

I thought of sticking all my other apps in subdirectories BELOW the myAppProd directory and password protecting them. Then I could surf to fine. But I'm not sure about the security of sticking EVERYTHING else in the same directory structure as the outside world.

Maybe there's some magic values I could play with in Apache?

What do you think is the best solution? I'm sure I'm not the first (or the last) to need to do this.

Thanks!

:)
 
You need virtual hosts. Check the FAQs section, and the Apache documentation, for more information.

//Daniel
 
with an alias maybe? something like this:

Alias /site/ &quot;C:/web/mysite/&quot;
<Directory &quot;C:/web/mysite/&quot;>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
DirectoryIndex index.php3 index.php index.htm
</Directory>

Alias /phpmyadmin/ &quot;F:phpmyadmin/&quot;
<Directory &quot;F:/phpmyadmin/&quot;>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from localhost 127.0.0.1
DirectoryIndex index.php
</Directory>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top