Results 1 to 4 of 4

Thread: apache2 + public_html

  1. #1
    Join Date
    Apr 2011
    Beans
    2

    apache2 + public_html

    Hello!

    I've got a strange problem and not found any solution on web.

    System: ubuntu 10.10
    server: apache2 v2.2.16

    I want to use the users public_html directory to run php scripts, but... in browser I get only downloading window to save.

    The apache2 is working in default directory (/var/www/index.php appears normally), but not in public_html.

    Tried a lot of solution from web and from this forum also, but still doesn't work correctly.

    My /etc/apache2/mods-available/php5.conf is:
    Code:
    <IfModule mod_php5.c>
          <FilesMatch "\.ph(p3?|tml)$">
        SetHandler application/x-httpd-php
          </FilesMatch>
          <FilesMatch "\.phps$">
        SetHandler application/x-httpd-php-source
          </FilesMatch>
          # To re-enable php in user directories comment the following lines
          # (from <IfModule ...> to </IfModule>.) Do NOT set it to On as it
          # prevents .htaccess files from disabling it.
          <IfModule mod_userdir.c>
              <Directory /home/*/public_html>
                  php_admin_value engine Off
              </Directory>
          </IfModule>
      </IfModule>
    I've set up /etc/apache2/apache2.conf by adding this:
    Code:
     #UserDir is now a module
     UserDir public_html
     UserDir disabled root
     <Directory /home/*/public_html>
       AllowOverride FileInfo AuthConfig Limit
       Options Indexes SymLinksIfOwnerMatch IncludesNoExec
     </Directory>
    Of course I tried
    Code:
    sudo a2enmod userdir
    at first to set up apache, and restarted the deamon by
    Code:
    sudo /etc/init.d/apache2 restart
    .

    Does anybody know, what the problem is?

    Thanks for answers.

    Regards,
    z
    Last edited by zsepi; April 4th, 2011 at 11:47 AM.

  2. #2
    Join Date
    Nov 2008
    Beans
    27

    Re: apache2 + public_html

    I think that you need to follow the commented instructions in your post inside /etc/apache2/mods-available/php5.conf i.e. comment out (i.e. put hash in front of) these lines:
    Code:
        <IfModule mod_userdir.c>
              <Directory /home/*/public_html>
                  php_admin_value engine Off
              </Directory>
        </IfModule>
    and then restart apache again.

  3. #3
    Join Date
    May 2007
    Location
    NY's first capital
    Beans
    2,711
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: apache2 + public_html

    Two other things to check
    If you had other files int public_html, you may need to clear the cache on the browser you are using.

    Verify the permissions inside public_html are readable by www-data.
    Nothing is ever easy, but if it is difficult you must be doing it wrong.

  4. #4
    Join Date
    Apr 2011
    Beans
    2

    Re: apache2 + public_html

    hurray
    I commented out theese lines and now...
    It works. Thank You!
    Last edited by zsepi; April 4th, 2011 at 12:51 PM.

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
  •