المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : إنجن إكس Nginx هل يمكن تفعيلها ؟ بجانب أباتشي Apache فى السي بانيل Cpanel



Rise Company
08-12-2021, 23:34
إنجن إكس Nginx هل يمكن تفعيلها ؟ بجانب أباتشي Apache فى السي بانيل Cpanel
cpanel install nginx with apache - How to Install and Manage NGINX on cPanel
cPanel - Install Nginx + Varnish alongside Apache
What is cPanel's version of NGINX used for?

https://www.rise.company/forum/images/imported/2021/12/6.jpg

Nginx is a very fast webserver when compared with the default Apache offered by cPanel. Nginx is known for its high performance and low resource consumption. Servers hosting WordPress sites are employing Nginx as it improves the performance.

NGINX is the newer product and tends to perform better overall– especially with modern WordPress sites which really seem to benefit from NGINX optimization. The trade-off here is that a newer product can mean slightly more work for your SysAdmin if they aren’t familiar with it. For a couple of years it seemed like EasyApache was the more stable choice, but by this point more admins are familiar with NGINX and NGINX has gone through more iterations.

So, you’re probably going to see benefits if you’re running a WordPress site– which is why our WordPress Optimized hosting plans all use NGINX. For a non-WordPress site, it’s harder to say. Certain site architectures may not benefit from NGINX as much as others and you have to weigh that against the problems of switching to a new set-up.

NginX is the fastest webserver in the world. Nginx is known for its high performance and low resource.Many enterprises, such as WordPress and Comodo, already switched to NginX as it proves to be the most powerful web-server on the planet.
Nginx will work as a front end reverse proxy of your cPanel server along with apache. Which will increase the performace




How to Install and Manage NGINX on cPanel

Although Apache and NGINX are both web servers, they approach the task of serving web pages differently. Each has advantages and trade-offs, which prompts the question: can I use NGINX with cPanel?
The short answer is yes, you can use NGINX with cPanel; however, its integration is a little tricky. Let’s explore the ways cPanel users can take advantage of NGINX’s strengths, and look at how we are working to make NGINX a viable alternative to Apache on cPanel servers.
cPanel and Apache have decades of shared history, and Apache is deeply integrated into cPanel, which depends on Apache for many of its features. NGINX currently serves 32 percent of websites, versus Apache accounting for 37 percent of websites served on the internet. So what is NGINX, and what does it do differently than Apache?

What Is NGINX, and How Does NGINX Work?

NGINX is a web server, load balancer, and reverse caching proxy. Like all web servers, it accepts HTTP requests and responds with HTML documents. NGINX was developed in response to perceived weaknesses in the way Apache handled network connections and requests.
Initially, Apache operated on a process-per-connection model, spawning a process for every web request. Each process was tied to a specific request and consumed a significant chunk of the host server’s resources, particularly memory. That model worked well on the early web, but modern web servers are expected to handle hundreds of concurrent connections, rapidly consuming the server’s resources.
NGINX, in contrast, has an asynchronous event-driven architecture. A master process controls worker processes, which respond to events, typically new connections, and each worker can handle multiple connections. Because workers are non-blocking, they respond to events as they occur, processing requests in turn rather than being dedicated to a single connection.
In recent years, especially with the release of Apache 2.4, Apache’s developers have worked to improve performance with new multi-processing models (MPMs), such as worker MPM (https://httpd.apache.org/docs/2.4/mod/worker.html) and event MPM (https://httpd.apache.org/docs/2.4/mod/event.html). MPMs help improves overall resource consumption, but Apache can still become resource-constrained when asked to handle too many requests.

Is NGINX Better Than Apache?

There is no simple answer to which web server is better; the only appropriate response is to ask: better for what? The differences in how Apache and NGINX are designed have implications that impact their features and performance.
NGINX is undoubtedly faster at serving static content, and benchmarks show that NGINX serves static files almost twice as fast while consuming less memory. However, NGINX cannot serve dynamic content and relies on external programs to handle the processing, whereas Apache uses internal modules. Benchmarks show that Apache and NGINX response times and concurrency handling for dynamic content are approximately equal, depending on the specifics of the scenario.
Because Apache is extensible with modules, it is easy for web hosts to add new modules to control Apache’s behavior. NGINX is configurable, but it lacks the extensibility of Apache. Adding new features to NGINX often requires recompiling, making it difficult to activate and deactivate functionality on the fly.

Local Web Server Configuration

Apache tends to be slower at serving static content than NGINX because it needs to check configuration files for each connection in the .htaccess file. With local .htaccess files, shared hosting clients and web applications can make changes to Apache’s configuration.
NGINX lacks an equivalent local configuration mechanism, working with a central configuration file. There is no way for shared hosting clients to configure NGINX because all changes have to be made by the server’s system administrator.
The absence of an .htaccess file can impact shared hosting for applications, such as WordPress, which depend on the ability to edit local configuration files for features such as custom permalinks. This is why shared hosting providers rarely use NGINX as an alternative to Apache.
Apache and NGINX excel in different situations, with Apache offering adequate performance in most web hosting scenarios with superior customization and flexibility. NGINX provides better performance in scenarios with large numbers of concurrent connections. It is, however, possible to take advantage of the strengths of Apache and NGINX combined.

cPanel with NGINX as a Reverse Proxy

In addition to being a web server, NGINX is also a powerful reverse proxy and cache. A reverse proxy sits between the client (a web browser) and the server—in this case, Apache, accepting connections from the client and passing them on to the server.
When used as a reverse proxy, NGINX is very fast at serving static content while passing dynamic content onto Apache. Additionally, NGINX can act as a cache for Apache. When used as a caching mechanism, NGINX caches dynamic content for Apache and responds directly to future requests for the same content. Using NGINX with cPanel as a reverse caching proxy can substantially increase performance and reduce server load.
It is possible to manually install NGINX with Apache on a cPanel server, but installing Engintron (https://engintron.com/) is a faster and easier process. Engintron is a cPanel app that integrates NGINX with your cPanel server. When installing Engintron, it configures NGINX as a reverse caching proxy for static files with a caching layer for dynamic content from software such as WordPress or Magento. Utilizing cPanel’s ea-nginx (https://docs.cpanel.net/knowledge-base/web-services/the-ea-nginx-script/) script will also create a reverse proxy; however, it does not set up a caching layer for dynamic content.

Replacing Apache with NGINX on cPanel

Currently, NGINX cannot be used as a drop-in replacement for Apache, because many cPanel features depend on Apache. However, we are working towards making NGINX an alternative cPanel web server (https://blog.cpanel.com/brace-yourselves-nginx-is-coming/).
Last year, we released an experimental version of EasyApache (https://docs.cpanel.net/knowledge-base/third-party/nginx/#redirects) integrating NGINX, which did not wholly replace Apache but focused on using NGINX in some key areas, focusing primarily on WordPress support. We’re continuing to improve NGINX integration and recently added redirect and subdomain support (https://docs.cpanel.net/knowledge-base/third-party/nginx/#redirects) to the experimental release.
NGINX support is still experimental, and we advise against using NGINX as an Apache replacement in production cPanel servers.
While there are alternatives to using NGINX as a drop-in replacement for Apache on cPanel servers, the path forward for a standalone NGINX web server is a work in progress. Hopefully, these scenarios help better inform your decisions on which web server is best for you.

-----------------------------------------------
What is cPanel's version of NGINX used for?

-----------------------------------------------


cPanel has designed our release of NGINX so that it serves as a caching server.

This is done by configuring NGINX as a cache and reverse proxy for each domain on the server.
This means that NGINX will listen on ports 80 and 443, and accept all of the web requests that the sites on your server receive.

If you have caching enabled for a domain (which is turned on by default) NGINX will create and use a cache of the web page which can substantially increase performance for some websites.

If the cache has expired, turned off, or for the first request of a website, NGINX will proxy the request to the backend web server. In most cases the backend web server will be Apache, but also may optionally be LiteSpeed. The backend web server will process the request and then pass the response to NGINX. NGINX will then serve the response to the client.



المرجع:
https://blog.cpanel.com/how-to-install-and-manage-nginx-on-cpanel/
https://support.cpanel.net/hc/en-us/articles/1500012391102
https://docs.cpanel.net/knowledge-base/web-services/nginx-with-reverse-proxy/
https://k9webops.com/blog/cpanel-install-nginx-varnish-alongside-apache/
https://www.inmotionhosting.com/support/server/nginx/install-nginx-on-cpanel/