4 ms·
Any opinions on Nginx being more difficult to setup/run than Apache? I'm considering switching, but I really have enough overhead to deal with!
by saltcod 12y ago
Any opinions on Nginx being more difficult to setup/run than Apache? I'm considering switching, but I really have enough overhead to deal with!
- Theodores 12y agoJust give it a go. Remember you can set it up to run on another port, e.g. 81, 8080 etc. so you can get it working whilst still having Apache up and running on your site. For popular CMS applications you can normally find some helpful .conf file to get you started. You will also need to setup php-fpm if you are running a PHP flavoured 'LAMP' stack.
- marceldegraaf 12y agoI find nginx way easier to set up than Apache, at least for "standard" (PHP, Ruby/Rails, static) applications and sites. The config file syntax is cleaner than Apache's, and setup is easy (through your favourite package manager). The memory footprint of nginx is also smaller than that of Apache (at least with default settings).
- saltcod 12y agoCool! I never thought of that! Will it be noticeably faster than my current (tuned) Apache setup?
- Theodores 12y agoNginx is faster, however, it is possible to get Apache to be quick and it is possible to make nginx slow (I think 'if' statements are to be avoided in the config). However, as well as speed there is also the amount of load that can be sustained. Nginx wins on this front as well as with speed. As mentioned, run it on another port and see for yourself. When you are happy with it turn off apache on the chkconfig, set nginx to the other port, stop apache and run nginx -s reload to swap over the port. Yep, you can get the whole thing installed, tested and deployed without reboot or downtime!
- mfjordvald 12y agoI'm very biased on this subject but I find the configuration file to be far more simple. The lack of .htaccess support is also a blessing in disguise as everything is in explicitly defined locations.
- mercer 12y agoIf you have anything to do with Drupal (and possibly Wordpress) as well, you might run into issues. At least concerning Drupal, a lot of plugins require changes to the .htaccess file(s), and at least when I tried, this was hard to translate to nginx. But there are some .htaccess to nginx converters, so I'm not sure if that is a big issue at this time. And as others have said, you might find the nginx approach to be much more comfortable than .htaccess. I did.
- vegardx 12y agoDrupal works flawlessly with Nginx[1], and there is little magic involved. You even have good handling of private files, permission and such. There's only a few modules that require changes to the default ".htaccess" (basically just overriding Apache default logic) of Drupal, like the module Boost. But since Nginx can serve as both a application server and reverse proxy, you can have the best of both worlds, without doing hack-y things like Boost, which basically generates a lot of static files. You don't want to use those converters, as they usually rely heavily on ifs, which is a bad thing, when things normally can be handled pretty well with the "try_files"-directive. [1] I've been using it in my stack for a couple of dozen Drupal sites for about two years now.
- mercer 12y agoThanks for the information! I've mostly moved away from Drupal, but I still maintain a number of sites for some clients. Good to know a move to nginx is an option.
- Walkman 12y agoWay easier to configure than apache!