Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Rogō should run on any LAMP stack without modification however there are some configuration task which need to be undertaken to ensure smooth operation under load.

 

Expand
titleFile System Permissions

Most directories in Rogō should be set up to be writable by the owner only:

drwxr-xr-x

Exceptions to this rule include the following directories which need to allow higher write privilages:

  • `<rogo-dir>/help/staff/images`
  • `<rogo-dir>/help/student/images`
  • `<rogo-dir>/media`
  • `<rogo-dir>/email_templates`
  • `<rogo-dir>/qti/imports`
  • `<rogo-dir>/qti/exports`
  • `<rogo-dir>/config` - for installation only, so that config.inc.php can be written. This should be changed back to being writeable by the owner only after installation.
  • `<rogo-dir>/users/photos`
  • `/tmp`

For these writable directories the permissions should be set to drwxrwxr-x for the user that Apache runs as.

Note:
The path to the temporary directory (e.g. /tmp) is configurable in /config/config.inc.php.

Expand
titleApache Settings

Optimising apache can be a specialised task so if you have an apache expert/expereinced sysadmin please consult with them.

Server prefork settings

The settings for apache adjust how many processess are listening and how many spare threads are available (As of writing this document running php as a module in apache is only recommended for the prefork configuration of apache). For small scale tests then the default apache settings are acceptable, but to increase performance then the numbers should be increased (this will usually use more ram as these are extra processess). It is recommended to increase the minumum spare servers & the start servers (as this will improve the initial start from when the users arrive at the page as it can cope with more simultaneous requests) This is directly related to how much RAM is used

For more info about this please go and read the Apache documentation.

Server prefork settings from a basic apache config from a default install of apache in Centos 6.2 

Code Block
languagebash
StartServers       8
MinSpareServers    5
MaxSpareServers   20
ServerLimit      256
MaxClients       256
MaxRequestsPerChild  4000
 

An example from a university of Nottingham Apache config for prefork settings 

Code Block
languagebash
StartServers         50
MaxClients          150
MinSpareThreads      25
MaxSpareThreads      75 
ThreadsPerChild      25
MaxRequestsPerChild   0

 

Security related configuration

As a minimum Apache should be configured with the following to prevent access to sensitive files

Code Block
languagebash
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy All
</FilesMatch>

#The following lines prevent .inc files files from being
# viewed by Web clients.
<FilesMatch "\.inc$">
    Order allow,deny
    Deny from all
    Satisfy All
</FilesMatch>
Expand
titleMySQL Settings

If you have a MySQL Expert or database administrator you are recommended to contact them for advice first as optimizing MySQL is an 'art'. The basic default installation config should work in small settings. It is best to increase the key_buffer (the settings do depend upon your exact conditions) then make sure that the query cache is increased. You would be recommended to have a read of the MySQL documentation. The my-large.cnf should be suitable for most configurations (this should be supplied with mysql maybe in the examples directory).

An example MySQL my.cnf segment from Univesity University of Nottingham: 

Code Block
languagebash
[mysqld]
ft_min_word_len=3
key_buffer = 384M
max_allowed_packet = 16M
thread_stack = 256K
thread_cache_size = 8
max_connections = 500
query-cache-type = 1
query_cache_limit = 5M
query_cache_size = 500M
max_heap_table_size = 536870912
tmp_table_size = 536870912
table_open_cache = 2500

#innoDB options
innodb_buffer_pool_size = 2000M
innodb_additional_mem_pool_size = 200M
innodb_log_buffer_size = 5M
innodb_flush_log_at_trx_commit = 1 // or 2 on server with slow IO 
innodb_lock_wait_timeout = 50

#binlogs on is recommended
log-bin=mysql-bin
binlog_format=mixed

[mysqldump]
quick
max_allowed_packet = 24M

 

On systems with networked file storage (SANS) with slow disk IO times considerer using:

Code Block
 
languagebash
innodb_flush_log_at_trx_commit = 2 //default value = 1 
 

See 'adaptive flushing' for a description of the consequence.

Expand
titlePHP Settings

Below are some of the settings which may need to be altered from their default values:

Code Block
 
languagebash
max_execution_time = 120
memory_limit = 512M
post_max_size = 20M
upload_max_filesize = 20M
default_charset = "utf-8"
mbstring.internal_encoding = UTF-8
max_input_vars = 3000
(available from PHP 5.3.9)

Installation

Extract Rogō into the web root and visit 'https://[YOUR_HOST_NAME]/install/index.php'. This will check your installation and create the appropriate databases and users.

...