Can't control PHP on OpenSUSE 10.2 - AddHandler and AddType

Discussion in 'Installation/Configuration' started by sabolc, Jan 13, 2007.

  1. sabolc

    sabolc New Member

    I installed ISPConfig on OpenSUSE 10.2 - followed the Perfect Setup to the letter (disabling x-php in mime.types, etc). Everything works nicely, except that I cannot control serving PHP - no PHP gets served at all, apparently the Apache 2 server doesn't know what to do with them. With what little I know, I could identify the following:

    1. /etc/apache2/conf.d/php5.conf is modified by ISPConfig: the AddHandler lines get commented out (so that ISPConfig can control serving PHP). If I change this back (erase the comments), then, of course, PHP works beautifully but then it works for ALL sites (i.e. ISPConfig cannot control it).

    2. ISPConfig uses AddType lines in its /etc/apache2/vhosts/Vhosts_ispconfig.conf file. I know this file must not be edited, but just for a test, I changed the AddType to AddHandler, restarted Apache 2 manually and PHP works again beautifully. Of course, this is no solution, just a test.

    3. There is a line in the OpenSUSE 10.2 changelog that says "corrected apache directive is AddHandler not AddType".

    Does it mean that I cannot use AddType at all? My abilities stop here, what can I do? Just leave global PHP on?

    Best,

    Szabolcs
     
  2. falko

    falko Super Moderator Howtoforge Staff

    I had PHP working on OpenSuSE 10.2 without any changes in ISPConfig.
    What's in Apache's error log? What's the output of
    Code:
    httpd -t
    ?
     
  3. sabolc

    sabolc New Member

    Syntax OK.

    As I said, I could identify no problems either in the syntax of the Apache config, or in the installation (I really did follow your perfect setup). It is just that the AddType directive does not seem to have ANY effect at all.
    The OpenSUSE 10.2 disk I used is the DVD image downloaded a few days ago from opensuse.org.

    I had about twenty more questions but reading through the forum answered almost everything. Your support is extraordinary.

    I would like to ask one more thing, though. I understand you like Debian (and so did I , until I had to provide PHP5 and MySQL5 and leave the stable release) and mentioned somewhere you don't recommend OpenSUSE 10.2 for a production system. What is the reason? I'd love to have Debian but I have a 3ware RAID controller and MySQL5 is a must and I'd love to be able to do apt-get update; apt-get upgrade... :))

    Thank you for your help in advance.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Its not a good idea to go to the debian unstable or testing branch for a production system. Its better to use the php5 and mysql5 packages from dotdeb.org. For the raid driver, did you try to use the 2.6 kernel from debian?

    SuSE goes its own way in the linux world which results to incompatibilitys with many other linux distributions and upgrading packages with yast on a perfectly configured server may lead to problems that yast overwrites your manually edited configuration files.

    If you've ever tried to do a distribution upgrade from e.g. SuSE 10.1 to 10.2 and compare it with a Debian dist upgrade, you will understand what I mean :)
     
  5. R0l@ndSm0ke

    R0l@ndSm0ke New Member

    Changing addtype to addhandler works for me when php is not working on my sites. However, whenever I change something through ISPConfig it rewrites those statements back to addtype. Is there a file that ISPConfig uses to create the vhost file that I can edit to tell it that it should always insert AddHandler instead of AddType?
     
  6. sabolc

    sabolc New Member

    Use Apache directives

    There is a file at /root/ispconfig/isp/conf/vhosts.conf.master but that did not help me. Here is what I ended up doing:

    1. You do not use the PHP checkbox at all. That way ISPConfig will not write or overwrite your config.

    2. You add these lines in the "Apache directives" field manually:

    AddHandler application/x-httpd-php .php4
    AddHandler application/x-httpd-php .php5
    AddHandler application/x-httpd-php .php
    AddHandler application/x-httpd-php-source .php4s
    AddHandler application/x-httpd-php-source .php5s
    AddHandler application/x-httpd-php-source .phps

    ((these are the lines copied from the original SUSE Apache2 config)).

    Actually, I found out that playing with the Apache directives you can set a number of nice things (I needed FollowSymLinks, for example).


    A little addition: I am not sure if the OpenSUSE guys changed something but following the "Perfect setup OpenSUSE 10.2" manual, /var/lib/named is owned by root (and named does not work). Perhaps it could be useful to add the following line to the manual:

    chown -R named:named /var/lib/named


    Finally, a question from me, too: Falko, Till, are you planning to write a Perfect Setup for SLES (SUSE Linux Enterprise Server) 10, too?

    Best,

    Szabolcs
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Currently not, mainly because we dont have a sles licence.
     
  9. sabolc

    sabolc New Member

    no license needed

    Till, to my best knowledge, you do not need a SLES license to write the perfect setup. What you pay for is a subscription, for the security and other updates, but otherwise you can quite freely use SLES... at least for some time, 60 days maybe, definitely more than what you need to write the setup... :))
     
  10. R0l@ndSm0ke

    R0l@ndSm0ke New Member

    Thanks much. Does this cover all the php lines that are inserted as AddType? I believe there are two or three of them.

    You can get a temporary license, but the license, I think, really only applies to updates and support.
     
  11. falko

    falko Super Moderator Howtoforge Staff

    I think you're better off by modifying the function make_vhost() in /root/ispconfig/scripts/lib/config.lib.php.
     
  12. R0l@ndSm0ke

    R0l@ndSm0ke New Member

    That's what I did, guess I should have quoted till. It seems to have taken care of it, I just wanted to verify there were no other locations that needed to be changed.
     

Share This Page