1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XenForo Server Setup Guide Part 2 (CentOS, OpenLiteSpeed, Percona) (With Pictures!)

An easy to follow quick setup guide for a powerful XenForo server stack. Part 2 of 3

  1. Slavik

    Slavik XenForo Moderator Staff Member

    Slavik submitted a new resource:

    XenForo Server Setup Guide Part 2 (CentOS, OpenLiteSpeed, Percona) (With Pictures!) - An easy to follow quick setup guide for a powerful XenForo server stack. Part 2 of 3

    Read more about this resource...
  2. Marcus

    Marcus Well-Known Member

    Wonderful! That saves me a few days of work and testing. For PHP 5.5.1 I just choose 5.5.1 in the control panel. I added one string to this line to include Zend Opcache
    '--enable-opcache' '--with-mysql' '--with-mysqli' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-zlib' '--with-gd' '--enable-shmop' '--enable-sockets' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--enable-mbstring' '--with-iconv' '--with-libdir=lib64' '--with-litespeed' '--with-curl' '--enable-zip' '--with-bz2' '--with-jpeg-dir=lib64' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--enable-gd-native-ttf' '--enable-exif' '--with-openssl' '--with-xmlrpc' '--with-freetype-dir=lib64' '--with-png-dir=lib64' '--enable-inline-optimization' '--enable-xml'
    I changed this line to
    cp /usr/local/lsws/phpbuild/php-5.5.1/php.ini-development /usr/local/lsws/lsphp5/lib/php.ini
    Last edited: Aug 25, 2013
    pjfry likes this.
  3. Slavik

    Slavik XenForo Moderator Staff Member

  4. MattW

    MattW Well-Known Member

    While compiling PHP on a 512mb VPS from DigitalOcean

    virtual memory exhausted: Cannot allocate memory

    Just had to re-size the VPS and trying again
  5. Marcus

    Marcus Well-Known Member

    Looks like my PHP is not compiled correctly :)
  6. p4guru

    p4guru Well-Known Member

    You don't have --with-mysql compiled so can't use mysql_connect
    Slavik likes this.
  7. Slavik

    Slavik XenForo Moderator Staff Member

    Indeed, your missing several flags.
  8. Slavik

    Slavik XenForo Moderator Staff Member

    Marcus, I will say, installing XenForo is part of part 3 of the guide, not this part.
    Marcus likes this.
  9. optimus

    optimus Member

    Grate guide, but to use percona you need to have an root/dedicated server with ssd and some advanced sql optimization skills, percona is not for general purpose use. You can use this "Tools to Improve Your MySQL Performance" maybe can help you with some improuvements, but for innodb is recommended ssd. If you want an realy powerfull machine you will use an Dedicated Server min 4/core with SSD, FreeBSD, Nginx, PHP 5.5 and Percona. LiteSpeed with Percona is like sugar with salt.
    Last edited by a moderator: Aug 25, 2013
  10. MattW

    MattW Well-Known Member

    Load of rubbish! Percona is a direct replacement for MySQL, and doesn't need advanced SQL skills to tune it.

    I've used it on 512mb VPS, 4Gb VPS, 8Gb VPS and installed it on dedicated servers for people.
  11. Slavik

    Slavik XenForo Moderator Staff Member

    Im not going to say anything apart from, this is entirely incorrect.
    MattW likes this.
  12. Marcus

    Marcus Well-Known Member

    My server has a hard time writing stuff. I got this timeout error for approving two posts. My members posting rate dropped 95% I guess there is some setting in the configuration I would have to take care of.
    Server Error
    Mysqli statement execute error 
    Lock wait timeout exceeded; try restarting transaction

    Zend_Db_Statement_Mysqli->_execute() in Zend/Db/Statement.php at line 317
    [*]Zend_Db_Statement->execute() in Zend/Db/Adapter/Abstract.php at line 479
    [*]Zend_Db_Adapter_Abstract->query() in XenForo/DataWriter/Alert.php at line 98
    [*]XenForo_DataWriter_Alert->_postSave() in XenForo/DataWriter.php at line 1397
    [*]XenForo_DataWriter->save() in XenForo/Model/Alert.php at line 452
    [*]XenForo_Model_Alert->alertUser() in XenForo/Model/Alert.php at line 426
    [*]XenForo_Model_Alert::alert() in XenForo/Model/Report.php at line 675
    [*]XenForo_Model_Report->sendAlertsOnReportResolution() in XenForo/DataWriter/Report.php at line 99
    [*]XenForo_DataWriter_Report->_postSave() in XenForo/DataWriter.php at line 1397
    [*]XenForo_DataWriter->save() in XenForo/ControllerPublic/Report.php at line 355
    [*]XenForo_ControllerPublic_Report->actionUpdate() in XenForo/FrontController.php at line 337
    [*]XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
    [*]XenForo_FrontController->run() in /usr/local/lsws/DEFAULT/html/index.php at line 13
  13. Slavik

    Slavik XenForo Moderator Staff Member

    Edit the my.cnf and increase innodb_lock_wait_timeout

    Though, sounds like a host problem to be honest.
  14. Marcus

    Marcus Well-Known Member

    Pages are now first rendered below 1 second and writes are good. I had to configure the webserver to compress more than html. I also optimized and repaired my database. This is my not optimized but working /etc/my.cnf for reference

    # CLIENT #
    port  3306
    = /var/lib/mysql/mysql.sock

    # GENERAL #
    user  mysql
    default-storage-engine  InnoDB
    = /var/lib/mysql/mysql.sock
    -file  = /var/lib/mysql/mysql.pid

    # MyISAM #
    key-buffer-size  512M
    -recover  FORCE,BACKUP

    # SAFETY #
    max-allowed-packet  16M
    -connect-errors  1000000
    #innodb  = FORCE

    datadir  = /var/lib/mysql/

    tmp-table-size  32M
    -heap-table-size  32M
    -cache-type  0
    -cache-size  0
    -connections  500
    -cache-size  50
    -files-limit  65535
    -definition-cache  4096
    -open-cache  4096

    # INNODB #
    #innodb-flush-method  = O_DIRECT
    #innodb-flush-log-at-trx-commit = 2
    #innodb-file-per-table  = 1
    innodb-buffer-pool-size  2G

    # LOGGING #
    log-error  = /var/lib/mysql/mysql-error.log
    -query-log  1
    -query-log-file  = /var/lib/mysql/mysql-slow.log
  15. Marcus

    Marcus Well-Known Member

    Time to First Byte with nginx: 133 ms. It was rated B on webpagetest.org.

    Now it is 195 ms. Rated C. With the new setup I entered 12 workers in Litespeed for my six core CPU. PHP runs with Zend Opcache, I installed and configured memcached. Optimized my.cnf to cache queries, which did help a bit.

    Start Render Time is similar to before, and that's most important. I like having my own server and being independant from PLESK.
  16. p4guru

    p4guru Well-Known Member

    might want to read http://vbtechsupport.com/2256/
    Marcus likes this.
  17. Slavik

    Slavik XenForo Moderator Staff Member

  18. Sheratan

    Sheratan Well-Known Member

    Do you have any standard flag when compiling PHP for xenforo?
  19. Slavik

    Slavik XenForo Moderator Staff Member

    It's in the guide :)
  20. KeVo

    KeVo Active Member

    @Slavik, I seem to get stuck at the part where we change the port from 8088 to 80. I follow the instructions, but when I type in my server IP, it just gives me a "cannot connect message". It works off of SERVERIP:8088 though, and displays the successful installation of LiteSpeed message.

    Any help you could possibly give on why it will not serve up from port 80 like in the guide?

Share This Page