Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Installing SuPHP

  1. #1
    Join Date
    Sep 2008
    Beans
    60

    Installing SuPHP

    Hi,

    I recently installed ubuntu 10.04 LTS Desktop. I will be using this install as a web development environment, so I installed LAMP and phpMyAdmin using the following;

    Code:
    $ sudo apt-get install lamp-server^
    $ sudo apt-get install libapache2-mod-auth-mysql phpmyadmin
    Tested apache, mysql, php and phpMyAdmin and all was working fine until I installed suphp using the following;

    Code:
    $ sudo apt-get install libapache2-mod-suphp
    After the suphp install, I disabled mod_php5 using the following;

    Code:
    $ a2dismod php5
    Then I enabled suphp globally for Apache by editing /etc/apache2/apache2.conf and adding the following at the end of the file;

    Code:
    # Enable SuPHP
    suPHP_Engine on
    suPHP_AddHandler application/x-httpd-php .php
    Then restarted apache using the following;

    Code:
    $ /etc/init.d/apache2 restart
    Apache is working, but I think the suphp install broke php. When I run my php test script using the following in a text file named testing.php placed in the root folder /var/www;

    Code:
    <?php phpinfo(); ?>
    I get a 500 Internal Server Error, but php was running fine before the suphp install.

    Anyone got this working or can help me fix this, please do.
    Last edited by majdi; June 23rd, 2010 at 10:14 PM.
    Currently Running;
    Ubuntu 14.04 LTS Desktop

  2. #2
    Join Date
    Jan 2010
    Location
    Australia
    Beans
    544
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Installing SuPHP

    The libapache2-mod-suphp package doesn't conflict with PHP, so I'd say you need to have PHP enabled. In fact, it depends on suphp-common which depends on either php4-cgi or php5-cgi.

    Enable mod_php5, restart Apache, try again, and if you still get a server error check your error log (/var/log/apache2/error.log).

  3. #3
    Join Date
    Sep 2008
    Beans
    60

    Re: Installing SuPHP

    Thanks Ryan,

    I enabled php5 using;

    Code:
    $ a2enmod php5
    Now the LAMP install seems to be working fine, but suphp dose not seem to be working.

    Any idea?
    Currently Running;
    Ubuntu 14.04 LTS Desktop

  4. #4
    Join Date
    Jan 2010
    Location
    Australia
    Beans
    544
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Installing SuPHP

    I've never used it, so unfortunately I can't help you there.

    Read through some of the documentation here (http://www.suphp.org/DocumentationVi...apache/INSTALL) about configuring. If you're still having problems check Apache's error log at /var/log/apache2/error.log.

  5. #5
    Join Date
    Sep 2008
    Beans
    60

    Re: Installing SuPHP

    Thanks again Ryan,

    The suphp installation notes say;

    Please note that mod_suphp was developped for Apache 1.3.2x and Apache
    2.0.x. It might not work with other version.
    But I'm running Apache/2.2.14 (Ubuntu). Any other solution or alternative mod that can do the same job?

    Anyone???
    Currently Running;
    Ubuntu 14.04 LTS Desktop

  6. #6
    Join Date
    Jan 2010
    Location
    Australia
    Beans
    544
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Installing SuPHP

    If the purpose of this is to allow your webserver to run scripts with elevated privileges, you can set that in your /etc/sudoers file. You can tell it to only run certain commands as root so it's much better than giving it full access.

    If that's the sort of setup you want I can get you the information I used in /etc/sudoers so you can change it to your needs.

  7. #7
    Join Date
    Sep 2008
    Beans
    60

    Re: Installing SuPHP

    Thanks again Ryan,

    Yes that is the idea, because I will be running a CMS which runs PHP scripts and when installed in ver/www the owner and group is root, so the CMS is not able to run the scripts due to the permissions issue. I know suphp will solve this problem, but cant get it to work.

    It sounds like your solution is a better option, never attempted such an option, so I will need help in configuring it.

    Thanks again.
    Currently Running;
    Ubuntu 14.04 LTS Desktop

  8. #8
    Join Date
    Jan 2010
    Location
    Australia
    Beans
    544
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Installing SuPHP

    In that case I recommend setting the group to www-data on all your files in /var/www, then giving group write access.

    chgrp -R www-data /var/www
    chmod -R g+w /var/www

    Your CMS should then have full write access to the /var/www folder.

  9. #9
    Join Date
    Sep 2008
    Beans
    60

    Re: Installing SuPHP

    Thanks Ryan,

    That worked just fine. Is there a way I can make these setting permanent for any files/folders added to /var/www?
    Currently Running;
    Ubuntu 14.04 LTS Desktop

  10. #10
    Join Date
    Jan 2010
    Location
    Australia
    Beans
    544
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Installing SuPHP

    Any new files and folders added by www-data will have the user set to itself so it will be able to write to those files fine. If you make a new file there yourself you will need to chgrp/chmod it.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •