Web Services
What WWW servers does DirectAdmin support?
DirectAdmin has support for a variety of WWW servers. To check which one is in use, and possible options:
cd /usr/local/directadmin/custombuild/
./build opt_help | grep webserver
>webserver: apache, nginx, nginx_apache, litespeed, openlitespeed. Current value: openlitespeed. Default value: apache.
Where:
- apache is the most popular. This is the Apache HTTP server from https://httpd.apache.org/
- nginx is high performance open-source web server, great for static files but has limitations for .htaccess files, so it may require manual adjustments. https://www.nginx.com/
- nginx_apache is a powerful reverse proxy where nginx serves static files, while dynamic files and .htaccess are processed by Apache. It's a good choice without needs to modify existing scripts or mod_rewrite rules. It mainly benefits slow connections.
- litespeed is a commercial web server. It is a drop-in replacement for Apache from LiteSpeed Technologies. It provides faster response times and reduced server load average when compared with Apache.
- openlitespeed is the open source edition of the LiteSpeed Web Server, and contains all essential features and benefits from it, with some limitations. It's not a drop-in replacement for Apache though, due to lack of full .htaccess support and different configuration syntax.
Which WWW server is the recommended one?
Every system may have specific needs, a comparison table:
Web Server | Advantages | Disadvantages | Suitable for shared hosting? |
---|---|---|---|
Apache | industry standard, highly customizable | high memory usage and slow for static files | YES |
Nginx | great performance and response times | has no support for .htaccess, needs manual configuration for URL rewrites | NO |
Nginx+Apache | great performance and response times, full support for .htaccess | high memory usage | YES for servers with 8+ GB of RAM |
OpenLiteSpeed | great performance, HTTP/3 support, built-in page caching | minimal .htaccess support | YES |
LiteSpeed | great performance, HTTP/3 support, page caching available, suitable for high-traffic sites, stunning performance | commercial | YES |
OpenLiteSpeed might be a great option for WordPress-only hosting or other CMSs that have the LSCache caching plugin.
How to switch between webservers?
cd /usr/local/directadmin/custombuild
./build set webserver apache
./build php1_mode fastcgi
./build php2_mode fastcgi
./build php3_mode fastcgi
./build php4_mode fastcgi
./build apache
./build php n
./build rewrite_confs
cd /usr/local/directadmin/custombuild
./build set webserver nginx
./build set php1_mode php-fpm
./build nginx
./build php d
./build rewrite_confs
cd /usr/local/directadmin/custombuild
./build set webserver nginx_apache
./build nginx_apache
./build rewrite_confs
cd /usr/local/directadmin/custombuild
./build set webserver openlitespeed
./build set php1_mode lsphp
./build openlitespeed
./build php n
./build rewrite_confs
cd /usr/local/directadmin/custombuild
./build set webserver litespeed
./build set php1_mode lsphp
./build set php2_mode lsphp
./build set php3_mode lsphp
./build set php4_mode lsphp
./build litespeed
./build php n