Announcement

Collapse
No announcement yet.

ox6-mobile-v2

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ox6-mobile-v2

    Dear OX community,

    In our setup we make use of the ox6-mobile-v2 modules. (for testing etc..) In our setup de OX server is separated from the internet via a Apache2-reverse-proxy (rp.) The apache2 config of this reverse proxy looks like:

    <VirtualHost *:80>
    ServerName webmail.example.com
    ServerAlias webmail
    RewriteEngine on
    RewriteLogLevel 0
    RewriteCond %{SERVER_PORT} !^443$
    RewriteRule ^/(.*) https://%{SERVER_NAME} [L,R]
    </VirtualHost>

    <VirtualHost *:443>
    php_admin_value safe_mode 0
    ServerAdmin netcie@example.com
    SSLEngine on
    SSLProxyEngine on
    SSLCertificateFile /etc/ssl/certs/eigen_certificaten/example.com.pem
    SSLCertificateKeyFile /etc/ssl/private/example.com.key
    SetEnvIf User-Agent ".MSIE*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
    ErrorLog /var/log/apache2/vopen-xchange.error
    CustomLog /var/log/apache2/vopen-xchange.access combined
    ServerName webmail.example.com

    ProxyRequests On
    ProxyVia On
    RewriteEngine On

    RedirectMatch ^/ajax /ajax/
    ProxyPass /ajax/ https://172.19.100.65/ajax/
    ProxyPassReverse /ajax/ https://172.19.100.65/ajax/

    RedirectMatch ^/servlet /servlet/
    ProxyPass /servlet/ https://172.19.100.65/servlet/
    ProxyPassReverse /servlet/ https://172.19.100.65/servlet/

    RedirectMatch ^/infostore /infostore/
    ProxyPass /infostore/ https://172.19.100.65/infostore/
    ProxyPassReverse /infostore/ https://172.19.100.65/infostore/

    RedirectMatch ^/oxadmin /oxadmin/
    ProxyPass /oxadmin/ https://172.19.100.65/ox6/admin/
    ProxyPassReverse /oxadmin/ https://172.19.100.65/ox6/admin/

    RedirectMatch ^/ox6 /ox6/
    ProxyPass /ox6/ https://172.19.100.65/ox6/
    ProxyPassReverse /ox6/ https://172.19.100.65/ox6/

    RedirectMatch ^/funambol /funambol/
    ProxyPass /funambol/ https://172.19.100.65/funambol/
    ProxyPassReverse /funambol/ https://172.19.100.65/funambol/

    RedirectMatch ^/$ /
    ProxyPass / https://172.19.100.65/
    ProxyPassReverse / https://172.19.100.65/
    </VirtualHost>

    and the apache2 config of the OX-server looks like:

    <VirtualHost *:80>
    ServerName vopen-xchange.example.com
    ServerAlias vopen-xchange
    RewriteEngine on
    RewriteLogLevel 0
    RewriteCond %{SERVER_PORT} !^443$
    RewriteRule ^/(.*) https://%{SERVER_NAME} [L,R]
    </VirtualHost>

    <VirtualHost *:443>
    php_admin_value safe_mode 0
    ServerName vopen-xchange.example.com
    ServerAlias vopen-xchange
    SSLEngine on
    SSLCertificateFile /etc/ssl/certs/eigen_certificaten/example.com.pem
    SSLCertificateKeyFile /etc/ssl/private/example.com.key
    SetEnvIf User-Agent ".MSIE*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
    php_flag display_errors off
    Options -Indexes
    ServerAdmin netcie@example.com

    DocumentRoot /var/www/

    <Directory /var/www/>
    AllowOverride None
    Order allow,deny
    allow from all
    RedirectMatch ^/$ /ox6/
    Options +FollowSymLinks +SymLinksIfOwnerMatch
    </Directory>
    # deflate
    AddOutputFilterByType DEFLATE text/html text/plain text/javascript application/javascript text/css text/xml application/xml text/x-js application/x-javascript

    # pre-compressed files
    AddType text/javascript .jsz
    AddType text/css .cssz
    AddType text/xml .xmlz

    AddEncoding gzip .jsz .cssz .xmlz
    SetEnvIf Request_URI "\.(jsz|cssz|xmlz)$" no-gzip

    ExpiresActive On

    <Location /ox6>
    # Expires (via ExpiresByType to override global settings)
    ExpiresByType image/gif "access plus 6 months"
    ExpiresByType image/png "access plus 6 months"
    ExpiresByType image/jpg "access plus 6 months"
    ExpiresByType image/jpeg "access plus 6 months"
    ExpiresByType text/css "access plus 6 months"
    ExpiresByType text/html "access plus 6 months"
    ExpiresByType text/xml "access plus 6 months"
    ExpiresByType text/javascript "access plus 6 months"
    ExpiresByType text/x-js "access plus 6 months"
    ExpiresByType application/x-javascript "access plus 6 months"
    ExpiresDefault "access plus 6 months"
    Header append Cache-Control "private"
    Header unset Last-Modified
    Header unset Vary
    # Strip version
    RewriteEngine On

    RewriteCond %{HTTP_user_agent} ^(DoCoMo|J-PHONE|KDDI|UP.Browser|DDIPOCKET|.*iPhone.*|.*iPod. *|.*BlackBerry.*|.*Windows.CE.*|.*LG.*|.*HTC.*|.*M OT.*|.*Motorola.*|.*Nokia.*|.*Samsung.*|.*SonyEric sson.*|.*Palm.*|.*Symbian.*) [NC]
    RewriteRule (.*) https://vopen-xchange.example.com/ox6-mobile-v2 [R=301]

    RewriteRule v=\w+/(.+) $1 [L]
    # Turn off ETag
    Header unset ETag
    FileETag None
    </Location>

    <Location /ox6/ox.html>
    ExpiresByType text/html "now"
    ExpiresDefault "now"
    Header unset Last-Modified
    Header set Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0"
    # Turn off ETag
    Header unset ETag
    FileETag None
    </Location>

    <Location /ox6/index.html>
    ExpiresByType text/html "now"
    ExpiresDefault "now"
    Header unset Last-Modified
    Header set Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0"
    # Turn off ETag
    Header unset ETag
    FileETag None
    </Location>
    </VirtualHost>

    This work perfectly for the normal OX traffic (e.g. login via the webinterface, read/write email etc..) but the mobile interface keeps complaining with:

    "An error occured

    Error Code: Can't connect to backend. Please check server settings in ox-access.conf"

    The ox-access.conf looks like:

    # change this file and run the command
    # /opt/open-xchange/sbin/update-cache.manifest

    # http://myox.example.com/ajax/
    # *
    # for google maps the app needs access to this address


    (Yes I did issue the command: /opt/open-xchange/sbin/update-cache.manifest /var/www/ox6-mobile-v2/cache.manifest /var/www/ox6-mobile-v2/cache.manifest.in /var/www/ox6-mobile-v2/ox-access.conf)

    Some logging while trying to open the ox6-mobile-v2 site (this logging is NOT the reverse proxy but from the OX-machine!)

    ==> /var/log//open-xchange/open-xchange.log.0 <==
    May 2, 2011 11:53:41 AM com.openexchange.authentication.imap.impl.IMAPAuth entication handleLoginInfo
    INFO: Imap authentication for user robert successful on host mail.example.com:993
    May 2, 2011 11:53:41 AM com.openexchange.login.internal.LoginPerformer logLoginRequest
    INFO: Login:robert IP:172.19.100.16 AuthID:c22bcb368f7a4c86a90f12621e47e41f Agent:Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.16) Gecko/20110323 Ubuntu/10.04 (lucid) Firefox/3.6.16 Clientx.mobileapp(beta_1.0) Interface:HTTP_JSON Context:1(1,defaultcontext) User:1391(robert) Session:ce8a75d00f97444fae14013eedfc4551 Random:7c2e19bfd1934d0d8803254e8bd89df1

    vopen-xchange.example.com:443 172.19.100.16 - - [02/May/2011:11:56:30 +0200] "POST /ajax/login?action=login&client=ox.mobileapp&version=bet a_1.0&modules=true HTTP/1.1" 200 3406 "https://webmail.example.com/ox6-mobile-v2/" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.16) Gecko/20110323 Ubuntu/10.04 (lucid) Firefox/3.6.16"
    vopen-xchange.example.com:443 172.19.100.16 - - [02/May/2011:11:56:36 +0200] "PUT
    /ajax/multiple?session=a454acdc14ee4d50bb0f669dd6ee684e HTTP/1.1" 200 692 "https://webmail.example.com/ox6-mobile-v2/" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.16) Gecko/20110323 Ubuntu/10.04 (lucid) Firefox/3.6.16"
    vopen-xchange.example.com:443 172.19.100.16 - - [02/May/2011:11:56:35 +0200] "POST /ajax/login?action=login&client=ox.mobileapp&version=bet a_1.0&modules=true HTTP/1.1" 200 3406 "https://webmail.example.com/ox6-mobile-v2/" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.16) Gecko/20110323 Ubuntu/10.04 (lucid) Firefox/3.6.16"

    Strange!

    Any ideas are more than welcome!

    Kind regards,

    Robert Nagtegaal.
    Last edited by masikh; 05-02-2011, 12:00 PM.

  • #2
    Hi,

    the error is caused by a status code 0 and an empty response to an ajax call. If you could provide me a log from Firebug I can say something more specific.

    Regards,
    Alexander

    Comment

    Working...
    X