RE: [PHP] multiple local domains under apache
| From: | Kurt Boyer | Date: | Mon, 14 Aug 2000 16:29:59 +0000 |
| Subject: | RE: [PHP] multiple local domains under apache | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-11631@lists.php.net to get a copy of this message | ||
Nick,
I don't use the NameVirtualHost line, and have been successful
configuring many servers.
You need to put in your server's IP address where you see
222.222.222.222 below (in your httpd.conf file):
<VirtualHost 222.222.222.222:8081>
Your /etc/hosts file should look something like this:
27.0.0.1 localhost
222.222.222.222 badboy.carrierworld.com badboy
(where badboy is the actual server name and the ip address
is the ip for that server)
NOTE: You only need one entry for your server in the hosts file.
The virtualhosts directive in the httpd.conf file will take
care of everything else (as long as you have the IP in there
correctly)
---
Kurt A. Boyer
Advanced Software Engineer
Matchlogic, Inc.
http://www.matchlogic.com
-----Original Message-----
From: Nick [mailto:n.curry@ucl.ac.uk]
Sent: Monday, August 14, 2000 10:19 AM
To: Kurt Boyer; php-general@lists.php.net; Voitenko, Denis
Subject: Re: [PHP] multiple local domains under apache
Hi,
thanks a lot for your answer ! I tried what you suggested, but
unfortunately it doesn't seem to work- httpd won't start.
I added a line to the httpd.conf that you didn't specify which is:
NameVirtualHost 222.222.222.222:8081
for each virtual host. I'm not sure though whether these addresses have to
be in /etc/host to work too though.
Otherwise i just noticed that when i compiled apache, I must have done it
without the vhost_alias module. Would this affect anything ?
Is there anything else i should change to get it to work ?
thx a lot,
nick
PS my exact configuration is:
NameVirtualHost 222.222.222.222:8081
<VirtualHost 222.222.222.222:8081>
ServerAdmin webmaster@host.some_domain.com
DocumentRoot /home/carrierworld/old_site/
ServerName old.carrierworld.com
ErrorLog logs/carrierworld_old-error_log
CustomLog logs/carrierworld_old-access_log common
</VirtualHost>
ServerName localhost.localdomain
Port 80
Listen 8081
Listen 8082
Listen 8083
Listen 8084
Listen 8085
Listen 8086
Kurt Boyer wrote:
> Here's how I do it in the apache httpd.conf file:
>
> 1) Setup multiple ports first (like this)
> # Listen: Allows you to bind Apache to specific IP addresses and/or
> # ports, in addition to the default. See also the <VirtualHost>
> # directive.
> #
> Listen 8081
> Listen 8082
> Listen 8083
> Listen 8084
> Listen 8085
> Listen 8086
>
> 2) Setup your virtual hosts (like this)
> #<VirtualHost user1.yourdomain.com>
> <VirtualHost 222.222.222.222:8081>
> ServerAdmin nospam@yahoo.com
> DocumentRoot /usr/local/SomeonesDir/htdocs
> <Directory "/usr/local/SomeonesDir/htdocs">
> Options Indexes FollowSymLinks +Includes
> AllowOverride None
> </Directory>
> ScriptAlias /cgi-bin/ /usr/local/SomeonesDir/cgi-bin/
> ServerName user1.yourdomain.com
> AddType text/html .shtml
> AddHandler server-parsed .shtml
> ErrorLog /usr/local/SomeonesDir/logs/error_log
> TransferLog /usr/local/SomeonesDir/logs/access_log
> </VirtualHost>
>
> #<VirtualHost user2.yourdomain.com>
> <VirtualHost 222.222.222.222:8082>
> ServerAdmin nospam@yahoo.com
> DocumentRoot /usr/local/SomeoneElsesDir/htdocs
> <Directory "/usr/local/SomeoneElsesDir/htdocs">
> Options Indexes FollowSymLinks +Includes
> AllowOverride None
> </Directory>
> ScriptAlias /cgi-bin/ /usr/local/SomeoneElsesDir/cgi-bin/
> ServerName user2.yourdomain.com
> AddType text/html .shtml
> AddHandler server-parsed .shtml
> ErrorLog /usr/local/SomeoneElsesDir/logs/error_log
> TransferLog /usr/local/SomeoneElsesDir/logs/access_log
> </VirtualHost>
>
> Hope this helps!
>
> ---
> Kurt A. Boyer
> Advanced Software Engineer
> Matchlogic, Inc.
> http://www.matchlogic.com
>
> -----Original Message-----
> From: Nick [mailto:n.curry@ucl.ac.uk]
> Sent: Monday, August 14, 2000 9:35 AM
> To: php-general@lists.php.net
> Subject: [PHP] multiple local domains under apache
>
> Hi,
>
> sorry for posting this slightly off-topic post, i wasn't quite sure
> where to post it and i thought it might interest some. I am designing a
> number of websites under RH Linux w/apache, php, mysql and was hoping to
> get Apache to serve up these different sites to me from my hard disk.
> Does anyone know how to do this ? (with different local domain
> names....)
>
> I tried looking through the apache docs and couldn't find any info - i
> tried setting up a virtual hosts sytem but it didn't seem to work. How
> does everyone else do this ?
>
> any help greatly appreciated
>
> Nick
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net