Recompiling PHP / Apache for a complete noob?

Discussion in 'Server Operation' started by Been Told, Aug 10, 2010.

  1. Been Told

    Been Told Member

    Hi there,
    I'm running ISPConfig 2 on Debian Lenny (vServer). I am using a very large IP.Board & Gallery. The devs suggested that I should remove suhosin and in order to do that, I would have to recompile PHP / Apache without suhosin.

    Can someone explain to me how that is done? I've never done that before...
     
  2. Been Told

    Been Told Member

  3. falko

    falko Super Moderator Howtoforge Staff

    Just remove php5-suhosin...
    Code:
    aptitude remove php5-suhosin
    ... and restart Apache.
     
  4. Been Told

    Been Told Member

    Is it really that simple? Because I've done that and the Invisionpower tech told me I'd have to recompile Apache/PHP to do it "properly". Is he talking out his a$$?
     
  5. falko

    falko Super Moderator Howtoforge Staff

    Do you have a phpinfo(); file? Does it still show Suhosin anywhere on the page?
     
  6. Been Told

    Been Told Member

    Yeah it does:
     
  7. Been Told

    Been Told Member

  8. falko

    falko Super Moderator Howtoforge Staff

  9. Been Told

    Been Told Member

    Thanks Falko
     
  10. Been Told

    Been Told Member

    Ok, I downloaded PHP 5 (source code), unpacked it and ran this command:
    Code:
    ./configure --with-apxs2=/usr/sbin/apxs --with-mysql=/var/lib/mysql --enable-track-vars --enable-sockets --with-config-file-path=/etc --enable-ftp --with-zlib --with-openssl=/usr/local/ssl --enable-force-cgi-redirect --enable-exif --with-gd --enable-memory-limit --disable-debug --disable-rpath --disable-static --with-pic --with-layout=GNU --enable-calendar --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-trans-sid --enable-bcmath --with-bz2 --enable-ctype --with-db4 --with-iconv --enable-filepro --with-gettext --enable-mbstring --enable-shmop --enable-wddx --disable-xml --with-xmlrpc --enable-yp --with-zlib --without-pgsql --enable-dbx --enable-experimental-zts --without-mm --enable-gd-native-ttf --with-imap-ssl --enable-soap --enable-dbase --disable-suhosin
    But the server tells me:
    Code:
    Configuring SAPI modules
    checking for AOLserver support... no
    checking for Apache 1.x module support via DSO through APXS... no
    checking for Apache 1.x module support... no
    checking whether to enable Apache charset compatibility option... no
    checking for Apache 2.0 filter-module support via DSO through APXS... no
    checking for Apache 2.0 handler-module support via DSO through APXS... 
    
    Sorry, I cannot run apxs.  Possible reasons follow:
    
    1. Perl is not installed
    2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs
    3. Apache was not built using --enable-so (the apxs usage page is displayed)
    
    The output of /usr/sbin/apxs follows:
    ./configure: line 6461: /usr/sbin/apxs: No such file or directory
    configure: error: Aborting
    
    I've never done this before and I don't have a real clear picture of what apxs is.
    The OS is Debian Lenny with ISPConfig (installed as per the Perfect Setup Howto).
    :confused:
     
  11. falko

    falko Super Moderator Howtoforge Staff

    Install apache2-prefork-dev:
    Code:
    aptitude install apache2-prefork-dev
    Then use /usr/bin/apxs2 instead of /usr/sbin/apxs.
     

Share This Page