Results 1 to 2 of 2

Thread: make phpmyadmin worked with suphp

  1. #1
    Join Date
    Apr 2011
    Location
    Tehran, Iran
    Beans
    3
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Post make phpmyadmin worked with suphp

    hi everyone!
    I had phpmyadmin installed on my ubuntu and when I install suphp, it broken and show me save as dialog on firefox. I searched on google and found nothing useful. finaly I mixed solutions and could solve this problem. th solution is:

    1- after installing suphp goto /etc/suphp/suphp.conf and add your phpmyadmin address to scripts paths like this:
    PHP Code:
    ;Path all scripts have to be in
    docroot
    =/var/www:${HOME}/public_html:/usr/share/phpmyadmin 
    and make min_uid and min_gid to 33 (point to www-data user) like this:
    PHP Code:
    Minimum UID
    min_uid
    =33

    Minimum GID
    min_gid
    =33 

    2-
    run this command on terminal to set user ang group of your phpmyadmin directory and subdirectory and files to www-data:
    PHP Code:
    chown -R www-data:www-data /usr/share/phpmyadmin 
    3- run this command on terminal to remove mod_php loading:
    PHP Code:
    rm -rf /etc/apache2/mods-available/php5.load /etc/apache2/mods-enabled/php5.load 

    4-
    open your apache config file (always in /etc/apache2/sites-available/default) and find your phpmyadmin configure. now change settings for work in suphp. something like this:

    PHP Code:
    <VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName localhost
    Alias 
    /phpmyadmin /usr/share/phpmyadmin
    suPHP_Engine on
    #suPHP_UserGroup www-data www-data
    AddHandler x-httpd-suphp .phpsu
    #PHP_AddHandler x-httpd-suphp
    <directory /usr/share/phpmyadmin>
    Options Indexes FollowSymLinks
    DirectoryIndex index
    .php
    <ifmodule mod_php5.c>
    AddType application/x-httpd-php .php
    php_flag magic_quotes_gpc Off
    php_flag track_vars On
    php_flag register_globals Off
    php_value include_path 
    .
    </
    ifmodule>
    </
    directory>
    # Disallow web access to directories that don't need it
    <directory /usr/share/phpmyadmin/setup>
    Order Deny,Allow
    Deny from All
    </directory>
    <
    directory /usr/share/phpmyadmin/libraries>
    Order Deny,Allow
    Deny from All
    </directory>
    </
    VirtualHost
    5- restart your apache2 in terminal:

    PHP Code:
    sudo service apache2 restart 
    enjoy!

  2. #2
    Join Date
    Apr 2008
    Beans
    10

    Re: make phpmyadmin worked with suphp

    Hi,

    lowering min_uid and min_gid so low may cause a security problem. Setting it to 33 means half the non-user accounts in Ubuntu (like backup, list, syslog, postfix, etc.) now can be allowed to run with suphp. The purpose of those settings is exactly the opposite: to allow only user accounts (or better, a subset of user accounts) to run PHP scripts.

    The safer solution is to create an user for phpmyadmin with a higher UID/GID and then change the ownership of the files.


    In my servers I have separate accounts used only for websites, with UIDs/GIDs starting at 5000.


    Hope this helps.

    Regards,

    MValdez.

Tags for this Thread

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
  •