Does anyone have a really good configuration settings for Apache, Litespeed or nginx? All I plan on hosting is forums and would like to optimize my VPS to the fullest. Regards, Mike
You should optimize your web server and adjust the values according to your needs. You may find this link useful http://www.ibm.com/developerworks/linux/library/l-tune-lamp-2/index.html
Caching php and database will give you a better performance and stability. But you will need more RAM. Also optimizing your http engine will require you to add more RAM to your VPS. 1.5 GB RAM is enough for most of the high traffic sites like top 50k at alexa.
I currently have 2GB RAM and 4GB BURST I think that should be good enough right? Now what would be the best option for caching like your recommending is it Apache etc? Thanks for the reply.
Yes 2gb ram should be enough even more than enough for a single wp, drupal or similar site. APC is the best for a PHP caching in my opinion. Apache is a http server. Apache optimization is different. You need to increase your current Apache values (eg, max client). If your VPS has a control panel, especially if it has a cpanel, you can play with the default Apache settings easily. However your VPS should also need a good internet connection like 10 mbps or more. If your VPS has a 1 mbps connection, don't expect much from your optimization efforts. Also Mysql optimization plays a very important role to speed up your site. So, basically VPS optimization is a combination of database, php, http and sometimes dns optimizations. Also you should regularly update your VPS system files and your site CMS files. Once a week or month is enough since linux and linux based applications are already a secure and optimized systems.
So your saying that I should stick with Apache? I will be only hosting forums on this server. MyBB to be exact. I recently installed nginx and I am a first time user. I believe they are running together. How should I configure that? Thanks again.
If you host high traffic forums in the server, please go for Apache + Nginx with Xcache support. Also, replace suphp with mod_ruid that will improve the performance. (Suphp is not compatible with Php accelerators). Apache alone is not a good choice if you have high traffic websites. I own a high traffic forum (with 2k visitors) and the mentioned options worked for me. (Thanks to Jonathan from Onlinecares to optimize the server with the above mentioned softwares and some other mysql tweaks).
Thank you for your response. I will definitely give this a try. I need to learn how to tweak the configurations correctly and disable what I don't need. I have rebuilt apache with the recommended settings. I done nothing to the nginx since installation except getting rid of the bad gateway error and get it working to show websites. Is there anything special I should do to nginx? Thanks again guys.
I can't comment on nginx. I don't know about it. I know apache and litespeed maybe one more http. Apache is best for my knowledge. Litespeed is not good as advertised.
I noticed that the server runs a lot smoother and faster with nginx so I am going to continue using it. Now my question is does nginx and apache run together or solo. I have nginx admin installed as mentioned before. Thanks.
Thanks for the clarification. So I need to fine tune both. I understand now. That is the one I am currently using. I need to learn some nginx tweaking its new to me.
If the time that takes a page to open is your main concern then go for apache prefork+mod_php The downside is that such setup is resources hungry as each apache process is dedicated to a single TCP connection.
<IfModule mod_php5.c> php_value include_path ".:/usr/local/lib/php" php_admin_flag engine on </IfModule> <IfModule mod_php4.c> php_value include_path ".:/usr/local/lib/php" php_admin_flag engine on </IfModule>
There is nothing like a "best PHP configuration". It depends on your needs, your server specifications, the exact software you host and much more. Generally speaking, if you aim for performance as you mentioned, you should use mod_php as a PHP handler. If you have plenty of RAM, you might want to try PHP-FPM as well. If the extra costs fit your business plan, use LiteSpeed instead of Apache. It's PHP handler is really fast and secure at the same time and it's serving static files lighting fast (like NGINX, but NGINX doesn't support .htaccess files, while LiteSpeed does. Even though you could still use NGINX as a reverse proxy infront of Apache). Furthermore you should definitely use a PHP operation code cacher, such as XCache and set the cache size to 64-128MB RAM. You also have to note that PHP by far isn't the only factor for fast serving of dynamic websites - MySQLd optimization is also crucial.