#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    3
    Rep Power
    0

    Permissions Problem in virtual host (php site)


    I'm not sure what exactly went wrong, but at some point I broke my roundcube installation. Now, when I try to access roundcube I get
    Code:
    PHP Fatal error:  require_once(): Failed opening required 'program/include/iniset.php' (include_path='.:/usr/share/pear:/usr/share/php') in /srv/www/roundcube/index.php on line 31
    The file /srv/www/roundcube/program/include/iniset.php exists. Changing permissions from the unix prompt does not seem to help. I also tried modifying index.php with the following

    I've tried modifying the line a number of ways

    require_once 'program/include/iniset.php';
    require_once(__DIR__ . "/program/include/iniset.php");
    require_once("/srv/www/roundcube/program/include/iniset.php");
    require_once './program/include/iniset.php';
    require_once '/program/include/iniset.php';


    With any of these versions I get an error.

    When I call phpinfo() from within index.php I get"open_basedir => no value => no value" when called from the command line....

    This site is configured to run within an apache virtualhost with the following settings:
    Code:
    <VirtualHost *:443>
            ServerAdmin EDITED
            ServerName webmail.mydomain.c-m
            DocumentRoot /srv/www/roundcube/
            ErrorLog /srv/www/mydomain.c-m/logs/webmail-error.log
            CustomLog /srv/www/mydomain.com/logs/webmail-access.log common
            SSLEngine on
            SSLCertificateFile /etc/httpd/certificate.pem
            SSLCertificateKeyFile /etc/httpd/privkey.pem
            <Location />
                    RewriteBase /
                    SSLRequire %{SSL_CIPHER_USEKEYSIZE} >= 128
            </Location>
            <Directory /srv/www/roundcube/>
                    Options +FollowSymLinks Indexes
                    AllowOverride All
                    order allow,deny
                    allow from all
            </Directory>
            Options Includes FollowSymLinks
    </VirtualHost>
    
    <VirtualHost *:80>
            ServerAdmin EDITED
            ServerName webmail.mydomain.c-m
            Redirect permanent / EDITED
    </VirtualHost>
    PHP can print which files are in /srv/www/roundcube and /srv/www/roundcube/program/ but not /srv/www/roundcube/program/include/

    When I replace roundcube's index.php with an index.html which links to a gif file in /srv/www/roundcube/program/ I get the error Permission denied: access to /program/blocked.gif denied, referer: EDITED

    I can successfully, however, link to files in the same directory as index.php.

    All files/directories under /srv/www/roundcube are chmodded to 644 and are owned by apache (which I think I just read is bad practice).
  2. #2
  3. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    All files/directories under /srv/www/roundcube are chmodded to 644 and are owned by apache (which I think I just read is bad practice).
    Having the files and directories owned by Apache is correct, however having the directories set to 644 is not. You need the execution bit set on a directory in order to list the files in it, so directories should be set to 755, while files are set to 644.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    3
    Rep Power
    0
    Awesome! Thank you so much. I had no idea you needed "x" permission on a directory to see the files.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    3
    Rep Power
    0
    Awesome! Thank you so much. I had no idea you needed "x" permission on a directory to see the files.

IMN logo majestic logo threadwatch logo seochat tools logo