Changes between Version 12 and Version 13 of InstallationGuidelines/Linux/Server/ApacheMySQL


Ignore:
Timestamp:
10/28/11 13:19:54 (10 years ago)
Author:
Fran Boon
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • InstallationGuidelines/Linux/Server/ApacheMySQL

    v12 v13  
    248248echo $sitename >  $filename
    249249
    250 # Update system (in case run at a much later time than the install script)
     250# -----------------------------------------------------------------------------
     251# Email
     252# -----------------------------------------------------------------------------
     253echo configure for Internet mail delivery
     254dpkg-reconfigure exim4-config
     255
     256# -----------------------------------------------------------------------------
     257# Update system
     258#   in case run at a much later time than the install script
     259# -----------------------------------------------------------------------------
    251260apt-get update
    252261apt-get upgrade -y
     
    257266
    258267# -----------------------------------------------------------------------------
     268# Apache Web server
     269# -----------------------------------------------------------------------------
     270echo "Setting up Web server"
     271
     272rm -f /etc/apache2/sites-enabled/000-default
     273cat << EOF > "/etc/apache2/sites-available/$hostname.$DOMAIN"
     274<VirtualHost *:80>
     275  ServerName $hostname.$DOMAIN
     276  ServerAdmin webmaster@$DOMAIN
     277  DocumentRoot /home/web2py/applications
     278
     279  WSGIScriptAlias / /home/web2py/wsgihandler.py
     280  ## Edit the process and the maximum-requests to reflect your RAM
     281  WSGIDaemonProcess web2py user=web2py group=web2py home=/home/web2py processes=4 maximum-requests=100
     282
     283  RewriteEngine On
     284  # extract desired cookie value from multiple-cookie HTTP header
     285  RewriteCond %{HTTP_COOKIE} registered=([^;]+)
     286  # check that cookie value is correct
     287  RewriteCond %1 ^yes$
     288  RewriteRule ^/$ /eden/ [R,L]
     289  RewriteRule ^/$ /eden/static/index.html [R,L]
     290  RewriteCond %{REQUEST_URI}    !/phpmyadmin(.*)
     291  RewriteCond %{REQUEST_URI}    !/eden/(.*)
     292  RewriteRule /(.*) /eden/$1 [R]
     293
     294  ### static files do not need WSGI
     295  <LocationMatch "^(/[\w_]*/static/.*)">
     296    Order Allow,Deny
     297    Allow from all
     298   
     299    SetOutputFilter DEFLATE
     300    BrowserMatch ^Mozilla/4 gzip-only-text/html
     301    BrowserMatch ^Mozilla/4\.0[678] no-gzip
     302    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
     303    SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
     304    Header append Vary User-Agent env=!dont-vary
     305
     306    ExpiresActive On
     307    ExpiresByType text/html "access plus 1 day"
     308    ExpiresByType text/javascript "access plus 1 week"
     309    ExpiresByType text/css "access plus 2 weeks"
     310    ExpiresByType image/ico "access plus 1 month"
     311    ExpiresByType image/gif "access plus 1 month"
     312    ExpiresByType image/jpeg "access plus 1 month"
     313    ExpiresByType image/jpg "access plus 1 month"
     314    ExpiresByType image/png "access plus 1 month"
     315    ExpiresByType application/x-shockwave-flash "access plus 1 month"
     316  </LocationMatch>
     317  ### everything else goes over WSGI
     318  <Location "/">
     319    Order deny,allow
     320    Allow from all
     321    WSGIProcessGroup web2py
     322  </Location>
     323
     324  ErrorLog /var/log/apache2/$hostname_error.log
     325  LogLevel warn
     326  CustomLog /var/log/apache2/$hostname_access.log combined
     327</VirtualHost>
     328EOF
     329a2ensite "$hostname.$DOMAIN"
     330apache2ctl restart
     331
     332cat << EOF > "/etc/apache2/sites-available/maintenance"
     333<VirtualHost *:80>
     334  ServerName $hostname.$DOMAIN
     335  ServerAdmin webmaster@$DOMAIN
     336  DocumentRoot /var/www
     337
     338  RewriteEngine On
     339  RewriteCond %{REQUEST_URI} !/phpmyadmin(.*)
     340  RewriteRule ^/(.*) /maintenance.html
     341
     342  <Location "/">
     343    Order deny,allow
     344    Allow from all
     345  </Location>
     346
     347  ErrorLog /var/log/apache2/maintenance_error.log
     348  LogLevel warn
     349  CustomLog /var/log/apache2/maintenance_access.log combined
     350</VirtualHost>
     351EOF
     352
     353# -----------------------------------------------------------------------------
    259354# MySQL Database
    260355# -----------------------------------------------------------------------------
     
    282377
    283378# -----------------------------------------------------------------------------
    284 # Email
    285 # -----------------------------------------------------------------------------
    286 echo configure for Internet mail delivery
    287 dpkg-reconfigure exim4-config
    288 
    289 # -----------------------------------------------------------------------------
    290379# Sahana Eden
    291380# -----------------------------------------------------------------------------