Oproxy.conf
From ISPWiki
By default the oProxy, oproxyctl, clusterctl, sitesctl and clusterlogs utilities search for the configuration file in /usr/local/ispmgr/etc/oproxy.conf. It has two kinds of records:
- Parameter that the name and value, and is specified as Param parameter_name "value"
- What to listened. Its values have the protocol type and the socket to listen.
- Events that have names and list of scripts.
Contents |
Parameters
The following parameters are available (with default values):
Paths
Param site_disabled_file "/usr/local/ispmgr/etc/cluster_site_disabled.html"
Which page to return, if a suspended site was requested. The file contains the __SITE__ macro that is changed into the host name.
Param site_not_found_file "/usr/local/ispmgr/etc/cluster_site_not_found.html"
Which page to return, if a non existent site was requested. The file contains the __SITE__ macro that is changed into the host name.
Param sites_list_file "/usr/local/ispmgr/etc/cluster_sites.conf"
The configuration file listing cluster sites. More information can be found in cluster_sites.conf.
Param nodes_list_file "/usr/local/ispmgr/etc/cluster_nodes.conf"
The configuration file describing cluster nodes. More information can be found in cluster_nodes.conf
Param command_socket "/tmp/oproxy.sock"
The path to the oProxy socket. See also oproxyctl.
Param log_file "/var/log/oproxy.log"
The log file.
Param traffic_log_file "/usr/local/ispmgr/var/oproxy-traf.log"
Traffic/load statistics. The log_statistics_period parameter specifies how often the statistical information should be resetted.
Param mime_types_file "/etc/mime.types"
The path to the file describing files extensions and corresponding MIME-types.
Param apache_configs_dir "/etc/apache2/users-conf.d"
The directory where configuration files of the user's virtual hosts are located.
Param apache_binary "/usr/sbin/apache2"
The path to the executable file of the Apache web-server.
Time-out, intervals
Param log_statistics_period "0"
Defines how often traffic statistics should be resetted (in seconds). 0 means "never".
Param keepalive_http "5"
Defines the interval in seconds that should pass until the next request from a HTTP-client without breaking a connection.
Param keepalive_http_backend "60"
Defines the time to wait for the HTTP-backend to read or log.
Param keepalive_mysql "120"
Define the time in seconds to wait for a MySQL-client to request.
Param keepalive_mysql_backend "600"
Defines the time to wait for the MySQL-backend to read or log.
Param log_status_file "/home/httpd-logs/log.status"
The file where the information about web-server log files will be located. It is required for clusterlogs.
Processing connections
oProxy can listen several sockets simultaneously. Following is a socket configuration:
Listen the "socket" type
The following types are available:
- mysql — emulates a MySQL-server
- http — emulates a HTTP-server
- cluster — special protocol for running commands on the server.
- clusterstat — special protocol for creating a centralized statistics server
The socket may be as follows:
- "/tmp/mysql.sock" — listen the UNIX-socket"/tmp/mysql.sock"
- "12.34.56.78:80" — listen the TCP-socket on IP 12.34.56.78 on port 80
- "0.0.0.0:80" — listen all the IP-addresses on port 80
For example:
Listen mysql "0.0.0.0:3306" Listen mysql "/var/run/mysqld/mysqld.sock" Listen mysql "/tmp/mysql.sock" Listen http "0.0.0.0:80" Listen cluster "0.0.0.0:654"
Customizing backend servers
Param backend_http_sleep "10"
Defines the number of seconds in which a HTTP-server is marked as dead, if one has failed to connect to it.
Param backend_mysql_sleep "10"
Defines the number of seconds in which a MySQL-server is marked as dead, if one has filed to connect to it.
Param mysql_prioritized_nodes "0"
Use priorities of the MySQL nodes. If a current server (with the maximum priority) fails, the one with lower priority will be used. More information can be found cluster_nodes.conf
Param http_percentage_of_errors "50"
If the percentage of requests with status 5xx from a web-server exceeds the specified number, the web-server will be considered dead.
Param http_errors_watch_interval "30"
The backend error log will be resetted in the specified number of seconds. Thus, the percent from the http_percentage_of_errors parameter will be applied only to current statistics.
Param http_errors_down_sleep "10"
The number of seconds at which a HTTP server will be marked as down, if it experienced too many errors. See also http_percentage_of_errors and http_errors_watch_interval.
Log parameters
Param log_http_host_not_found "1"
Log the information concerning requests to non existent sites.
Param log_http_host_disabled "0"
Log the information concerning requests to disabled sites.
Param log_http_protocol_errors "0"
Log the HTTP protocol errors.
Param log_mysql_user "-"
Log debugging information concerning requests from a specified MySQL-user. Leaving the line blank will log debugging information up to user authorization.
Caching descriptors
Param fhcache_size "0"
The number of file descriptors of static files that each worker process should cache.
Param fhcache_timeout "30"
The maximum number of seconds in which to invalidate the cached file descriptor. After this time-out, the file will be re-open.
Other parameters
Param worker_count "2"
The number of worker processes to start.
Param master_password "password"
The password for incoming connections via cluster or clusterstat connection type.
Param direct_send_regexp "^$"
Regular expression that describes file URIs that can be sent directly. By default the files cannot be sent directly.
Param default_mime_type "application/binary"
Default MIME-type that will be used for files if a corresponding extension was not found in the file specified in the mime_types_file parameter.
Param direct_send_min_uid "1000"
Minimum file's UID that that you can send directly
Param use_sendfile "1"
Whether to call the kernel sendfile() to send static information. It will considerably reduce use of CPU when sending files directly.
Param accept_http_ranges "1"
Allow to swap files that are sent directly (the "Range" HTTP heading). Only one range in one request is supported:
- Range: bytes=100-199 — supported (request 100 bytes from the middle of a file)
- Range: bytes=200- — supported (request from the 200th byte to the end)
- Range: bytes=-10 — supported (request the last 10 bytes of a file)
- Range: bytes=10-20,30-40 — not supported
Param max_http_cache_age "86400"
The number of minutes in which browsers and remote proxy-servers can cache directly created files.
Param max_mysql_query_length_save "200"
The number of initial bytes of a MySQL-request that should be specified in the log. See OpQL.
Param update_logs_period "5"
The number of seconds in which the clusterlogs should send changes that were made to Apache logs to a server.
Param logs_server "IP:port"
The address and port on which oProxy listens the cluster type connection. clusterlogs will send the changes that were made to Apache logs.
Param max_open_http_logs "256"
The maximum number of site log files that a oProxy worker process will keep open.
Param max_open_files "1024"
The maximum number of open file descriptors per worker process.
Param bind_interface "eth0"
The interface to which oproxyctl will bind IP-addresses that are required for web-servers.
Param exec_on_start ...
You may specify commands in OpQL that will run once oProxy is started. More information can be found in OpQL and oproxyctl.
Param dump_file "/usr/local/ispmgr/var/rules.dump"
Allow to store and restore the 'reset' and 'query' rules when stopping and starting oProxy correspondingly.
