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

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

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

Pre-Word and Disclaimer
This guide may not be published, broadcast, rewritten or redistributed in whole or part with out the express written permission of Slavik at XenForo.com. The author takes no responsbility for any steps, in part, or in whole, undertaken by users of this guide and does not guarantee against any losses, material or otherwise.


Introduction

In...

Read more about this resource...
 
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
PHP:
'--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
PHP:
cp /usr/local/lsws/phpbuild/php-5.5.1/php.ini-development /usr/local/lsws/lsphp5/lib/php.ini
 
Last edited:
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
 
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:
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.
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.
 
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.


Im not going to say anything apart from, this is entirely incorrect.
 
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.
PHP:
Server Error
Mysqli statement execute error : Lock wait timeout exceeded; try restarting transaction

[LIST=1]
[*]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
[/LIST]
 
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.

Edit the my.cnf and increase innodb_lock_wait_timeout

Though, sounds like a host problem to be honest.
 
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
PHP:
[mysql]

# CLIENT #
port  = 3306
socket  = /var/lib/mysql/mysql.sock
[mysqld]

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

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

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

# DATA STORAGE #
datadir  = /var/lib/mysql/

# CACHES AND LIMITS #
tmp-table-size  = 32M
max-heap-table-size  = 32M
query-cache-type  = 0
query-cache-size  = 0
max-connections  = 500
thread-cache-size  = 50
open-files-limit  = 65535
table-definition-cache  = 4096
table-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
slow-query-log  = 1
slow-query-log-file  = /var/lib/mysql/mysql-slow.log
 
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.
 
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.
might want to read http://vbtechsupport.com/2256/
 
@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?
 
Top Bottom