Forum Moderators: phranque

Message Too Old, No Replies

Apache conf values

Clarification needed on a few things

         

asprinwizard

10:30 am on Aug 10, 2007 (gmt 0)

10+ Year Member



Hi There,

I am running an apache server on my windows XP PC which I use as my testing server during development. I run each site as a Virtualhost and this is working great.

However lately I've had to specify a few more parameters in the Virtualhost container. I'm a little lost with this so maybe people on here can put me right. I know what I'm asking is quite simple. Below is an example of a virtualhost I have setup.

<VirtualHost *:80>
DocumentRoot "C:/My Documents/My Webs/PHP/mysite"
ServerName site1.mydomain.com
php_value include_path "C:/My Documents/My Webs/PHP/mysite/"
</VirtualHost>

First when setting document root and include_path I use the full path in quotes because it is located outside the apache install directory. I assume this has to be the case. Is this correct? But if I wanted to add a second include path location how do I do it? Do I just add the second location? after the first one. E.g:

include_path "C:/My Documents/My Webs/PHP/mysite/" "C:/My Documents/My Webs/PHP/general_includes/"

Secondly I wish to keep all my php files in the www/ folder in the site root. How do I set the server to look here automatically? I don't wish to change the Document Root because I need to reference other files from here, I just want the www/ folder to be the default folder for the php files so for example: URL '/contact/' would automatically load '/www/contact/index.php'

Do I need to use .htaccess for this or can it be done within the apache.conf file. If so how?

jdMorgan

4:01 pm on Aug 10, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The include_path question is a PHP question, so I won't address it here.

As for your scripts being located in /www, we need to know where that directory is in relation to the given site's files, and possibly, in relation to your other sites' files.

If it is your intent to share scripts across multiple sites, then I'd caution you not to put the script into any Web-accessible directory, as doing so exposes you to serious security problems; Instead, use ScriptAlias to make it appear that the script resides within a site's filespace, but allow you to store the actual script *above* the Web-accessible part of your filespace.

Jim