Results 1 to 10 of 10

Thread: Ubuntu 10.04 - LAMP php5 userdir

  1. #1
    Join Date
    Oct 2006
    Beans
    89

    Lightbulb Ubuntu 10.04 - LAMP php5 userdir

    So you migrated your primary webserver to 10.04 LTS and suddenly your users are complaining that their userdir php pages are not working. They keep being asked to download their php pages or phtml, or whatever. Their user blogs are not working. You have unhappy users, and by this time you are probably one as well.

    This may have come up in an earlier upgrade, but whether it is 9.10-10.04 or 8.04lts-10.04lts only is pretty irrelevant. You're feeling the pain.

    You have two choices. Tell your users to move to a dedicated hosting environment of their own, or re-enable php scripting in the apache web server.

    Code:
    sudo nano /etc/apache2/mods-available/php5.conf
    Look for the lines that look like:
    Code:
        <IfModule mod_userdir.c>
            <Directory /home/*/public_html>
                php_admin_value engine Off
            </Directory>
        </IfModule>
    and change em to look like:
    Code:
    #    <IfModule mod_userdir.c>
    #        <Directory /home/*/public_html>
    #            php_admin_value engine Off
    #        </Directory>
    #    </IfModule>
    then restart apache.
    Code:
    sudo service apache2 restart
    or
    Code:
    sudo /etc/init.d/apache2 restart
    whichever you are more comfortable with.

    And tell your users that they may need to restart their browsers. (or if they can figure out how, clear their web cache.)

    I'll grant that there very likely are very good reasons not to allow users to do scripting in their home directories over the web. But you were not disallowing it before, were staying up to date on security issues, and had this solution shoved down your throat without any notice that it was going to happen. It might be a good time to review the decision and perhaps tell those script running freeloaders on your server, aka customers, to take a hike. But that should be your decision.

    -Rusty

  2. #2
    Join Date
    Jun 2008
    Location
    Tennessee
    Beans
    3,421

    Re: Ubuntu 10.04 - LAMP php5 userdir

    Thanks for posting this; same happened to me and drove me nuts. Who in the heck thought this change was a good idea?

  3. #3
    Join Date
    Nov 2007
    Location
    Iowa - USA
    Beans
    50
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Ubuntu 10.04 - LAMP php5 userdir

    Hmmmm... seemed like a perfect solution, worked flawlessly on of my systems that had been upgraded from 9.10 to 10.04, but not so well on another system that was a fresh install of 10.04. It did work, but had to rename directories or clear out all history and cookies related to localhost before I could see that it worked - browser and system restart didn't cut it.

  4. #4
    Join Date
    May 2007
    Location
    Berlin
    Beans
    36

    Re: Ubuntu 10.04 - LAMP php5 userdir

    Thanks for posting the solution worked for me!

  5. #5
    Join Date
    Oct 2007
    Beans
    2

    Re: Ubuntu 10.04 - LAMP php5 userdir

    Yeah! I got the same problem! Why do they disable php on user dir after upgrading?

    Anyway, thanks for you solution!

  6. #6
    Join Date
    Jan 2011
    Location
    Hermosillo, Sonora, Mex
    Beans
    2
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Ubuntu 10.04 - LAMP php5 userdir

    I've tried to implement this solution and still get the following message:

    Forbidden

    You don't have permission to access /~imilanez/index.php on this server.

    Any ideas?

    TIA

  7. #7
    Join Date
    Mar 2009
    Beans
    3

    Re: Ubuntu 10.04 - LAMP php5 userdir

    I am still having problems with this. I have confirmed that I have the correct lines commented out as listed above. My userdir works for html files, but anytime I try to create a test php file in my userdir, the browser just tries to download it.

    This is a server that has been upgraded several times all the way back to 6.04.

    Any ideas?

  8. #8
    Join Date
    Jul 2008
    Location
    BKK, TH
    Beans
    66
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Ubuntu 10.04 - LAMP php5 userdir

    Quote Originally Posted by ScruffyReid View Post
    I am still having problems with this. I have confirmed that I have the correct lines commented out as listed above. My userdir works for html files, but anytime I try to create a test php file in my userdir, the browser just tries to download it.

    This is a server that has been upgraded several times all the way back to 6.04.

    Any ideas?
    I have not only the same problems but php tag is not processed even in the web root directory (/var/www/). Please help.

  9. #9
    Join Date
    Jun 2008
    Location
    Tennessee
    Beans
    3,421

    Re: Ubuntu 10.04 - LAMP php5 userdir

    Quote Originally Posted by wijit View Post
    I have not only the same problems but php tag is not processed even in the web root directory (/var/www/). Please help.
    If it's not working in /var/www, you have a completely different problem. I'd suggest making a new thread.

  10. #10
    Join Date
    Jul 2008
    Location
    BKK, TH
    Beans
    66
    Distro
    Ubuntu 14.04 Trusty Tahr

    Talking Re: Ubuntu 10.04 - LAMP php5 userdir

    Quote Originally Posted by wijit View Post
    I have not only the same problems but php tag is not processed even in the web root directory (/var/www/). Please help.
    Apologise for all. All systems might work since installed. It's me who was not careful enough. I wrote "<php?" instead of "<?php". Cheers!

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
  •