Apache Configuration Guide

From CTRNet Wiki
Jump to: navigation, search

This guide will walk you through the configurations required to run ATiM on Apache. It is assumed that you have already installed it and configured it to work with PHP. Note that the steps detailed above are known to work. There might be unnecessary steps.

Contents

Basic Server configuration

Don't forget to restart the server after these setup steps.

php.ini

  LoadModule rewrite_module modules/mod_rewrite.so
  ;;;;;;;;;;;;;;;;;;;
  ; Resource Limits ;
  ;;;;;;;;;;;;;;;;;;;
  
  max_execution_time = 90     ; 90 seconds should be enough to run the majority of queries
  memory_limit = 128M         ; 128M should be enough to run the majority of queries
  ;;;;;;;;;;;;;;;;;;
  ; Fopen wrappers ;
  ;;;;;;;;;;;;;;;;;;
  
  ; If your scripts have to deal with files from Macintosh systems,
  ; or you are running on a Mac and need to deal with files from
  ; unix or win32 systems, setting this flag will cause PHP to
  ; automatically detect the EOL character in those files so that
  ; fgets() and file() will work regardless of the source of the file.
  auto_detect_line_endings = On

Alias Creation

The following lines are included into this document to help system installation but they don't have necessarily to be applied: The creation of an alias facilitates the ATiM installation but should not necessarily be used.

In the following example:

  • Application directories and code files are stored into application directory '/ATiM/www/'.
  • The root of the web server is '/var/www/'.
  • The URL to launch ATiM will be the following link 'https://*.*.*.*/ATiM/'.

httpd.conf Modification

 Alias /ATiM "/ATiM/www/"
 
 <Directory "/ATiM/www">
         Options -Indexes FollowSymLinks MultiViews ExecCGI
         AllowOverride ALL
         Order allow,deny
         Allow from all
 </Directory>

.htaccess Files Modification

  • /ATiM/www/.htaccess
 <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule    ^$ /ATiM/app/webroot/    [L]
    RewriteRule    (.*) /ATiM/app/webroot/$1 [L]
 </IfModule> 
  • /ATiM/www/app/.htaccess
 <IfModule mod_rewrite.c>
     RewriteEngine on
     RewriteRule    ^$    /ATiM/app/webroot/    [L]
     RewriteRule    (.*) /ATiM/app/webroot/$1    [L]
 </IfModule>
  • /ATiM/www/app/webroot/.htaccess
 <IfModule mod_rewrite.c>
     RewriteEngine On
     RewriteCond %{REQUEST_FILENAME} !-d
     RewriteCond %{REQUEST_FILENAME} !-f
     RewriteRule ^(.*)$ /ATiM/app/webroot/index.php?url=$1 [QSA,L]
 </IfModule>

Troubleshoot

If you are getting this error: Fatal error: Cannot redeclare config() (previously declared in /var/www/html/cake/basics.php: ... then verify that mod_rewrite is activated. This link provides instructions.

Personal tools