Roundcube 500 error after upgrade t0 3.0.5.1

Discussion in 'Installation/Configuration' started by Captain, Feb 28, 2013.

  1. Captain

    Captain Member

    Hello!

    When I upgrade my ISP 3.0.4.6 to 3.0.5.1 on Debian6
    Roundcube stop working.
    in error.log:

    Code:
    SoftException in Application.cpp:221: File "/usr/share/roundcube/index.php" is not in document root of Vhost "/var/www/ispconfig/" 
    Premature end of script headers: index.php
    
    In apache2/conf.d I have symlink file to apache.conf for roundcube

    Code:
    # Those aliases do not work properly with several hosts on your apache server
    # Uncomment them to use it or adapt them to your configuration
    #    Alias /roundcube/program/js/tiny_mce/ /usr/share/tinymce/www/
        Alias /webmail /var/lib/roundcube
        Alias /roundcube /var/lib/roundcube
    
    # Access to tinymce files
    <Directory "/usr/share/tinymce/www/">
          Options Indexes MultiViews FollowSymLinks
          AllowOverride None
          Order allow,deny
          allow from all
    </Directory>
    
    <Directory /var/lib/roundcube/>
      Options +FollowSymLinks
      # This is needed to parse /var/lib/roundcube/.htaccess. See its
      # content before setting AllowOverride to None.
      AllowOverride All
      order allow,deny
      allow from all
    </Directory>
    
    # Protecting basic directories:
    <Directory /var/lib/roundcube/config>
            Options -FollowSymLinks
            AllowOverride None
    </Directory>
    
    <Directory /var/lib/roundcube/temp>
            Options -FollowSymLinks
            AllowOverride None
            Order allow,deny
            Deny from all
    </Directory>
    
    <Directory /var/lib/roundcube/logs>
            Options -FollowSymLinks
            AllowOverride None
            Order allow,deny
            Deny from all
    </Directory>
    
    
    <IfModule mod_rewrite.c>
      <IfModule mod_ssl.c>
        <Location /webmail>
          RewriteEngine on
          RewriteCond %{HTTPS} !^on$ [NC]
          RewriteRule . https://%{HTTP_HOST}:8080%{REQUEST_URI}  [L]
    
        </Location>
      </IfModule>
    
    <IfModule mod_rewrite.c>
      <IfModule mod_ssl.c>
        <Location /roundcube>
          RewriteEngine on
          RewriteCond %{HTTPS} !^on$ [NC]
          RewriteRule . https://%{HTTP_HOST}:8080%{REQUEST_URI}  [L]
        </Location>
      </IfModule>
    </IfModule>
    
    
    
    How can I solve it?

    Thank you.
     
    Last edited: Feb 28, 2013
  2. Captain

    Captain Member

    I reinstall roundcube - and still the same problem.
    In log file same errors.

    What to do?
     
  3. Captain

    Captain Member

    Problem is solved by disable suphp.
    But it is not a solution.

    Some one solved this problem another way?
     
  4. trexen

    trexen Member

    How did you disable suphp ?

    did you install roundqube under a site? i have installed roundqube under /var/www/webamil and don know how to disable suphp, help plz

    rgds
    Marcus
     
    Last edited: Mar 1, 2013
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    Which Linux distribution do you use?
     
  6. trexen

    trexen Member

    Sorry, Debian Squeeze 6 isp 3.5.1 latest
     
  7. Captain

    Captain Member

    Hello I install it under /var/www/webmail

    to disable suphp:

    a2dismod suphp
    /etc/init.d/apache2 restart


    But as I told here, in my opinion it is not a solution.
    because i try to add it to open_base dir, try to modify htaccess but problemm still not solved.
    Need to ask Till or Falko because it is ISPCOnfig issue.

    Thank you.
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer


    Which URL do you use to access roundcube? Dont use port 8080 to access any software beside ispconfig, for other softeware there is a apps vhost which is on port 8081 by default.
     
  9. Captain

    Captain Member

    Hello Till!

    To access to roundcube in past (on ISPCOnfig 3.0.4.6) we use https://doamin.com:8080/webmail

    Now without suphp we also use this link.

    As I correct understand you, now I need to reconfigure apache conf to use port 8081 for roundcube?
    Correct link should be https://domain.com:8081/webmail

    Code:
    <IfModule mod_rewrite.c>
      <IfModule mod_ssl.c>
        <Location /webmail>
          RewriteEngine on
          RewriteCond %{HTTPS} !^on$ [NC]
          RewriteRule . https://%{HTTP_HOST}:8081%{REQUEST_URI}  [L]
        </Location>
      </IfModule>
    </IfModule>
    
    Correct?
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes.

    But you dont have to deactivate suphp, instead you can also configure roundcube to use mod_php by using a setup similar to the one that we describe in the perfect server guides for squirrelmail.

    For everyone who wants to deactivate suphp for global applications like webmail:

    edit the file /etc/apache2/mods-available/suphp.conf and comment out the directives as described inside chapter 14:

    http://www.howtoforge.com/perfect-server-ubuntu-12.10-apache2-bind-dovecot-ispconfig-3-p4

    the procedire should work for Ubuntu and Debian Linux. Then restart apache.
     
  11. trexen

    trexen Member

    My suphp.conf
    i did have squrillelmail installed before roundqube.
    is this file correct?



    <IfModule mod_suphp.c>
    AddType application/x-httpd-suphp .php .php3 .php4 .php5 .phtml
    suPHP_AddHandler application/x-httpd-suphp

    <Directory />
    suPHP_Engine on
    </Directory>


    # By default, disable suPHP for debian packaged web applications as files
    # are owned by root and cannot be executed by suPHP because of min_uid.
    <Directory /usr/share>
    suPHP_Engine off
    </Directory>

    # # Use a specific php config file (a dir which contains a php.ini file)
    # suPHP_ConfigPath /etc/php4/cgi/suphp/
    # # Tells mod_suphp NOT to handle requests with the type <mime-type>.
    # suPHP_RemoveHandler <mime-type>
    </IfModule>

    //M
     
  12. beyerservice

    beyerservice Member HowtoForge Supporter

    for someone found this after searching google for that error:

    Solution:
    Add red-Lines if not in your roundcube.conf file.
    [...]
    <Directory /var/www/roundcubemail>
    Options FollowSymLinks

    <IfModule mod_php5.c>
    AddType application/x-httpd-php .php
    php_flag magic_quotes_gpc Off
    php_flag track_vars On
    php_admin_flag allow_url_fopen Off
    php_value include_path .
    php_admin_value upload_tmp_dir /var/www/roundcubemail/temp
    php_admin_value open_basedir /var/www/roundcubemail:/etc/hostname:/etc/mailname
    php_flag register_globals off
    </IfModule>



     
  13. JeffryL

    JeffryL Member

    Installed roundcube on Ubuntu 12.04 by:

    Code:
    apt-get install roundcube
    Code:
    dpkg-reconfigure roundcube-core
    I added this lines to apps.vhost:

    Code:
      # SSL Configuration
      SSLEngine On
      SSLCertificateFile /usr/local/ispconfig/interface/ssl/ispserver.crt
      SSLCertificateKeyFile /usr/local/ispconfig/interface/ssl/ispserver.key
      #SSLCACertificateFile /usr/local/ispconfig/interface/ssl/ispserver.bundle
    This is my roundcube.conf:

    Code:
    # Those aliases do not work properly with several hosts on your apache server
    # Uncomment them to use it or adapt them to your configuration
    #    Alias /roundcube/program/js/tiny_mce/ /usr/share/tinymce/www/
        Alias /webmail /var/lib/roundcube
        Alias /roundcube /var/lib/roundcube
    
    # Access to tinymce files
    <Directory "/usr/share/tinymce/www/">
          Options Indexes MultiViews FollowSymLinks
          AllowOverride None
          Order allow,deny
          allow from all
    </Directory>
    
    <Directory /var/lib/roundcube/>
      Options +FollowSymLinks
      # This is needed to parse /var/lib/roundcube/.htaccess. See its
      # content before setting AllowOverride to None.
      AllowOverride All
      order allow,deny
      allow from all
    </Directory>
    
    # Protecting basic directories:
    <Directory /var/lib/roundcube/config>
            Options -FollowSymLinks
            AllowOverride None
    </Directory>
    
    <Directory /var/lib/roundcube/temp>
            Options -FollowSymLinks
            AllowOverride None
    	Order allow,deny
    	Deny from all
    </Directory>
    
    <Directory /var/lib/roundcube/logs>
            Options -FollowSymLinks
            AllowOverride None
    	Order allow,deny
    	Deny from all
    </Directory>
    
    <IfModule mod_rewrite.c>
      <IfModule mod_ssl.c>
        <Location /webmail>
          RewriteEngine on
          RewriteCond %{HTTPS} !^on$ [NC]
          RewriteRule . https://%{HTTP_HOST}:8081%{REQUEST_URI}  [L]
        </Location>
      </IfModule>
    
    <IfModule mod_rewrite.c>
      <IfModule mod_ssl.c>
        <Location /roundcube>
          RewriteEngine on
          RewriteCond %{HTTPS} !^on$ [NC]
          RewriteRule . https://%{HTTP_HOST}:8081%{REQUEST_URI}  [L]
        </Location>
      </IfModule>
    
    <IfModule mod_php5.c>
    AddType application/x-httpd-php .php
    php_flag magic_quotes_gpc Off
    php_flag track_vars On
    php_admin_flag allow_url_fopen Off
    php_value include_path .:/usr/share/php:/usr/share/pear
    php_admin_value upload_tmp_dir /var/lib/roundcube/temp
    php_admin_value open_basedir /usr/share/php:/usr/lib/roundcube:/etc/roundcube:/usr/share/roundcube:/var/lib/roundcube:/var/log/roundcube
    php_flag register_globals off
    </IfModule>
    This works, also on a multiserver setting. Just make sure you enter the correct settings when reconfiguring...

    One final question to the experts here... is it safe? My doubt goes out to the way I enabled logging (by including it as open_basedir)
     
    Last edited: Mar 5, 2013
  14. Final solution roundcube 500 after upgrade to 3.0.5.1

    Hi,

    If you get roundcube 500 ERROR after the upgrade and you are running php as suphp and cannot disable it, only have to go under ISPCONFIG --> DOMAIN | OPTIONS | APACHE DIRECTIVES

    and add

    <IfModule mod_php5.c>
    AddType application/x-httpd-php .php
    php_flag magic_quotes_gpc Off
    php_flag track_vars On
    php_admin_flag allow_url_fopen Off
    php_value include_path .:/usr/share/php:/usr/share/pear
    php_admin_value upload_tmp_dir /var/lib/roundcube/temp
    php_admin_value open_basedir /usr/share/php:/usr/share/pear:/usr/lib/roundcube:/etc/roundcube:/usr/share/roundcube:/var/lib/roundcube:/var/log/roundcube
    php_flag register_globals off
    </IfModule>

    It's running under debian running suphp with ispconfig 3.0.5.1
    You can open ROUNDCUBE with https://www.domain.com/webmail

    Tested and running fine.

    Thanks,
    SERVIDORES DEDICADOS ADMINISTRADOS
     
  15. beyerservice

    beyerservice Member HowtoForge Supporter

    this is same solution as in my post
     
  16. herophil322

    herophil322 New Member

    Sloved

    After the update 3.5.1, i got the error 500 internal server error or a empty site,
    i added those lines to my phpmyadmin.conf and reloaded my apache conf, now it works fine:D

    Code:
    <IfModule mod_php5.c>
    AddType application/x-httpd-php .php
    php_flag magic_quotes_gpc Off
    php_flag track_vars On
    php_admin_flag allow_url_fopen Off
    php_value include_path .:/usr/share/php:/usr/share/pear
    php_admin_value upload_tmp_dir /var/lib/phpmyadmin/temp
    php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/
    php_flag register_globals off
    </IfModule>
     
  17. Horfic

    Horfic Member

    I solved the roundcube issue with suphp by simple adding

    suhosin.session.encrypt=Off

    into the custom php.ini field
     
  18. JeffryL

    JeffryL Member

    Hi Till, I've changed the apps vhost file to enable SSL but this might break other apps right? What would you advice to enable/force roundcube over SSL with port 8081?

    Thanks in advance!
     
  19. Captain

    Captain Member

    Hello!

    Have one small problem.
    I configured roundcube to use over SSL via https.
    For that I add to app.vhost:
    Code:
     # SSL Configuration
      SSLEngine On
      SSLCertificateFile /usr/local/ispconfig/interface/ssl/ispserver.crt
      SSLCertificateKeyFile /usr/local/ispconfig/interface/ssl/ispserver.key
      #SSLCACertificateFile /usr/local/ispconfig/interface/ssl/ispserver.bundle
    
    But when I change something in ispconfig this file recreates witohout

    Code:
     # SSL Configuration
      SSLEngine On
      SSLCertificateFile /usr/local/ispconfig/interface/ssl/ispserver.crt
      SSLCertificateKeyFile /usr/local/ispconfig/interface/ssl/ispserver.key
      #SSLCACertificateFile /usr/local/ispconfig/interface/ssl/ispserver.bundle
    
    How to solve it?

    Thank you.
     
  20. JeffryL

    JeffryL Member

    I noticed that since the update to 3.0.5.2 and/or an upgrade of apache (same time more or less) the webmail isn't working anymore by using the procedure above.

    In my case I've configured the sites with php-fpm and then the directives put in the apache roundcube file are not applied anymore. No matter what I put in this file (within the conf.d directory) the openbase restriction remains in effect.

    Also putting the lines:
    Code:
    AddType application/x-httpd-php .php
    php_flag magic_quotes_gpc Off
    php_flag track_vars On
    php_admin_flag allow_url_fopen Off
    php_value include_path .:/usr/share/php:/usr/share/pear
    php_admin_value upload_tmp_dir /var/lib/roundcube/temp
    php_admin_value open_basedir /usr/share/php:/usr/lib/roundcube:/etc/roundcube:/usr/share/roundcube:/var/lib/roundcube:/var/log/roundcube
    php_flag register_globals off
    in either one of the snippets (php or apache) didn't change the open-base settings.

    I also added the roundcube lines to the open-basedir settings under the general configuration (php-permissions - server config) but this had no effect either. The open-basedir remains the same...

    Anyone experiencing the same difficulties?

    Done so far: reconfiguring website, altering roundcube.conf, altering snippets, changing to mod-php, switching back to php-fpm, disable the https/ssl

    Does work though when using port 8080... which you didn't recommend...
     
    Last edited: Apr 1, 2013

Share This Page