If you prefer Apache over nginx, could I ask why? I switched about a month ago and haven't looked back. Lack of mod_php isn't an issue because FPM is faster and more secure, nginx eats far less memory, it's noticeably faster, the syntax of config files is better (in my opinion), and I could really go on.
Apache is undoubtedly the best known process-based server and Nginx is the best asynchronous server. The main advantage of the asynchronous approach is scalability. In a process-based server, each simultaneous connection requires a thread which incurs significant overhead. An asynchronous server, on the other hand, is event-driven and handles requests in a single (or at least, very few) threads.While in same condition Apache consume far too much RAM which significantly degrades performance.
If you are a newbie, it's better to start with Apache because most web applications come with an Apache configuration.
I install Nginx on most of my servers as Nginx provides Static file serving,Reverse proxying,Load balancing, Server-side includes,FastCGI. Nginx is stable, secure and very easy to configure, as you will see later in the article. However, the main advantages of Nginx over Apache are performance and efficiency. Nginx is able to serve more requests per second with less resources because of its architecture. It consists of a master process, which delegates work to one or more worker processes. Each worker handles multiple requests in an event-driven or asynchronous manner using special functionality from the Linux kernel (epoll/select/poll). This allows Nginx to handle a large number of concurrent requests quickly with very little overhead. Apache can be configured to use either a process per request (pre-fork) or a thread for each request (worker). Although Apache's threaded mode performs much better than its pre-fork mode, it still uses more memory and CPU than Nginx's event-driven architecture.
According to Ehow, Apache has the following advantages: 1) Apache Web Server has a large set of powerful features. These core features, combined with the extensions created by programmers around the world, help make the Apache platform competitive even against high-priced rivals. Apache has built-in support for a wide range of web programming languages, including Perl, PHP and Python. These languages are easy to learn and can be used to create powerful online applications. Apache also includes "SSL" and "TLS" support. These are protocols for sending encrypted data over the Internet, and are important in the development of safe online stores and other applications requiring privacy. 2) Security. Since Apache was developed for a non-Microsoft operating system, and the majority of malicious programs have traditionally been written to take advantage of vulnerabilities in Windows, Apache has always enjoyed a reputation as a more secure option than Microsoft’s IIS. 3) Apache Web Server is very portable. This means that it can be installed on a wide variety of servers and operating systems. Apache is able to run on all versions of the UNIX operating system. Linux is supported, as are the Windows NT and MacOS operating systems. In comparison, Microsoft's own Windows Server typically can be installed only on Windows operating systems. From a hardware standpoint, Apache can be used on any server with an Intel 80x86 series of processor when it is combined with Windows. If Apache is being used on a Unix or Linux operating system, nearly any processor type is supported. Overall, Apache is one of the most adaptable server systems currently available, and will run in a wide range of technical environments.
There is no point for comparing the two webservers since as it was already pointed out in the previous posts, they use entirely different architectures. Both applications are stable, reliable and efficient and both have their downsides as well. They are best used in different situations. Nginx is much more efficient for serving static content due to event-driven (asynchronous) operation. You may find a bunch of articles recommending nginx to be used as frontend (reverse-proxy) to apache enabling it’s caching functionality to reduce the load on the apache backend. To cope with higher loads, nginx offers load-balancing functionalities serving requests for multiple apache backend servers simultaneously. Although apache offers these features, performance on the same hardware would be immensely degraded. On the other hand, apache is much more efficient at serving dynamic websites.
Nginx is very stable -- It's used by millions of sites, including some of the largest sites on the internet (e.g. Youtube)
IMO the only reason to use Apache would be to be able to use .htaccess files and for compatibility with control panels. Other than that, there is none.
Apache can be tuned to perform just as well as nginx or any other "high performance" web server. It really depends on what you intend on hosting.
I plan on only hosting forums what do you think a good configuration would be? I have nginx and apache running. Thanks in advanced.
Yeah, the damn memory fragmentation is seriously annoying to manage Start off with Apache, it gets the job done and is easier for beginners to configure as the internet is swimming in Apache documentation If you ever reach the point where Apache is struggling to cope with the traffic you can look at replacing it with Nginx or using Nginx as a caching proxy.
Nginx and Litespeed have little edge over apache in terms of apache. Agreed! The key to fast websites is sql. If that gets bogged, it drags and slows any http server