在 WHM 安裝 XVARNISH
https://repo.cachewall.com/
Install xVarnish
Installation Commands For WHM Server with CentOS 7
rpm -ivh https://repo.cachewall.com/cachewall-release.rpm
yum install cachewall
Upgrade
To upgrade Cachewall, run:
yum update cachewall
Once you have your license key, run:
/usr/local/xvarnish/bin/activate --key <license-key>
Cachewall is not enabled automatically by default. Once you're ready you can simply access the Cachewall plugin under WebHost Manager to make the web server switch. You can run this right from the command line too:
xvctl enable cachewall
xvctl enable https
During the enable process, your traditional HTTP service (Apache, LiteSpeed, etc) is configured to listen on HTTP port 0.0.0.0:82 to serve as the backend for Varnish Cache, and Varnish Cache is configured to listen on HTTP port 0.0.0.0:80. Varnish Cache receives requests and if necessary, forwards them to the HTTP backend to retrieve the response. When Cachewall HTTPS is enabled, your traditional HTTPS service is configured to listen on port 0.0.0.0:445, and Hitch is configured to replace it on HTTPS port 0.0.0.0:443. Hitch terminates TLS and proxies plaintext requests to Varnish Cache via PROXY port 127.0.0.1:6086, where the request is then sent to the HTTPS backend if necessary. These changes are reverted when Cachewall is disabled, and the involved port numbers are configurable if necessary.
Want to live on the edge? Install the latest testing release with:
yum install cachewall --enablerepo=cachewall-edge
Troubleshooting
Cachewall's xvctl utility provides the -v option to enable debug output and logging. If you're facing troubles, it's usually helpful to add this argument onto your command. You can actually specify -v multiple times to increase verbosity. For example: xvctl -vvv enable https
It's also possible to enable debug logging in the Cachewall configuration file. Edit /usr/local/xvarnish/settings and set log_level = DEBUG. You'll see debug log messages written into /var/log/xvarnish/xvarnish.log when xvctl runs. The xvhealth and xvstats service must be restarted before they'll pick up changes to log_level.
You may set LOG_ECHO=1 in your environment to enable debug logging for xvctl (export LOG_ECHO=1
). Use this variable to enable debug logging for problems during installation and upgrades: export LOG_ECHO=3 yum update cachewall
Cachewall may be disabled at any time via the WebHost Manager plugin, and the disable process immediately reverts all cPanel and web service configurations to their original. If you experience a significant problem you should disable Cachewall and get in touch with our support. To immediately disable Cachewall and Varnish Cache, run:
xvctl disable cachewall
Use the revert-apache.sh shell script if xvctl is not functional:
bash /usr/local/xvarnish/bin/revert-apache.sh
Uninstall
Run the command below to fully uninstall Cachewall. Please note that we recommend disabling Cachewall but leaving it installed in the event you're experiencing a significant problem. Cachewall performs the same configuration revert during disable as it would for a full uninstall; the software shouldn't impact your service while its disabled. This helps us greatly while investigating any support help requests.
To uninstall, run:
yum remove cachewall cachewall-vmods cachewall-release varnish
Cachewall leaves some configuration files in /usr/local/xvarnish and log files in /var/log/xvarnish. If you wish to remove everything, run:
rm -rI /usr/local/xvarnish /var/log/xvarnish