Setting Up A Server for XenForo

turtile

Well-known member
I'm currently considering setting up my own VPS through Linode but I've never set up a web server in the past. Right now I'm using shared hosting which is running too slow. At the same time, I want to learn how to setup a web server. I can't decide between CentOS, Slackware, and Fedora. It also looks like nginx is the ideal web server but there is less information available online in comparison to Apache.

The Linode website seems to have tutorials that show step-by-step instructions for everything but I'm not sure what I need to do for XenForo. I know I need to install nginx, PHP, and MySQL but what else do I need? Is there anything required that is different with nginx such as rewrite rules etc.? Does anything need to added to PHP/MySQL and is anything required to configure each to run XenForo optimally?

Is it difficult to point the domain name servers at the server?
 
mysqli for PHP. Use the requirements test script to determine PHP plugin which are not installed. You might want a mail/SMTP server to handle mail.
 
Follow the linode help sections to get your distribution, Mysql, PHP, and nginx installed, you might be interested in apc too. Get those all installed, and if you're using CentOS, make sure to add a repository that has a more recent version of PHP. All that information should be found in the linode docs. The installation of things things isn't normally what takes all the time, it's the configuring and monkeying around and troubleshooting that takes up most of the work.

That's the most time consuming part. Then you can try to install and configure an email server.

After that, install a MySQL interface like phpMyAdmin, and lock it down, and create a xenforo database. FTP your xenforo files to your web root, point your browser to your install URL, and away you go!

Is there anything required that is different with nginx such as rewrite rules etc.?
You won't use the htaccess files included with xenforo if you're using nginx, but search these forums to find a configuration that works for you and your nginx installation.
 
I would suggest Ubuntu or any Debian variety because the community is super active (like here :D) and you get help within the hour ...

use linode .. you will not regret it ;)

Post your problems and we will help you :)
 
I started off on Debian, but I'm really liking ubuntu for running xenForo and other php based web software, it's so quick and easy to get up and running.

I used the apt-get, ssh, apache, php, mysql steps from help.ubuntu.com
https://help.ubuntu.com/10.10/serverguide/C/index.html was the guide I used

regardless of whichever linux distro you use, it's easy to point your domain's web DNS to your servers IP address
 
I would suggest to stop this idea!

Install a virtual machine, learn how to manage an server on your own pc and when you know what you're doing, get an vps!
It saves money,nerves and time if you try it first on your own pc instead of an vps!

If you don't know what you're doing, never get the idea of getting an vps which isn't managed by an profi!

My 0.02$
 
a top tip from ragtek, learn on a virtual server on your own desktop first, that's what I did
 
if going with a linux, first thing first is to secure your /tmp /var/tmp and /dev/shm, otherwise it allows hackers to inject their malicious scripts and launch an attack from there intead. do disable some php functions since those are easy to be used as an exploit by the hackers or scriptkiddies
on php ini disable these
opendir,exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source
thirdly change ur ssh port to something else because hackers would otherwise just try to bruteforce ur login on the default ssh port.

if its a medium to high traffic website i suggest you optimize the mysql settings as those are proven to be very efficent as long as you apply the right settings, config located on /etc/my.cnf.
If youre not familiar with the settings install this script and it will guide you throug how to optimize ur mysql settings
https://github.com/rackerhacker/MySQLTuner-perl


install xcache and mod_deflate since those will improve your pageload by alot :)
install firewall, i personally use CSF
install clamav,, free antivirus
on etc/host.conf add the following command
nospoof on
this prevents hackers from using your ip and send for example attacks on someone else.

optimize ur network settings so you get the highest network output possible


Here's what I use. Insert the following lines into the /etc/sysctl.conf



net.core.rmem_default = 256960
net.core.rmem_max = 256960
net.core.wmem_default = 256960
net.core.wmem_max = 256960

net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_sack = 1
net.ipv4.tcp_window_scaling = 1

net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1

then issue this command:

sysctl -p

this works great for me as i got 60% speed improvement
 
It's not that bad ragtek :D and it's not that scary :D
It was a very expensive lesson (at least for me,...)

Some years ago i thought, that it's not hard to manage an server.
It resulted in
  1. big down times (=> pages couldn't be reached => no adsense income, if you have a shop => no shop income...)
  2. Because in germany most hosters have contracts where you have to take the server for at least 1 year, i had to pay the full year, even i used the server only some months before i gave it up..
  3. There are many great tutorials, but there is NON, where you can just copy the commands 1:1 and everything is fine... Every will bring his own little problems ...
    If you don't know what you're doing and you just c&p the commands, i bet that you will have some problems (or destroy something:D )
  4. As i gave it up, i had to search for somebody to do this work for me.
    I payed him much money to install & configure the stuff (now i know that he was no profi :( because some months after the new installation, the performance was sooo horrible but i didn't change anything => i think that he installed some root stuff on my machine and used it for filesharing... but i'm not sure, it's just a speculation lol)
    because of all the new installations,etc... i had to pay for my server and for an other webhost, because i don't wanted to have a downtime..
SO this means: IF YOU HAVE NO CLUE, and you don't want to spend weeks/months with reading tutorials and trying to understand this stuff", you'll have a slower webpage, as with an webhost:D


For everybody who understands german => i blogged about my funny journey http://ragtek.org/blog/serveradministration/der-eigene-server/
 
That might be true few years ago, (nowadays APT your way to the bank :D) and I agree with you : A running business should not be anyone's training lab :D

BUT
If you are starting a new site then I don't see a problem learning while the site grow ...
 
I use Linode in all web projects that I part-take in, back when I first started some years ago, I struggled and got frustrated with myself but I used Google and found a few guides, compared them against each other and started to tweak them to my needs and just started to compile and configure over and over again until I was more comfortable. I ended up following it as a career path, paid for books, paid for education, took several exams, from server management, desktop support and then I got interested in Perl (Perl be hawt, k?) and then found my current love, PHP... to which I've stuck with for 3 years.

Sorry for the soppy and brief history lesson.

Just one nag by me; lock down your VPS (library.linode.com/security/basics/).

If you need any help or anything, feel free to drop me a PC.
 
Is VirtualBox a good program to run a virtual server? I've had a few problems with it recently (won't load an OS now). I plan to test it out before I actually move my sites but I didn't even know exactly what I need!

Thanks for all of the help!
 
Is VirtualBox a good program to run a virtual server? I've had a few problems with it recently (won't load an OS now). I plan to test it out before I actually move my sites but I didn't even know exactly what I need!

Thanks for all of the help!

It will run ... but I think it's just pain in the bu** :D (My personal experience)

I would suggest running a live Ubuntu CD or install it on an external device (HD or USB thumb) >>> boot to ubuntu when you feel like playing ;)

Everything is explained on how to go about doing that on Ubuntu website's download page
 
Top Bottom