Changes between Initial Version and Version 1 of ApacheSetup


Ignore:
Timestamp:
05/12/09 12:53:59 (4 years ago)
Author:
vik
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ApacheSetup

    v1 v1  
     1Apache can rewrite URIs to make prettier URIs than the zope default. You can also set up name based !VirtualHosts. So you can transform your plumi site's URI from http://your.server:8080/my-plumi-site to http://plumi.your.server  
     2 
     3== Basic apache config w/ seperate flv !VirtualHost == 
     4A basic apache site config would look like this - you will need to change the commented sections, the name, and maybe the logfile locations. If you are using indytube for flash video playback, you will also need to create a separate !VirtualHost to host those files. 
     5{{{ 
     6<VirtualHost *:80> 
     7    ServerName plumi.some.domain.com 
     8    ServerAdmin webmaster@some.domain.com 
     9    
     10    <Directory /> 
     11      Options FollowSymLinks 
     12      AllowOverride None 
     13      Order allow,deny 
     14#      Deny from none 
     15      Allow from all 
     16    </Directory> 
     17 
     18    <Location /> 
     19      Order Allow,Deny 
     20      Deny from none 
     21      Allow from all 
     22    </Location> 
     23 
     24 
     25 
     26    ErrorLog /var/log/apache2/plumi-error.log 
     27 
     28    LogLevel warn 
     29 
     30    CustomLog /var/log/apache2/plumi-access.log combined  
     31    ServerSignature On 
     32     
     33    RewriteEngine On 
     34 
     35    # Normalize URLs by removing trainling /'s 
     36    RewriteRule ^/(.*)/$ http://127.0.0.1:8080/VirtualHostBase/http/%{SERVER_NAME}:80/plumi/VirtualHostRoot/$1 [L,P] 
     37    #                                     ^^^^                                        ^^^^^ 
     38    #                  port number Zope is running on                  ID of plone site when you first created it 
     39    #                                                            (e.g. http://localhost:8080/plumi - ID is 'plumi') 
     40     
     41    # Pass all other URLs straight through 
     42    RewriteRule ^/(.*)$ http://127.0.0.1:8080/VirtualHostBase/http/%{SERVER_NAME}:80/plumi/VirtualHostRoot/$1 [L,P] 
     43    #                                    ^^^^                                        ^^^^^ 
     44    #                  port number Zope is running on                  ID of plone site when you first created it 
     45    #                                                            (e.g. http://localhost:8080/plumi - ID is 'plumi') 
     46 
     47</VirtualHost> 
     48}}} 
     49 
     50== Combined config with Zope and flv on same !VirtualHost == 
     51Another option is to use the same !VirtualHost to host the flv files and redirect to the plone site. This can be useful for localised installs without a DNS server, as the plumi site could be accessed purely by IP address. In this case you would have to change the rest of the apache config to handle IP based virtual hosts (or no virtual hosts at all) rather than name virtual hosts.  
     52{{{ 
     53<VirtualHost *:80> 
     54    ServerName plumi.some.domain.com 
     55    ServerAdmin webmaster@some.domain.com 
     56    
     57    <Directory /> 
     58      Options FollowSymLinks 
     59      AllowOverride None 
     60      Order allow,deny 
     61#      Deny from none 
     62      Allow from all 
     63    </Directory> 
     64 
     65    <Location /> 
     66      Order Allow,Deny 
     67      Deny from none 
     68      Allow from all 
     69    </Location> 
     70 
     71 
     72    # A place to put flv files - this can be anywhere as long as the URI for the dir 
     73    # matches the URI for the RewriteCond statements below. 
     74    Alias /plumi-flv "/var/www/plumi-flv/" 
     75    <Directory "/var/www/plumi-flv"> 
     76      Options FollowSymLinks 
     77      AllowOverride None 
     78      Order allow,deny 
     79      Allow from all 
     80    </Directory> 
     81 
     82    ErrorLog /var/log/apache2/plumi-error.log 
     83 
     84    LogLevel warn 
     85 
     86    CustomLog /var/log/apache2/plumi-access.log combined  
     87    ServerSignature On 
     88     
     89    RewriteEngine On 
     90    #RewriteLog "/var/log/apache2/plumi-rw.log" 
     91    #RewriteLogLevel 3 
     92 
     93    RewriteCond %{REQUEST_URI} !^/plumi-flv 
     94    #                             ^^^^^^^^^   
     95    # This should be the same as the URI to the Alias/Directory set above 
     96 
     97    # Normalize URLs by removing trainling /'s 
     98    RewriteRule ^/(.*)/$ http://127.0.0.1:8080/VirtualHostBase/http/%{SERVER_NAME}:80/plumi/VirtualHostRoot/$1 [L,P] 
     99    #                                     ^^^^                                        ^^^^^ 
     100    #                  port number Zope is running on                  ID of plone site when you first created it 
     101    #                                                            (e.g. http://localhost:8080/plumi - ID is 'plumi') 
     102     
     103    RewriteCond %{REQUEST_URI} !^/plumi-flv 
     104    #                             ^^^^^^^^^ 
     105    # This should be the same as the URI to the Alias/Directory set above 
     106 
     107    # Pass all other URLs straight through 
     108    RewriteRule ^/(.*)$ http://127.0.0.1:8080/VirtualHostBase/http/%{SERVER_NAME}:80/plumi/VirtualHostRoot/$1 [L,P] 
     109    #                                    ^^^^                                        ^^^^^ 
     110    #                  port number Zope is running on                  ID of plone site when you first created it 
     111    #                                                            (e.g. http://localhost:8080/plumi - ID is 'plumi') 
     112 
     113</VirtualHost> 
     114}}}