How should this be done?

Discussion in 'Linux VPS/Dedicated - cPanel' started by Dan, Jul 13, 2007.

  1. Dan

    Dan Moderator

    Hey everyone :) I have something that I have been able to get working but I am curious as to how it SHOULD be done as from what I am seeing the way I achieved it is not a very good way to go.

    Ok, so I want a global install of Squirrelmail that will be available for use with all domains.

    How I did this is I installed Squirrelmail into /usr/local/apache/htdocs/sqmail (I realize any place will work really).
    And then added an alias which is:
    Code:
    Alias /sqmail /usr/local/apache/htdocs/sqmail
    <Directory "/usr/local/apache/htdocs/sqmail">
    Options Indexes FollowSymlinks MultiViews ExecCGI
    AllowOverride None
    Order allow,deny
    Allow from all
    </Directory>
    I also had to set things up for user preferences and a folder for uploads with permissions but nothing too special about this.

    I then (and this is the really iffy part) for some reason things would not work unless I added users to the Wheel group. I have phpsuexec running so scripts and everything run AS the user which is part of the problem I am sure but I really do not want to give that up.

    So while that DOES give me http://domain.com/sqmail for all domains is there a better way I should be doing this?

    Thanks!
     
  2. khiltd

    khiltd New Member

    That's not a good idea at all. Why can't you just set appropriate permissions on those particular files?
     
  3. Dan

    Dan Moderator

    Hiya Khiltd,

    As I said I think it has to do with suexec. Just gave it a test run (chowned all files to root:root) and got an Internal server error. In my apache/logs/error_log file I see this error: [Fri Jul 13 14:01:57 2007] [error] [client 64.62.9.26] Premature end of script headers: /usr/local/apache/htdocs/sqmail/index.php

    But that's about all I can find error wise.

    Chown back to root:wheel and everything runs fine again.

    Suggestions?
     
  4. khiltd

    khiltd New Member

    Neither Apache nor PHP should be running as root.
     
  5. Dan

    Dan Moderator

    They don't...Apache runs as nobody and php runs as the user that called it.
     
  6. khiltd

    khiltd New Member

    So if you know that PHP is going to execute the scripts as the owner of the files then why are you changing their owner to root?
     
  7. Dan

    Dan Moderator

    I uploaded them as root so they were originally root:root which for html files works fine but not php. If I change it to user:user then only that user can access them.
     
  8. khiltd

    khiltd New Member

    Soooo... you should be able to see why this plan isn't going to work.

    Try installing the application under the main/reseller account and throw a rewrite rule in httpd.conf.
     

Share This Page