multiple hosts with zend server beta on debian lenny?

General discussion forum for the Zend Server
Post Reply
smithdg
Posts: 41
Joined: Sun Mar 22, 2009 3:32 am

multiple hosts with zend server beta on debian lenny?

Post by smithdg » Sun Mar 22, 2009 4:00 am

I need to be able to run multiple hosts on this machine, none of them will be very intensive. I uncommitted the line "#NameVirtualHost *" in /etc/apache2/conf.d/virtual.conf. Then when I stop and restart apache, it gives error messages with just the default virtual host.
# apache2ctl stop
[Sat Mar 21 21:41:39 2009] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Sat Mar 21 21:41:39 2009] [warn] NameVirtualHost *:80 has no VirtualHosts

It has the standard debian default virtual host values:
<VirtualHost *:80>
ServerAdmin webmaster@localhost

DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

</VirtualHost>


I also noticed I no longer had access to the zend server web app, if I enabled virtual hosts with a different document root.

I have upgraded to the current beta2.
Any help would be appreciated. I need to move forward with this, or just install the normal debian tools as I need to go to production. I like the looks very much.

thanks,
Danny

jess04
Posts: 628
Joined: Thu Jan 15, 2009 3:37 pm

Re: multiple hosts with zend server beta on debian lenny?

Post by jess04 » Sun Mar 22, 2009 5:22 pm

Hello Danny,

Basically, what this error means is:
<VirtualHost *:80>
Is wrong. You could modify it to:
<VirtualHost localhost:80>
or to any other host you wish [just make sure its resolvable, either for real or in /etc/hosts]

For reference, you can also look at /etc/apache2/sites-available/zend-server.conf, this is the VHost for the ZendServer UI but please do not modify it as it may cause ZendServer to malfunction.

For reference about different types of VHost configurations supported by Apache, please see:
http://httpd.apache.org/docs/2.0/vhosts/

Also, I am not sure where /etc/apache2/conf.d/virtual.conf came from, in my Debian, this configuration exists under /etc/apache2/sites-available/default, the idea is you can run:
# a2ensite default
to enable it. Of course, replace default with whatever you name the conf file holding your Vhost.

If you need further assistance, please let me know,

avaranger
Posts: 5
Joined: Sun May 03, 2009 9:49 am

Re: multiple hosts with zend server beta on debian lenny?

Post by avaranger » Sun May 03, 2009 9:54 am

I use Zend Server CE on windows and i have also problems with vhosts.

this is my httpd.conf section

Code: Select all

<VirtualHost *:80>
    DocumentRoot "w:/www/tul/web/public"
    ServerName telefon
    <Directory "w:/www/tul/web/public">
        Options FollowSymLinks
        AllowOverride All
        Order deny,allow
        Allow from all
    </Directory>
</VirtualHost>
this is my etc/hosts file

Code: Select all

127.0.0.1	telefon
Other than that it's clear ZSCE installation.

After restarting apache and accessing URL http://telefon/admin/ i got following error:

Code: Select all

[Sun May 03 10:53:10 2009] [error] [client 127.0.0.1] File does not exist: C:/Program Files (x86)/Zend/Apache2/htdocs/admin
It's still looking to the default htdocs :( Why oh why? :)
www.tomasfejfar.cz

massimilianoc
Posts: 699
Joined: Thu Mar 12, 2009 11:58 am

Re: multiple hosts with zend server beta on debian lenny?

Post by massimilianoc » Wed Jun 03, 2009 3:05 pm

I was able to make it work quite easily.

This is the content of my 'C:\Program Files\Zend\Apache2\conf\extra\httpd-vhosts.conf':

Code: Select all

#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at 
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# Use name-based virtual hosting.
#
NameVirtualHost *:8080
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:8080>
    ServerAdmin massi@zend.com
    DocumentRoot "C:/Program Files/Zend/Apache2/htdocs"
</VirtualHost>
<VirtualHost *:8080>
    ServerAdmin massi@zend.com
    DocumentRoot "c:/www/tul/web/public"
    ServerName telefon
    <Directory "c:/www/tul/web/public">
        Options FollowSymLinks
        AllowOverride All
        Order deny,allow
        Allow from all
    </Directory>
</VirtualHost>
As you can see I have a first, basic VHost configuration to be the default one as explained in http://httpd.apache.org/docs/2.2/vhosts/name-based.html.

Of course I also un-commented line 415 of 'C:\Program Files\Zend\Apache2\conf\httpd.conf' in order to include the vhosts configuration file.

One more Apache server restart and you should be OK.

Regards,
Massi.
Best regards,
Massi.

avaranger
Posts: 5
Joined: Sun May 03, 2009 9:49 am

Re: multiple hosts with zend server beta on debian lenny?

Post by avaranger » Wed Jun 03, 2009 3:46 pm

Thanks for your help. I'll check it asap when i'm back home. Just one question. Can all the server names be handled on the same IP? I have for each of my projects one named host like live one -> www.example.com and development -> dev-example and that makes each name one IP. I guess I have to make apache listen everywhere than. Am I right?

massimilianoc
Posts: 699
Joined: Thu Mar 12, 2009 11:58 am

Re: multiple hosts with zend server beta on debian lenny?

Post by massimilianoc » Sun Jun 14, 2009 10:16 am

You can have as many names as you need on the same VHost base (usually on '<public_ip>:<port>').

I suggest you to use the dotted format (e.g. dev.site.local, test.site.local, etc...).

Make sure you have good use of the '/etc/hosts' file to govern the way you need the name resolution to your local sites.

Best regards,
Massi.
Best regards,
Massi.

varai
Posts: 3
Joined: Tue Feb 22, 2011 6:53 am

Re: multiple hosts with zend server beta on debian lenny?

Post by varai » Wed Mar 09, 2011 11:24 am

Since i'm using port 8080, can i add the following in etc/services?
http 8080/tcp www www-http #World Wide Web
below
http 80/tcp www www-http #World Wide Web

i need both of them coz' wamp's apache web server is running on port 80 and zend's apache web server is running on port 8080.

thank you.

andrea147
Posts: 1
Joined: Mon Sep 26, 2011 11:03 am
Contact:

Re: multiple hosts with zend server beta on debian lenny?

Post by andrea147 » Mon Sep 26, 2011 11:03 am

Hi,
thank you, exactly what I'm looking for!

Post Reply