doc/book/admin/instance-config.rst
changeset 11913 4516c3956d46
parent 11690 15715274a631
equal deleted inserted replaced
11912:c9e6df20e5a4 11913:4516c3956d46
    40     HTTP anonymous connection. CWUser account should exist.
    40     HTTP anonymous connection. CWUser account should exist.
    41 
    41 
    42 :`main.base-url`:
    42 :`main.base-url`:
    43     url base site to be used to generate the urls of web pages
    43     url base site to be used to generate the urls of web pages
    44 
    44 
    45 Https configuration
    45 Apache configuration
    46 ```````````````````
    46 ````````````````````
    47 It is possible to make a site accessible for anonymous http connections
    47 It is possible to use apache (for example) as proxy.
    48 and https for authenticated users. This requires to
       
    49 use apache (for example) for redirection and the variable `main.https-url`
       
    50 of configuration file.
       
    51 
    48 
    52 For this to work you have to activate the following apache modules :
    49 For this to work you have to activate the following apache modules :
    53 
    50 
    54 * rewrite
    51 * rewrite
    55 * proxy
    52 * proxy
    60   a2enmod rewrite http_proxy proxy
    57   a2enmod rewrite http_proxy proxy
    61   /etc/init.d/apache2 restart
    58   /etc/init.d/apache2 restart
    62 
    59 
    63 :Example:
    60 :Example:
    64 
    61 
    65    For an apache redirection of a site accessible via `http://localhost/demo`
    62    For an apache redirection of a site accessible via `http://localhost/demo` while cubicweb is
    66    and `https://localhost/demo` and actually running on port 8080, it
    63    actually running on port 8080:::
    67    takes to the http:::
       
    68 
    64 
    69      ProxyPreserveHost On
    65      ProxyPreserveHost On
    70      RewriteEngine On
    66      RewriteEngine On
    71      RewriteCond %{REQUEST_URI} ^/demo
    67      RewriteCond %{REQUEST_URI} ^/demo
    72      RewriteRule ^/demo$ /demo/
    68      RewriteRule ^/demo$ /demo/
    73      RewriteRule ^/demo/(.*) http://127.0.0.1:8080/$1 [L,P]
    69      RewriteRule ^/demo/(.*) http://127.0.0.1:8080/$1 [L,P]
    74 
    70 
    75    and for the https:::
       
    76 
       
    77      ProxyPreserveHost On
       
    78      RewriteEngine On
       
    79      RewriteCond %{REQUEST_URI} ^/ demo
       
    80      RewriteRule ^/demo$/demo/
       
    81      RewriteRule ^/demo/(.*) http://127.0.0.1:8080/https/$1 [L,P]
       
    82 
       
    83 
    71 
    84    and we will file in the all-in-one.conf of the instance:::
    72    and we will file in the all-in-one.conf of the instance:::
    85 
    73 
    86      base-url = http://localhost/demo
    74      base-url = http://localhost/demo
    87      https-url = https://localhost/demo
       
    88 
    75 
    89 Notice that if you simply want a site accessible through https, not *both* http
       
    90 and https, simply set `base-url` to the https url and the first section into your
       
    91 apache configuration (as you would have to do for an http configuration with an
       
    92 apache front-end).
       
    93 
    76 
    94 Setting up the web client
    77 Setting up the web client
    95 -------------------------
    78 -------------------------
    96 :`web.embed-allowed`:
    79 :`web.embed-allowed`:
    97     regular expression matching sites which could be "embedded" in
    80     regular expression matching sites which could be "embedded" in