Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 2nd, 2012, 10:17 PM
nlhaines nlhaines is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 3 nlhaines User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 34 m 56 sec
Reputation 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).

Reply With Quote
  #2  
Old November 3rd, 2012, 09:57 AM
E-Oreo's Avatar
E-Oreo E-Oreo is offline
Lost in code
Click here for more information.
 
Join Date: Dec 2004
Posts: 7,930 E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)  Folding Points: 945 Folding Title: Novice Folder
Time spent in forums: 2 Months 7 h 39 m 37 sec
Reputation Power: 6991
Quote:
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
How to program a basic, secure login system using PHP

Quote:
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

Reply With Quote
  #3  
Old November 4th, 2012, 01:34 AM
nlhaines nlhaines is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 3 nlhaines User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 34 m 56 sec
Reputation Power: 0
Awesome! Thank you so much. I had no idea you needed "x" permission on a directory to see the files.

Reply With Quote
  #4  
Old November 5th, 2012, 12:15 AM
nlhaines nlhaines is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 3 nlhaines User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 34 m 56 sec
Reputation Power: 0
Awesome! Thank you so much. I had no idea you needed "x" permission on a directory to see the files.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > Permissions Problem in virtual host (php site)

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap