1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

[GUIDE] Installing/Configuring LiteSpeed with CHRoot

Discussion in 'Site & Server Administration' started by yah0m, May 24, 2009.

  1. #1

    1.0 INSTALLING LITESPEED/PHP
    1.1 Installing LiteSpeed with CHRoot
    1. /usr/sbin/useradd -g HTTPD -s /bin/false LSWS
    2. mkdir -p /chroot/lsws
    3. cd /usr/src
    4. wget http://www.litespeedtech.com/packages/3.0/...86-linux.tar.gz
    5. tar -zxvf lsws-3.3.24-ent-i386-linux.tar.gz
    6. cd lsws-3.3.24
    7. (DOWNLOAD AND WGET A NEW trial.key)
    8. ./install.sh
      • Do you agree with above license? Yes
      • Destination [/opt/lsws]: /chroot/lsws
      • Chroot Path /chroot
      • User name [admin]: admin
      • Password: 123456 (change with your own admin password)
      • Retype password: 123456
      • User [nobody]: LSWS (use a non-system user that doesn't have a shell access and home directory)
      • Group [nobody]: HTTPD (group the webserver will be running as)
      • HTTP port [8088]: 80
      • Admin HTTP port [7080]: 7080
        Don't forget, both these ports should be enabled in the firewall
      • Setup up PHP [Y/n]: Y
      • Suffix for PHP script(comma separated list)
        PHP:
        1. : php
        2. [*]  Would you like to change PHP opcode cache setting [y/N]? N
        3. [*]  Would you like to install AWStats Add-on module [y/N]? N
        4. [*]  Would you like to import Apache configuration [y/N]? N
        5. [*]  Would you like to have LiteSpeed Web Server started automatically when the machine restarts [Y/n]? Y
        6. [*]  Would you like to start it right now [Y/n]? Y
        7. [/list]
        8. [/list][code]cd ..[/code][/indent]
        9. [indent][color="#FA8D4A"][size=3][b]1.2 Installing PHP for LiteSpeed[/b][/size][/color]
        10. [list=1]
        11. [*]wget [url="http://us2.php.net/get/php-5.2.9.tar.gz/from/us.php.net/mirror"]http://us2.php.net/get/php-5.2.9.tar.gz/fr....php.net/mirror[/url]
        12. [*]tar -zxvf php-5.2.9.tar.gz
        13. [b]MAIL PATCH[/b][indent][list]
        14. [*]cd /usr/src
        15. [*]wget [url="http://choon.net/opensource/php/php-5.2.9-mail-header.patch"]http://choon.net/opensource/php/php-5.2.9-mail-header.patch[/url]
        16. [*]cd php-5.2.9
        17. [*]patch -p1 < ../php-5.2.9-mail-header.patch
        18. [/list][/indent][b]SUHOSIN PATCH[/b][indent][list]
        19. [*]cd /usr/src
        20. [*]wget [url="http://download.suhosin.org/suhosin-patch-5.2.9-0.9.7.patch.gz"]http://download.suhosin.org/suhosin-patch-...-0.9.7.patch.gz[/url]
        21. [*]wget [url="http://download.suhosin.org/suhosin-0.9.27.tgz"]http://download.suhosin.org/suhosin-0.9.27.tgz[/url]
        22. [*]gunzip suhosin-patch-5.2.9-0.9.7.patch.gz
        23. [*]cd php-5.2.9
        24. [*]patch -p 1 -i ../suhosin-patch-5.2.9-0.9.7.patch
        25. [*]phpize
        26. [*]./configure
        27. [*]make
        28. [*]make install
        29. [/list][/indent]
        30. [*]cd /usr/src/php-5.2.9/sapi
        31. [*]wget [url="http://www.litespeedtech.com/packages/lsapi/php-litespeed-4.9.tgz"]http://www.litespeedtech.com/packages/lsap...tespeed-4.9.tgz[/url]
        32. [*]tar -zxvf php-litespeed-4.9.tgz
        33. [*]cd ..
        34. [*]touch ac*
        35. [*]./buildconf --force[indent]-- IF ERROR ON ./buildconf:
        36. --------------------------
        37. install autoconf-2.13
        38. --------------------------
        39. wget [url="http://ftp.gnu.org/gnu/autoconf/autoconf-2.13.tar.gz"]http://ftp.gnu.org/gnu/autoconf/autoconf-2.13.tar.gz[/url]
        40. tar zfvx autoconf-2.13.tar.gz
        41. cd autoconf-2.13
        42. ./configure
        43. make
        44. make install
        45. cd ..
        46. ./buildconf --force[/indent]
        47. [/list]
        48.  
        49. Depending on your install, you will need to install packages/sources. This list cover most of the common ones needed just so you don't get error on install.
        50. [code]yum install libxml2-devel openssl-devel bzip2-devel libcurl-devel libpng-devel libjpeg-devel libXpm-devel freetype-devel libc-client-devel libmcrypt-devel libmhash-devel imap-devel libxslt-devel pcre-devel aspell-devel net-snmp-devel libxml expat-devel[/code]
        51.  
        52. The most important to make sure you include is --with-litespeed
        53. [code]./configure --enable-bcmath --enable-calendar --enable-dbase --enable-exif --enable-gd-native-ttf --enable-libxml --enable-ftp --enable-magic-quotes --enable-mbstring --enable-soap --enable-wddx --enable-zip --prefix=/usr/local --with-litespeed --with-config-file-path=/usr/local/lib --enable-suhosin --with-bz2 --with-curl=/opt/curlssl/ --with-curlwrappers --with-freetype-dir=/usr --with-gd --with-gettext --with-imap=/opt/php_with_imap_client/ --with-kerberos --with-imap-ssl=/usr --with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib --with-libexpat-dir=/usr --with-libxml-dir=/opt/xml2 --with-libxml-dir=/opt/xml2/ --with-mcrypt --with-mhash=/opt/mhash/ --with-mime-magic --with-mm --with-mysql=/usr --with-mysql-sock=/var/lib/mysql/mysql.sock --with-mysqli=/usr/bin/mysql_config --with-openssl --enable-pdo=shared --with-pdo-mysql=shared --with-pdo-sqlite=shared --with-sqlite=shared  --with-pic --with-png-dir=/usr --with-ttf --with-xmlrpc --with-xpm-dir=/usr --with-xsl=/opt/xslt/ --with-zlib --with-zlib-dir=/usr --with-pspell --with-pear --enable-sockets --with-snmp --enable-ucd-snmp-hack --with-tidy=/opt/tidy[/code]
        54. Compile and Install...
        55. [code]make
        56. make install[/code]
        57.  
        58. Now that we have PHP done, lets get the new binary moved over:
        59. [list]
        60. [*]cd /opt/lsws/fcgi-bin
        61. [*]mv lsphp lsphp.old
        62. [*]cp /usr/src/php-5.2.9/sapi/litespeed/php ./lsphp
        63. [*](RESTART LSWS)
        64. [/list][/indent]
        65.  
        66. [color="#555576"][size=5][b]2.0 CONFIGURING SERVICES[/b][/size][/color]
        67. [indent][color="#FA8D4A"][size=3][b]2.1 Configuring LiteSpeed with CHRoot[/b][/size][/color]
        68. Because we are running in a CHRoot Environment now, we need to copy over the needed binaries for PHP.
        69. [code]/chroot/lsws/admin/misc/chroot.sh /chroot/ /chroot/lsws/fcgi-bin/lsphp[/code]
        70. [/indent]
        71. [indent][color="#FA8D4A"][size=3][b]2.2 Configuring PHP for LSWS CHRoot[/b][/size][/color]
        72. [code]vim /chroot/lsws/usr/local/lib/php.ini[/code]
        73. Find the following and set the socket location...
        74. [code][MySQL]
        75. ...
        76. mysql.default_socket = /tmp/mysqld/mysqld.sock[/code]
        77. [/indent]
        78. [indent][color="#FA8D4A"][size=3][b]2.3 Configuring MySQL for LSWS CHRoot[/b][/size][/color]
        79. [code]vim /etc/my.cnf[/code]
        80. Find and edit MySQL so that it sets the sock in the CHRoot:
        81. [code][client]
        82. socket=/chroot/lsws/tmp/mysqld/mysqld.sock
        83. [mysqld]
        84. socket=/chroot/lsws/tmp/mysqld/mysqld.sock[/code]
        85. [/indent]

     
    yah0m, May 24, 2009 IP
  2. RAmoss

    RAmoss Guest

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    awesomeness thanks for this
     
    RAmoss, Jun 2, 2010 IP