Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: Users

Zeus Subserver Equivalent in Apache2?

 

 

Apache users RSS feed   Index | Next | Previous | View Threaded


monkeywebdaemon at googlemail

Jun 29, 2009, 7:08 AM

Post #1 of 6 (580 views)
Permalink
Zeus Subserver Equivalent in Apache2?

Hi all,

I'm looking into our options going forward for our web-hosting cluster.

We're currently running Zeus Web Server using sub servers.

The idea behind webservers is that you can have a directory layout that
looks like:

/var/www/%HOSTING-PACKAGE-TYPE%/%x%/%x%/%domain-name.tld/html/

and the webserver does a lookup for the files in the html directory for each
request it recieves. In the above example, that would mean that for
www.icanhazcheezburger.com [0] hosted on a Designer Hosting package, the
path would expand to

/var/www/DesignerHosting/i/c/icanhazcheezburger.com/html/

I know that you can do a similar thing with vhosts, however we need to be
able to set different options for each of our hosting packages and I don't
appear to be able to specify the package-type restrictions, just server wide
which is no good for our hosting platform.

If someone can point me in the direction of the correct module(s) to use for
this, I'd be very greatful.

Cheers,

MWD.

[0] Sadly this domain is not hosted with us, but it seemed like a good
example domain to use!


tevans.uk at googlemail

Jun 29, 2009, 8:10 AM

Post #2 of 6 (536 views)
Permalink
Re: Zeus Subserver Equivalent in Apache2? [In reply to]

On Mon, 2009-06-29 at 15:08 +0100, Monkey Daemon wrote:
> Hi all,
>
> I'm looking into our options going forward for our web-hosting
> cluster.
>
> We're currently running Zeus Web Server using sub servers.
>
> The idea behind webservers is that you can have a directory layout
> that looks like:
>
> /var/www/%HOSTING-PACKAGE-TYPE%/%x%/%x%/%domain-name.tld/html/
>
> and the webserver does a lookup for the files in the html directory
> for each request it recieves. In the above example, that would mean
> that for www.icanhazcheezburger.com [0] hosted on a Designer Hosting
> package, the path would expand to
>
> /var/www/DesignerHosting/i/c/icanhazcheezburger.com/html/
>
> I know that you can do a similar thing with vhosts, however we need to
> be able to set different options for each of our hosting packages and
> I don't appear to be able to specify the package-type restrictions,
> just server wide which is no good for our hosting platform.
>
> If someone can point me in the direction of the correct module(s) to
> use for this, I'd be very greatful.
>
> Cheers,
>
> MWD.
>
> [0] Sadly this domain is not hosted with us, but it seemed like a good
> example domain to use!
>

mod_vhost_alias

http://httpd.apache.org/docs/2.2/mod/mod_vhost_alias.html

Cheers

Tom


---------------------------------------------------------------------
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 [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


apache-users at lists

Jun 29, 2009, 8:14 AM

Post #3 of 6 (532 views)
Permalink
Re: Zeus Subserver Equivalent in Apache2? [In reply to]

Monkey Daemon wrote:

> I'm looking into our options going forward for our web-hosting cluster.
>
> We're currently running Zeus Web Server using sub servers.
>
> The idea behind webservers is that you can have a directory layout that
> looks like:
>
> /var/www/%HOSTING-PACKAGE-TYPE%/%x%/%x%/%domain-name.tld/html/
>
> and the webserver does a lookup for the files in the html directory for
> each request it recieves. In the above example, that would mean that
> for www.icanhazcheezburger.com <http://www.icanhazcheezburger.com> [0]
> hosted on a Designer Hosting package, the path would expand to
>
> /var/www/DesignerHosting/i/c/icanhazcheezburger.com/html/
> <http://icanhazcheezburger.com/html/>
>
> I know that you can do a similar thing with vhosts, however we need to
> be able to set different options for each of our hosting packages and I
> don't appear to be able to specify the package-type restrictions, just
> server wide which is no good for our hosting platform.
>
> If someone can point me in the direction of the correct module(s) to use
> for this, I'd be very greatful.

I set up a system very similar to what you're describing in a past job.
I used mod_rewrites RewriteMap option with the "prg" MapType.

http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritemap

iirc we used suphp to make the perl/php scripts run as the owner of the
file.

What differences are there between your different hosting packages that
would require vhost level configuration? Perhaps you could set up one
virtualhost for each hosting package and stick them on different IPs?

> [0] Sadly this domain is not hosted with us, but it seemed like a good
> example domain to use!

According to RFC 2606 it's best practice to use one of the following
domains when you need examples:

example.com
example.org
example.net

See http://www.rfc-editor.org/rfc/rfc2606.txt for more information.

--
Mike Cardwell - IT Consultant and LAMP developer
Cardwell IT Ltd. (UK Reg'd Company #06920226) http://cardwellit.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 [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


monkeywebdaemon at googlemail

Jun 29, 2009, 9:05 AM

Post #4 of 6 (531 views)
Permalink
Re: Zeus Subserver Equivalent in Apache2? [In reply to]

2009/6/29 Mike Cardwell <apache-users [at] lists>
>
> Monkey Daemon wrote:
>
>> I'm looking into our options going forward for our web-hosting cluster.
>>
>> We're currently running Zeus Web Server using sub servers.
>>
>> The idea behind webservers is that you can have a directory layout that looks like:
>>
>> /var/www/%HOSTING-PACKAGE-TYPE%/%x%/%x%/%domain-name.tld/html/
>>
>> and the webserver does a lookup for the files in the html directory for each request it recieves.  In the above example, that would mean that for www.icanhazcheezburger.com <http://www.icanhazcheezburger.com> [0] hosted on a Designer Hosting package, the path would expand to
>>
>> /var/www/DesignerHosting/i/c/icanhazcheezburger.com/html/ <http://icanhazcheezburger.com/html/>
>>
>> I know that you can do a similar thing with vhosts, however we need to be able to set different options for each of our hosting packages and I don't appear to be able to specify the package-type restrictions, just server wide which is no good for our hosting platform.
>>
>> If someone can point me in the direction of the correct module(s) to use for this, I'd be very greatful.
>
> I set up a system very similar to what you're describing in a past job. I used mod_rewrites RewriteMap option with the "prg" MapType.
>
> http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritemap
>
> iirc we used suphp to make the perl/php scripts run as the owner of the file.
>
> What differences are there between your different hosting packages that would require vhost level configuration? Perhaps you could set up one virtualhost for each hosting package and stick them on different IPs?

We host over 160,000 sites, I'm not sure if it's a good idea to host
that number across about 4 vhosts (that is the number of hosting
packages we provide!) :)

The main issue that we face is that vhost_alias does not return the
correct document root as a server variable under PHP and we don't want
to end up with a huge number of mod_reqrite rules just to get the
system running...although I do realise that it may well be a trade-off
here.

As an example, a file at
/var/www/DesignerHosting/e/x/example.com/html/test.php with a simple
"echo $_SERVER['DOCUMENT_ROOT']" statement in it will echo the
ServerRoot as set in apache2's httpd.conf (or equivalent depending on
Operating System!) instead of the VirtualDocumentRoot which is set to
/var/www/DesignerHosting/%1.1/%1.2/%1+/html and should expand to
/var/www/DesignerHosting/e/x/example.com/html/ (provided the syntax is
correct!)

The packages work as follows:

Basic: Static HTML,
Legacy: PHP4/mySQL4
Hosting: php5/MySQL5
Designer: php5/Hosting5 but with ability for reselling/sub-domains etc.

So any site that is hosted on the basic offering needs to have
PHP/MySQL switched off, the others need it switched on and the
Reseller account needs to be able to setup sub domains.

>
>> [0] Sadly this domain is not hosted with us, but it seemed like a good example domain to use!
>
> According to RFC 2606 it's best practice to use one of the following domains when you need examples:
>
> example.com
> example.org
> example.net
>
> See http://www.rfc-editor.org/rfc/rfc2606.txt for more information.

Duely noted, I'll use this in future.

Kind regards,

Matt.

---------------------------------------------------------------------
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 [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


chandranshu at gmail

Jul 2, 2009, 12:15 AM

Post #5 of 6 (497 views)
Permalink
Re: Zeus Subserver Equivalent in Apache2? [In reply to]

Hi

Are you running PHP with CGI? If yes, then you can use the
<Directory></Directory> directive blocks and the Options Directive to
optionally allow or disallow execution of PHP scripts. For example, your
basic hosting can have a config:
<Directory /var/www/basic>
Options -ExecCGI <other options>
</Directory>

while for your Hosting package, it can read:
<Directory /var/www/Hosting>
Options +ExecCGI
</Directory>

You can check out http://httpd.apache.org/docs/2.2/sections.html for more
details. You can further support different versions of PHP for your Legacy
and Hosting packages using the AddHandler directive in a similar fashion.

Hope this helps you and all the best!

Regards
Chandranshu

On Mon, Jun 29, 2009 at 9:35 PM, Monkey Daemon <
monkeywebdaemon [at] googlemail> wrote:

> 2009/6/29 Mike Cardwell <apache-users [at] lists>
> >
> > Monkey Daemon wrote:
> >
> >> I'm looking into our options going forward for our web-hosting cluster.
> >>
> >> We're currently running Zeus Web Server using sub servers.
> >>
> >> The idea behind webservers is that you can have a directory layout that
> looks like:
> >>
> >> /var/www/%HOSTING-PACKAGE-TYPE%/%x%/%x%/%domain-name.tld/html/
> >>
> >> and the webserver does a lookup for the files in the html directory for
> each request it recieves. In the above example, that would mean that for
> www.icanhazcheezburger.com <http://www.icanhazcheezburger.com> [0] hosted
> on a Designer Hosting package, the path would expand to
> >>
> >> /var/www/DesignerHosting/i/c/icanhazcheezburger.com/html/ <
> http://icanhazcheezburger.com/html/>
> >>
> >> I know that you can do a similar thing with vhosts, however we need to
> be able to set different options for each of our hosting packages and I
> don't appear to be able to specify the package-type restrictions, just
> server wide which is no good for our hosting platform.
> >>
> >> If someone can point me in the direction of the correct module(s) to use
> for this, I'd be very greatful.
> >
> > I set up a system very similar to what you're describing in a past job. I
> used mod_rewrites RewriteMap option with the "prg" MapType.
> >
> > http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritemap
> >
> > iirc we used suphp to make the perl/php scripts run as the owner of the
> file.
> >
> > What differences are there between your different hosting packages that
> would require vhost level configuration? Perhaps you could set up one
> virtualhost for each hosting package and stick them on different IPs?
>
> We host over 160,000 sites, I'm not sure if it's a good idea to host
> that number across about 4 vhosts (that is the number of hosting
> packages we provide!) :)
>
> The main issue that we face is that vhost_alias does not return the
> correct document root as a server variable under PHP and we don't want
> to end up with a huge number of mod_reqrite rules just to get the
> system running...although I do realise that it may well be a trade-off
> here.
>
> As an example, a file at
> /var/www/DesignerHosting/e/x/example.com/html/test.php with a simple
> "echo $_SERVER['DOCUMENT_ROOT']" statement in it will echo the
> ServerRoot as set in apache2's httpd.conf (or equivalent depending on
> Operating System!) instead of the VirtualDocumentRoot which is set to
> /var/www/DesignerHosting/%1.1/%1.2/%1+/html and should expand to
> /var/www/DesignerHosting/e/x/example.com/html/ (provided the syntax is
> correct!)
>
> The packages work as follows:
>
> Basic: Static HTML,
> Legacy: PHP4/mySQL4
> Hosting: php5/MySQL5
> Designer: php5/Hosting5 but with ability for reselling/sub-domains etc.
>
> So any site that is hosted on the basic offering needs to have
> PHP/MySQL switched off, the others need it switched on and the
> Reseller account needs to be able to setup sub domains.
>
> >
> >> [0] Sadly this domain is not hosted with us, but it seemed like a good
> example domain to use!
> >
> > According to RFC 2606 it's best practice to use one of the following
> domains when you need examples:
> >
> > example.com
> > example.org
> > example.net
> >
> > See http://www.rfc-editor.org/rfc/rfc2606.txt for more information.
>
> Duely noted, I'll use this in future.
>
> Kind regards,
>
> Matt.
>
> ---------------------------------------------------------------------
> 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 [at] httpd
> " from the digest: users-digest-unsubscribe [at] httpd
> For additional commands, e-mail: users-help [at] httpd
>
>


monkeywebdaemon at googlemail

Jul 2, 2009, 1:45 AM

Post #6 of 6 (492 views)
Permalink
Re: Zeus Subserver Equivalent in Apache2? [In reply to]

2009/7/2 Chandranshu . <chandranshu [at] gmail>:
> Hi
>
> Are you running PHP with CGI? If yes, then you can use the
> <Directory></Directory> directive blocks and the Options Directive to
> optionally allow or disallow execution of PHP scripts. For example, your
> basic hosting can have a config:
> <Directory /var/www/basic>
>     Options -ExecCGI <other options>
> </Directory>
>
> while for your Hosting package, it can read:
> <Directory /var/www/Hosting>
>    Options +ExecCGI
> </Directory>
>
> You can check out http://httpd.apache.org/docs/2.2/sections.html for more
> details. You can further support different versions of PHP for your Legacy
> and Hosting packages using the AddHandler directive in a similar fashion.
>
> Hope this helps you and all the best!

Thanks, that looks v. interesting and if we can pair it with the
vhost_alias stuff we might be on to a winner!

Kind regards,

MWD.

---------------------------------------------------------------------
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 [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd

Apache users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.