You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by O-One <ol...@yahoo.com> on 2004/09/06 03:03:05 UTC

[users@httpd] Configuring Namebased Virtual Host.

Hello all,
 
I know this is probably not the right place for this question, but please pardon me.
 
I see that one can use namevirtualhost to host multiple sites with one IP address. I need to know that by using PHP with Apache, is there any editing necessary with the PHP.ini file?
 
I see that php.ini has a line that references the DOCUMENT ROOT, but if one is using namevirtualhost, how does the entry in php.ini for the docroot affect the different sites? Or should that parameter be left without any entry?
 
Thanks
 
ola_one

		
---------------------------------
Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.

Re[2]: [users@httpd] Configuring Namebased Virtual Host.

Posted by Eugene <ht...@infosatgeomatica.com>.
Hello O-One, you should configure it exactly like I've suggested.
Right now I'm writing this answer from the server with 17 Vhosts, but
to configure your php you need do exactly this in your PHP.INI (not in
httpd.conf!!!!!):
doc_root = "C:/apache/apache2/htdocs"
user_dir = "C:/apache/apache2/htdocs"

By default these variables are empty or you can find something like
doc_root = "C:\Program Files\PHP..."... You should replace this with
real document root of your server and if you want also you can
configure user_directory (which is the same in this case)

Warning! Your configuration for httpd.conf is invalid. You can
configure your document root in HTTPD.CONF
just once in Main server configuration EXACTLY like this(BTW, it
should be configured during installation):
DocumentRoot "C:/apache/apache2/htdocs" (not doc_root!)

'doc_root' or 'user_dir' doesnt exists for Apache, you are configuring
these variables just for PHP.


Monday, September 6, 2004, 12:26:59 PM, you wrote:

> Hello again, somehow I got confused with the answer you just gave
> me. If I am running/hosting one website, my configuration would be
> as you suggested but I am going to run more than 1 site.
>  
> The following is what will be in each virtual host container for
> documentroot. But what will be in PHP.ini for doc_root since there
> is more than one site?
>  
> Site 1:
> httpd.conf
> doc_root = "C:/apache/apache2/htdocs/Site_1/publi_html"
>  
> Site 2:
> httpd.conf
> doc_root = "C:/apache/apache2/htdocs/Site_2/publi_html"

>  
> php.ini
> doc_root =
>  
> I know that when using NameVirtualHost, Apache will get the
> directives from the VirtualHost container, which is okay for me. The
> confusion is the php.ini 
>  
> Thanks again.

> Eugene <ht...@infosatgeomatica.com> wrote:
> Hello O-One, you should point in this case at Document Root of your
> server, in other words (my php.ini):
> doc_root = "F:/server/apache2/htdocs"
> user_dir = "F:/server/apache2/htdocs"

> my http.conf:
> DocumentRoot "F:/server/apache2/htdocs"

> I have seven virtual hosts in sub-folders of my Document Root,
> two folders is for jsp and servlet projects served by Tomcat 5.0.24 or
> JBoss 3.2.5(depends from project), three folders with sites
> in development stage written on PHP and some experimental Vhosts. All
> works just fine with php 4, MySQL, Geomatica WebServer etc.


> Sunday, September 5, 2004, 10:03:05 PM, you wrote:

>> Hello all,
>>  
>> I know this is probably not the right place for this question, but please pardon me.
>>  
>> I see that one can use namevirtualhost to host multiple sites
>> with one IP address. I need to know that by using PHP with Apache,
>> is there any editing necessary with the PHP.ini file?
>>  
>> I see that php.ini has a line that references the DOCUMENT ROOT,
>> but if one is using namevirtualhost, how does the entry in php.ini
>> for the docroot affect the different sites? Or should that parameter
>> be left without any entry?
>>  
>> Thanks
>>  
>> ola_one




>> Do you Yahoo!?
>> Read only the mail you want - Yahoo! Mail SpamGuard. 






-- 
Best regards,
 Eugene                            mailto:httpd.subscribe@infosatgeomatica.com


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Configuring Namebased Virtual Host.

Posted by O-One <ol...@yahoo.com>.
Hello again, somehow I got confused with the answer you just gave me. If I am running/hosting one website, my configuration would be as you suggested but I am going to run more than 1 site.
 
The following is what will be in each virtual host container for documentroot. But what will be in PHP.ini for doc_root since there is more than one site?
 
Site 1:
httpd.conf
doc_root = "C:/apache/apache2/htdocs/Site_1/publi_html"
 
Site 2:
httpd.conf
doc_root = "C:/apache/apache2/htdocs/Site_2/publi_html"

 
php.ini
doc_root =
 
I know that when using NameVirtualHost, Apache will get the directives from the VirtualHost container, which is okay for me. The confusion is the php.ini 
 
Thanks again.

Eugene <ht...@infosatgeomatica.com> wrote:
Hello O-One, you should point in this case at Document Root of your
server, in other words (my php.ini):
doc_root = "F:/server/apache2/htdocs"
user_dir = "F:/server/apache2/htdocs"

my http.conf:
DocumentRoot "F:/server/apache2/htdocs"

I have seven virtual hosts in sub-folders of my Document Root,
two folders is for jsp and servlet projects served by Tomcat 5.0.24 or
JBoss 3.2.5(depends from project), three folders with sites
in development stage written on PHP and some experimental Vhosts. All
works just fine with php 4, MySQL, Geomatica WebServer etc.


Sunday, September 5, 2004, 10:03:05 PM, you wrote:

> Hello all,
>  
> I know this is probably not the right place for this question, but please pardon me.
>  
> I see that one can use namevirtualhost to host multiple sites
> with one IP address. I need to know that by using PHP with Apache,
> is there any editing necessary with the PHP.ini file?
>  
> I see that php.ini has a line that references the DOCUMENT ROOT,
> but if one is using namevirtualhost, how does the entry in php.ini
> for the docroot affect the different sites? Or should that parameter
> be left without any entry?
>  
> Thanks
>  
> ola_one




> Do you Yahoo!?
> Read only the mail you want - Yahoo! Mail SpamGuard. 



-- 
Best regards,
Eugene mailto:httpd.subscribe@infosatgeomatica.com


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


		
---------------------------------
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!

Re: [users@httpd] Configuring Namebased Virtual Host.

Posted by Eugene <ht...@infosatgeomatica.com>.
Hello O-One, you should point in this case at Document Root of your
server, in other words (my php.ini):
doc_root = "F:/server/apache2/htdocs"
user_dir = "F:/server/apache2/htdocs"

my http.conf:
DocumentRoot "F:/server/apache2/htdocs"

I have seven virtual hosts in sub-folders of my Document Root,
two folders is for jsp and servlet projects served by Tomcat 5.0.24 or
JBoss 3.2.5(depends from project), three folders with sites
in development stage written on PHP and some experimental Vhosts. All
works just fine with php 4, MySQL, Geomatica WebServer etc.


Sunday, September 5, 2004, 10:03:05 PM, you wrote:

> Hello all,
>  
> I know this is probably not the right place for this question, but please pardon me.
>  
> I see that one can use namevirtualhost to host multiple sites
> with one IP address. I need to know that by using PHP with Apache,
> is there any editing necessary with the PHP.ini file?
>  
> I see that php.ini has a line that references the DOCUMENT ROOT,
> but if one is using namevirtualhost, how does the entry in php.ini
> for the docroot affect the different sites? Or should that parameter
> be left without any entry?
>  
> Thanks
>  
> ola_one




> Do you Yahoo!?
> Read only the mail you want - Yahoo! Mail SpamGuard. 



-- 
Best regards,
 Eugene                            mailto:httpd.subscribe@infosatgeomatica.com


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org