Skip to content

Commit

Permalink
git-svn-id: svn://cherokee-project.com/cherokee/trunk@1992 5dc97367-9…
Browse files Browse the repository at this point in the history
…7f1-0310-9951-d761b3857238
  • Loading branch information
taher committed Sep 15, 2008
1 parent 9b39753 commit 66bc367
Show file tree
Hide file tree
Showing 16 changed files with 124 additions and 51 deletions.
16 changes: 16 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
2008-09-15 Taher Shihadeh <taher@unixwars.com>

* admin/PageStatus.py, admin/ModuleBalancer.py,
admin/PageInfoSource.py: minimal fixes + help updates.

* doc/media/images/admin_handler_fastcgi1.png,
doc/media/images/admin_handler_cgi.png,
doc/media/images/admin_handler_fastcgi2.png,
doc/media/images/admin_info_sources.png: screenshots needed a
refresh.

* doc/config.txt, doc/modules_handlers_cgi.txt,
doc/cookbook_php.txt, doc/modules_handlers_fcgi.txt,
doc/modules_balancers.txt, doc/config_info_sources.txt,
doc/config_status.txt: changes were not reflected since r1915.

2008-09-15 Alvaro Lopez Ortega <alvaro@alobbs.com>

* admin/server.py, admin/Page.py, admin/PageAppServers.py,
Expand Down
10 changes: 5 additions & 5 deletions admin/ModuleBalancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from consts import *

NOTE_BALANCER = 'Allow to select how the connections will be dispatched.'
NO_GENERAL_SOURCES = 'There is none Application Servers configured. Please proceed to configure an <a href="/appserver">Application Server</a>.'
NO_SOURCE_WARNING = 'A load balancer must be confired to use a bare minimum of a single data source. Please, proceed to add at least an one.'
NO_GENERAL_SOURCES = 'There are no Information Sources configured. Please proceed to configure an <a href="/source">Info Source</a>.'
NO_SOURCE_WARNING = 'A load balancer must be configured to use a bare minimum of a single data source. Please, proceed to add at least one.'

class ModuleBalancerGeneric (Module, FormHelper):
def __init__ (self, cfg, prefix, submit_url, name):
Expand Down Expand Up @@ -52,7 +52,7 @@ def _op_render (self):
txt += '<h2>Assign Info Sources</h2>'
if not general_left:
txt += 'It is already balancing among all the configured ' + \
'<a href="/appserver">information sources</a>.'
'<a href="/source">information sources</a>.'
else:
options = [('', 'Choose..')]
for s in general_left:
Expand All @@ -61,9 +61,9 @@ def _op_render (self):

table = TableProps()
self.AddPropOptions (table, "Application Server",
"new_balancer_node", options, "lalalala")
"new_balancer_node", options, "")
txt += str(table)

return txt

def _op_apply_changes (self, uri, post):
Expand Down
6 changes: 5 additions & 1 deletion admin/PageInfoSource.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@
</script>
"""

HELPS = [
('config_info_sources', "Info Sources")
]

class PageInfoSource (PageMenu, FormHelper):
def __init__ (self, cfg):
FormHelper.__init__ (self, 'source', cfg)
PageMenu.__init__ (self, 'source', cfg)
PageMenu.__init__ (self, 'source', cfg, HELPS)
self.submit_url = '/source/'

def _op_handler (self, uri, post):
Expand Down
6 changes: 5 additions & 1 deletion admin/PageStatus.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,13 @@
</div>
"""

HELPS = [
('config_status', "Status")
]

class PageStatus (PageMenu, FormHelper):
def __init__ (self, cfg=None):
PageMenu.__init__ (self, 'status', cfg, [])
PageMenu.__init__ (self, 'status', cfg, HELPS)
FormHelper.__init__ (self, 'status', cfg)

def _op_render (self):
Expand Down
3 changes: 3 additions & 0 deletions doc/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ config_encoding.html \
config_icons.html \
config_mime_types.html \
config_advanced.html \
config_info_sources.html \
config_status.html \
cookbook.html \
cookbook_managing_logs.html \
cookbook_optimizations.html \
Expand Down Expand Up @@ -92,6 +94,7 @@ media/images/admin_dirlist_cherokee.png \
media/images/admin_encoding_gzip.png \
media/images/admin_encoding.png \
media/images/admin_general.png \
media/images/admin_info_sources.png \
media/images/admin_handler_admin.png \
media/images/admin_handler_cgi.png \
media/images/admin_handler_custom_error.png \
Expand Down
5 changes: 4 additions & 1 deletion doc/config.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
== link:index.html[Index] -> Configuration

. link:config_quickstart.html[Quickstart]: Overview and walkthrough.
. link:config_status.html[Status]: Server status information.
. link:config_general.html[General]: General settings.
. link:config_virtual_servers.html[Virtual servers]: Server definition.
- link:config_virtual_servers_rule.html[Rule Options]: Specifying the matching rules.
. link:config_encoding.html[Encoding]: Compression settings.
. link:config_info_sources.html[Info Sources]: Defining information sources.
. link:config_icons.html[Icons]: Icon managment.
. link:config_mime_types.html[Mime Types]: Setting up the MIME types.
. link:config_advanced.html[Advanced]: Advanced tweaking. Not for the faint of heart.


59 changes: 59 additions & 0 deletions doc/config_info_sources.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
== link:index.html[Index] -> link:config.html[Configuration]

Information Sources
-------------------

Every information source to be used by the web server is configured
only once in this section. After that, any virtual server will be able
to use as many as desired without having to set up the same thing over
and over again for every one of the virtual servers.

There are two possible settings as *information sources*:

. *Remote*: Cherokee will simply dispatch the request to the specified
host. As many hosts as needed can be added, and Cherokee will simply
apply the balancing strategy to which the information source is
asinged among them. If for any reason the requests made to these
hosts could not be performed, the processes would simply fail.

. *Local*: As before, many hosts can be specified (despite the name,
the selection is not limited to the localhost). This works the same
way as the previous option. But in this case, if a request cannot be
responded then instead of failing directly a specified command would
be launched before reconnecting to try again. The most common use of
this would be launching the service that should handle the request,
but it is a flexible mechanism that in theory could allow you to
reroute the information to allow you to serve SSH sessions via your
webserver or any other neat tricks you can think of.


Note that because of Cherokee's flexibility and modularity, sometimes
and deppending of the situation one or the other setting might not
make much sense. In such ocasions `cherokee-admin` will simply hide
whatever options do not apply.

image::media/images/admin_info_sources.png[Info Sources]

Unix Sockets
~~~~~~~~~~~~

Note that information sources can be adressed by host:port or directly
through Unix sockets. You only have to specify a full path to the
socket instead of the `host:port`.

For instance an entry such as `/var/tmp/socket-tmp.1` should get
everything to simply work it that was the correct path.


Further insight
~~~~~~~~~~~~~~~

This is the list of currently supported balancing strategies:

* link:modules_balancers_round_robin.html[Round Robin]

And these are the handlers that use balancing:

* link:modules_handlers_fcgi.html[FastCGI]
* link:modules_handlers_scgi.html[SCGI]
* link:modules_handlers_mirror.html[Generic balancer]
10 changes: 10 additions & 0 deletions doc/config_status.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
== link:index.html[Index] -> link:config.html[Configuration]

Status
------

Through this section you will be able to launch and stop the web
server. It also provides some useful information about the server and
the configuration status.

image::media/images/admin_launch.png[Status]
1 change: 0 additions & 1 deletion doc/cookbook_php.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ unset, PHP will take the default value (500), after which it will be
restarted. It is generally a good idea to let PHP be restarted to free
up resources and possible memory leaks.


Note that only FastCGI-enabled binaries of PHP will work with the
FastCGI handler. Many prepackaged versions already enable this by
default. If yours does not, you will need to build a suitable
Expand Down
Binary file modified doc/media/images/admin_handler_cgi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/media/images/admin_handler_fastcgi1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/media/images/admin_handler_fastcgi2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/media/images/admin_info_sources.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 5 additions & 23 deletions doc/modules_balancers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,11 @@ These handlers can be chosen within the
`Handler` tab of the link:config_virtual_servers_rule.html[Rule
Options] section.

When a specific balancing strategy is selected, there are two possible
settings as *information sources*:

. *Remote*: Cherokee will simply dispatch the request to the specified
host. As many hosts as needed can be added, and Cherokee will simply
apply the balancing strategy among them. If for any reason the
requests made to these hosts could not be performed, the processes
would simply fail.

. *Local*: As before, many hosts can be specified (despite the name,
the selection is not limited to the localhost). This works the same
way as the previous option. But in this case, if a request cannot be
responded then instead of failing directly a specified command would
be launched before reconnecting to try again. Te most common use of
this would be launching the service that should handle the request,
but it is a flexible mechanism that in theory could allow you to
reroute the information to allo you to serve SSH sessions via your
webserver or any other neat tricks you can think about.

Note that because of Cherokee's flexibility and modularity, sometimes
and deppending of the situation one or the other setting might not
make much sense. In such ocasions `cherokee-admin` will simply hide
whatever options do not apply.
Every balancing strategy is used to manage one or more
link_config_info_sources.html[information sources], so at least one
has to be added to the pool managed by the balancer. To do this,
simply choose among the available sources in the `Assign Info
Sources`.

This is the list of currently supported balancing strategies:

Expand Down
3 changes: 1 addition & 2 deletions doc/modules_handlers_cgi.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ Examples
~~~~~~~~

This is a pretty common example. It defines a directory called `cgi`
which points to a path out of the Sever root directory where the
that points to a path out of the Sever root directory where the
CGI programs are located.

image::media/images/admin_handler_cgi.png[CGI]

28 changes: 11 additions & 17 deletions doc/modules_handlers_fcgi.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ reduced overhead. It is basically the same thing as CGI but *much
faster*.

This module accepts all the general
link:modules_handlers_cgi.html[CGI] parameters. Aside, it needs a
balancer to be configured. It is the piece of configuration that
points the handler where to find the FastCGI servers.
link:modules_handlers_cgi.html[CGI] parameters. It needs a balancer to
be configured besides that. It is the piece of configuration that
points to the handler where to find the FastCGI servers.

For most of the cases there will be only one FastCGI server though. In
that scenario the way to go would be to configure the handler to use a
Expand All @@ -25,23 +25,15 @@ Parameters
~~~~~~~~~~

To set up the general gateway options, read about the common
parameters shared with the link:modules_handlers_cgi.html[CGI] handler.
parameters shared with the link:modules_handlers_cgi.html[Common CGI
options] handler. All of them apply with the exception of `Check
file`, which will only be present if the manager is handling an
extension.

To set up the balancing options read the
To set up the FastCGI specifics, read the
link:modules_balancers.html[Balancers] section for general information
and the link:modules_balancers_round_robin.html[Round robin] section
for specifics.


Unix Sockets
~~~~~~~~~~~~

Note that the FastCGI and SCGI handlers can directly use Unix
sockets. You only have to specify a full path to the socket instead of
the `host:port`.

For instance an entry such as something like `/var/tmp/socket-tmp.1`
should get everything to simply work it that was the correct path.
for more details.


Examples
Expand All @@ -51,6 +43,8 @@ examples on how to configure this
handler. The recipe about link:cookbook_php.html[setting up PHP] is a
good starting point.

image::media/images/admin_handler_fastcgi1.png[FastCGI]


Note for developers
~~~~~~~~~~~~~~~~~~~
Expand Down

0 comments on commit 66bc367

Please sign in to comment.