====== Configuration How-Tos ====== This section of the wiki provides articles on configuring LiteSpeed Web Server to achieve desired functionality, better performance, or security. These wikis do not cover what each LSWS setting does. That information can be found in our [[https://www.litespeedtech.com/docs/webserver/config|documentation]]. Also [[litespeed_wiki:cache:lscache|LiteSpeed Cache]], [[litespeed_wiki:cache:litemage|LiteMage Cache]], [[litespeed_wiki:php|PHP]], and [[litespeed_wiki:other-ext-apps|other external applications]] (Python, Ruby, etc.) are covered in their own sections of the wiki and are not included here. Most of the time, users may use LSWS in a control panel environment and LSWS will read and run based on Apache configuration. You can also configure LSWS to read your existing Apache configuration if you have a working Apache server running without a control panel. In these scenarios, users may continue to set up everything in Apache, the same way as before. Sometimes, users may run LSWS natively without a control panel. In this case, users can check LSWS native configuration through LSWS Admin Console. ===== Basic Command Reference ===== Please see [[litespeed_wiki:admin:command-reference|Quick Reference for All Commands]]. ===== Understanding Apache Configuration ===== Why do you need to understand Apache configuration if you are using LSWS Web Server? LiteSpeed is a drop-in replacement in a control panel environment, which means that LiteSpeed can read Apache configuration files and run LSWS based on Apache's settings. Most of the time, configuration changes on Apache will reflect directly on LSWS as well. LiteSpeed's implementation of Apache functionality includes (but is not limited to) the following Apache modules. This list is gradually expanding as new feature requests are implemented: ''mod_access'', ''mod_actions'', ''mod_alias'', ''mod_auth'', ''mod_auth_ldap'', ''mod_auth_passthrough'', ''mod_autoindex'', ''mod_cache'', ''mod_cgi'', ''mod_expires'', ''mod_fastcgi'', ''mod_frontpage'', ''mod_geoip'', ''mod_gzip''/''mod_deflate'', ''mod_jk'', ''mod_mime'', ''mod_php'', ''mod_proxy'', ''mod_rewrite'', ''mod_security'', ''mod_ssl'', ''mod_suexec'', and ''mod_throttle''. LiteSpeed Web Server also uses the same syntax as Apache for distributed configuration file (''.htacess'') and URL rewrite rules. Please check https://httpd.apache.org/docs/2.4/|Apache documentation]] for information about configuring Apache. ===== LSWS Native Configurations===== * [[https://www.litespeedtech.com/docs/webserver/config|LiteSpeed Web Server Native Configuration Items]] ===== New: LSWS 5.3 features Highlight ===== * [[litespeed_wiki:php:detached_mode| PHP detached mode to allow PHP processes to continue running through web server restarts and PHP handler auto configuration.]] * [[litespeed_wiki:cloudlinux:node.js_selector| Support for CloudLinux NodeJS selector]] * [[litespeed_wiki:cpanel:tls13| TLSv1.3 support]] * [[litespeed_wiki:cloudlinux:lsphp_criu_enable| PHP CRIU support in CloudLinux environments]] * [[litespeed_wiki:cache:common:geoip-support| Maxmind database support for GeoIP2 lookup]] * [[litespeed_wiki:cache:common:gzip-brotli-automatic-conversion| Brotli compression for dynamic responses and automatic gzip and brotli conversion for cached pages]] * [[litespeed_wiki:cache:auto-fix-cache-files-directories-permission| Improved cache engine to fix bad cache storage directory and file permissions]] * [[litespeed_wiki:config:lsws5.3-rewrite-improvement| Improve rewrite Engine to match Apache behavior]] ===== Performance Tips===== * [[litespeed_wiki:php:improve-performance|How to improve site performance]] * [[litespeed_wiki:php:server-load-issue|How to resolve high server load issue]] * [[litespeed_wiki:php:concurrency|How to control the number of connections your PHP engine can serve at once]] * [[litespeed_wiki:cloudlinux:cl_LVE_vs_lsws_PHP_suEXEC_Max_Conn|Understanding LSWS "PHP suEXEC Max Conn" and Cloudlinux LVE]] ===== QUIC ===== * [[litespeed_wiki:config:Enable QUIC|How to Enable QUIC at the Server Level]] * [[litespeed_wiki:config:disable_quic|How to Disable/Enable QUIC at the VHost and Listener Levels]] * [[litespeed_wiki:config:Quic makes quicker|How QUIC makes the web quicker]] * [[litespeed_wiki:config:Supported Quic Versions|QUIC versions supported by LiteSpeed Web Server]] ===== PageSpeed ===== * [[litespeed_wiki:config:Enable PageSpeed|How to enable the PageSpeed module]] * [[litespeed_wiki:config:Compare PageSpeed and LSCache|Comparing PageSpeed and LSCache]] ===== LiteSpeed-Supported mod_passenger Rules ===== * [[litespeed_wiki:config:mod_passenger|LiteSpeed-Supported mod_passenger Rules]] ===== Proxy ===== * [[litespeed_wiki:proxy:lsws-as-a-proxy|How to set up LiteSpeed Web Server as a Proxy via Contexts]] * [[litespeed_wiki:proxy:lsws-as-a-proxy-rewrite|How to set up LiteSpeed Web Server as a Proxy via Rewrite Rules]] ===== GeoLocation ===== * [[litespeed_wiki:config:GeoLocation|How to enable GeoLocation]] * [[litespeed_wiki:config:ip2location|How to enable IP2Location]] ===== Header Settings===== * [[litespeed_wiki:config:CORS|How to enable CORS on LSWS]] * [[litespeed_wiki:config:Server Push|How to use Server Push on LSWS]] * [[litespeed_wiki:config:header-edit-set-cookie|Alternative way for ''Header always edit Set-Cookie'' directive on LSWS]] ===== Security ===== * [[https://www.litespeedtech.com/docs/webserver/security|LiteSpeed Web Server Security Overview]] * [[litespeed_wiki:config:mitigating-syn-floods|Mitigating SYN Floods by hardening your kernel]] * [[litespeed_wiki:config:shared-hosting-security|Shared Hosting Security: Access Permission isolation]] * [[litespeed_wiki:config:suexec-mode|suEXEC Mode / Process UID isolation: CGI/FCGI/LSAPI/PHP]] * [[litespeed_wiki:config:chroot|Process Execution isolation]] * [[litespeed_wiki:config:mod_security-compatibility|Apache mod_security 2.5+ compatibility]] * [[https://www.atomicorp.com/wiki/index.php/Litespeed|Explanation of Atomicorp's support of LSWS and how to set it up]] * [[litespeed_wiki:cloudlinux:cagefs|CloudLinux CageFS How-To: Installation and Configuration]] * [[litespeed_wiki:config:hsts-setup|How to set up HTTP Strict Transport Security (HSTS)]] * [[litespeed_wiki:config:vhost-level_bw_throttling|Virtual Host-Level Bandwidth Throttling: Set different bandwidth limits for different sites]] * [[litespeed_wiki:config:disable-cgi|How to disable CGI scripts]] * [[litespeed_wiki:config:wordpress-protection|How WordPress Brute Force Protection works]] * [[litespeed_wiki:config:authenticate|How to setup Site Authentication through context or .htaccess]] * [[litespeed_wiki:config:recaptcha|reCAPTCHA]] * [[litespeed_wiki:config:csf|ConfigServer Security & Firewall (CSF) LiteSpeed Configuration]] * [[litespeed_wiki:config:disable-http-methods|How to disable OPTIONS/TRACE/TRACK http methods]] ==== LSWS Built in Anti-DDoS Protection ==== * [[https://store.litespeedtech.com/store/knowledgebase.php?action=displayarticle&id=125|Understanding LiteSpeed Advanced Anti-DDos Setup Service]] * [[litespeed_wiki:config:mitigating-ddos-attacks|Mitigating HTTP-level DDoS attacks with LSWS's security features]] * [[litespeed_wiki:config:cloudflare-ips-or-subnets|How to avoid LSWS Anti-DDoS blocking CloudFlare IP/subnet connections]] ==== HTTPS/SSL Configuration ==== * [[litespeed_wiki:config:ssl-private-key|How to create an SSL private key]] * [[litespeed_wiki:config:ssl-self-signed-cert|How to create a self signed SSL certificate ]] * [[litespeed_wiki:config:ssl-cert-request|How to create an SSL certificate request from CA issuer]] * [[litespeed_wiki:config:ssl-cert-install|How to install an SSL certificate]] * [[litespeed_wiki:config:admin-SSL|How to secure the Web Administration console with SSL]] * [[litespeed_wiki:config:https-redirect|How to redirect from plain http connection to secured https connection]] * [[litespeed_wiki:config:ocsp-stapling|How to set up OCSP stapling for faster SSL]] * [[litespeed_wiki:config:letsencrypt-ssl|How to set up SSL with Let's encrypt]] * [[litespeed_wiki:faq:disabling-http2|Disabling HTTP/2 per virtual host]] ===== Logs/Monitoring ===== * [[litespeed_wiki:config:centralized-syslog-or-splunk-logging|High performance logging of LiteSpeed logs to syslog/splunk via UDP]] * [[litespeed_wiki:config:snmp-cacti-monitoring|Monitor LiteSpeed real-time metrics via SNMP client and full-Cacti log/graph integration]] * [[litespeed_wiki:config:rrd-graph-monitoring|Monitor LiteSpeed Server Status via RRD Graph]] * [[litespeed_wiki:config:piped-logger|Flexible logging with piped logger]] * [[litespeed_wiki:config:awstats|How to use the integrated AWstats log analyzer]] * [[litespeed_wiki:php:new_relic|How to get New Relic to work with LSWS]] * [[litespeed_wiki:config:real-time-stats|Real-Time Statistics in Admin Console]] * [[litespeed_wiki:config:error-messages|How to deal with "Child Process Killed" message in stderr.log]] ===== Streaming Media ===== * [[litespeed_wiki:config:flv-streaming|Flash Video (FLV) Streaming (random seek)]] * [[litespeed_wiki:config:mp4-streaming|MP4/H264/F4V Video Streaming]] ===== Tuning ===== * [[litespeed_wiki:config:brotli:start|How to Disable Brotli Server Wide or on a per Account/Domain basis]] * [[litespeed_wiki:config:gzip-compression|How to use gzip compression to save bandwidth]] * [[litespeed_wiki:config:gzip-compression-enable-globally-disable-VH|How to disable gzip compression on VH level while enabled globally?]] * [[litespeed_wiki:config:linux-kernel-tune|How to tune Linux OS for maximum performance for LiteSpeed.]] * [[litespeed_wiki:config:increasing-os-file-descriptor-limit|How to increase the file descriptor limit]] * [[litespeed_wiki:config:internal-redirect|How to use the x-sendfile or x-accel-redirect feature]] * [[litespeed_wiki:config:nf-conntrack-table-full|How to deal with the "nf_conntrack: table full, dropping packet." issue]] * [[litespeed_wiki:config:vhost-level_bw_throttling|Virtual Host-Level Bandwidth Throttling: Set different bandwidth limits for different sites]] * [[litespeed_wiki:config:ram_disk_path|Understanding RAM Disk Path Setting and its role in I/O load]] * [[litespeed_wiki:config:keep_alive|How to set "keep alive" for your site]] * [[litespeed_wiki:config:disable_php_override_htaccess|How to disable PHP override in .htaccess with LSWS?]] * [[litespeed_wiki:config:external_application_abort|How to keep a script running even the client disconnected?]] * [[litespeed_wiki:config:envirnment_variables|Special environment variables in LiteSpeed Rewrite Rules]] ===== Rewrite rules ===== * [[litespeed_wiki:config:rewrite-rules-lsws-vs-apache|Differences in Rewrite rules between LSWS and Apache]] * [[litespeed_wiki:config:special-rewrite-rule-directive|How to use special directives in rewrite rules]] * [[litespeed_wiki:config:rewrite-inside-location-not-supported|Rewrite rules inside or are not supported by LSWS]] * [[litespeed_wiki:troubleshooting:rewrite_difference_on_l_flag_between_lsws_and_apache|Rewrite difference on "L" Flag between LSWS and Apache]] ===== Miscellaneous Customization ===== * [[litespeed_wiki:config:AutoIndex|AutoIndex Customization: How to customize auto index script]] * [[litespeed_wiki:config:microsoft-frontpage-server-extensions-2002-installation|How to install Microsoft FrontPage Server Extensions 2002]] * [[litespeed_wiki:config:multiviews|How to handle MultiViews]] * [[litespeed_wiki:config:enable-http2|How to enable HTTP2]] * [[litespeed_wiki:config:disable-tls1|How to disable TLS1.0 while enabling TLS1.2 and TLS1.3]] * [[litespeed_wiki:config:add-mime-type|How to add MIME type if it doesn't exist]] * [[litespeed_wiki:config:show-real-ip-behind-a-proxy|How to restore a real visitor IP behind a proxy]] * [[litespeed_wiki:config:redirect_cgi-bin_no_exist_404|How to fix the 404 error when redirecting /cgi-bin/script]] * [[litespeed_wiki:config:internal-redirect|Internal Redirect: For those seeking x-sendfile or x-accel-redirect feature. We show you how with LiteSpeed.]] * [[litespeed_wiki:config:ifdefine-ifmodule-litespeed-apache-difference|IfDefine/IfModule, LiteSpeed acts differently than Apache]] ===== Troubleshooting errors ===== * [[litespeed_wiki:config:understanding_500|Understanding 500 error and how to fix it]] * [[litespeed_wiki:config:understanding_404|Understanding 404 error how to fix it]] * [[litespeed_wiki:config:understanding_403|Understanding what may cause 403 error]] * [[litespeed_wiki:config:max_SSL_connections_reached|How to fix "max SSL connections reached"]] ===== Setup LSWS as load balancer ===== * [[litespeed_wiki:proxy:lsws-as-a-load-balancer|How to set up LSWS as load balancer]] ===== Unsupported Apache modules or directives ===== * [[litespeed_wiki:config:unsupported_apache_modules_by_lsws|Apache modules or directives LSWS does support yet]] ===== LSWS native: Virtual Hosting ===== * [[litespeed_wiki:config:name-based-virtual-hosting-setup|How to set up name-based virtual hosting]] * [[litespeed_wiki:config:ip-based-virtual-hosting-setup|How to set up IP-based virtual hosting]] ===== Debugging ===== * [[litespeed_wiki:config:bug-reporting|How to file a LiteSpeed bug report]] * [[litespeed_wiki:config:toggle-debug-logging|Toggle Debug Logging: A feature for quickly switching between normal and very detailed log levels]] * [[litespeed_wiki:config:rewrite-logs|How to Enable Rewrite Logging: The first step in debugging rewrite rules]] * [[litespeed_wiki:config:rewrite-rule-troubleshooting|How to Debug Rewrite Rules]] ===== Custom Templates ===== Custom templates can be used to make LSWS virtual hosts, and simultaneously prepare them for popular web applications and plugins. All templates use LiteSpeed native configurations. //Templates are unnecessary if you are migrating an existing site with web applications from Apache.// * [[litespeed_wiki:config:virtual-host-template|How to use a template to configure a group of virtual hosts with similar configurations]] * [[http://open.litespeedtech.com/mediawiki/index.php/Help:How_To_Set_Up_WP_Super_Cache_With_Template|WP Super Cache: Template and tutorial for quick and easy set up of LSWS with WordPress and WP Super Cache]] * [[http://open.litespeedtech.com/mediawiki/index.php/Help:How_To_Set_Up_W3_Total_Cache_With_Template|W3 Total Cache: How to use a template to set up LSWS with WordPress and W3 Total Cache]] * [[http://open.litespeedtech.com/mediawiki/index.php/Help:How_To_Set_Up_Reverse_Proxy_With_Template|Reverse Proxy: Use a template to set up LSWS as a reverse proxy in under seven minutes]] * [[http://open.litespeedtech.com/mediawiki/index.php/Help:How_To_Set_Up_Mediawiki_With_Template|MediaWiki: Setting up MediaWiki with LSWS is faster and easier with a template]] * [[http://open.litespeedtech.com/mediawiki/index.php/Help:How_To_Set_Up_PHPBB_With_Template|phpBB: Set up this popular open source bulletin board application with a template]] * [[http://open.litespeedtech.com/mediawiki/index.php/Help:How_To_Set_Up_PHPList_With_Template|phpList: A tutorial and template for setting up phpList with LSWS]]