Documents Product Categories OpenLiteSpeed WordPress

OpenLiteSpeed WordPress

Jun 28, 2024
Listeners, and add Your Domain to HTTP/HTTPS. Step 3. Certbot Once the DNS records are set up, you can generate the SSL certicate. Be sure to substitute the correct domain name in the following command: certbot certonly --webroot -w /var/www/html/ -d example.com -d www.exampl If certicate verication is a success, you should nd your certicate les stored in /etc/letsencrypt/ Step 4. Set SSL for HTTPS Navigate to OpenLiteSpeed Web Server WebAdmin > Listeners > SSL, and edit the following three items: /Private Key File = /etc/letsencrypt/live/example.com/privkey.pem Certicate File = /etc/letsencrypt/live/example.com/fullchain.pem Chained Certicate = Yes Save and perform a Graceful Restart. Now your server should support TLS1.1, TLS 1.2, and TLS 1.3. Step 5. Redirect HTTP to HTTPS HTTPS trafc on port 443 is already allowed through the rewall. After you set up HTTPS, you can optionally rewrite all HTTP trafc to HTTPS. Add the following rules to OpenLiteSpeed Web Server WebAdmin > Virtual Hosts > Rewrite > Rewrite Rules RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://example.com/$1 [R,L] Method for Uploading Files You can serve les from the web server by adding them to the web root using SFTP or other tools. Methods for Migrating Wordpress If you already have a WordPress site elsewhere, you can migrate it using one of the following methods. Single-Site by Duplicator Plugin /1. Install and activate the Duplicator plugin on the WordPress site you’re copying from. 2. Navigate to Duplicator > Packages, then click the Create New button. 3. Go through the wizard. When you see "Package Completed," click the One-Click Download link to download two les. 4. Move the two les ( installer.php and a zip le) into the folder you’ll want the WordPress site in. 5. Visit installer.php in a web browser and you should see a wizard screen. 6. Click I have read and accept all terms & notices and Next 7. You’ll need to have a database ready. Enter the database name, user, and password. 8. Click the Site Login button and log in to your WordPress site using the same username and password as you have on the remote site. Multi-Site by Duplicator Plugin 1. Install plugin. 2. Network activate plugin. 3. On site 1, perform the backup. That will capture the entire site into a package. 4. Restore the site in the new location just as in the Single Site procedure. Manually by WordPress 1. Back up WordPress 2. Back up the database 3. Move the directories Install LSCache After Migration This step is only necessary if you have migrated a WordPress installation or it''s a fresh wordpress installation. /To benet from high performance and a nice page score, don''t forget to install the LSCache Plugin Improve Your Page Score CSS/JS/HTML Optimization Image Optimize Switch Object Cache Method By default we have Memcached enabled. To swich to Redis is easy. Just copy the Redis socket path to LSCache Plugin > Settings > Advanced > Object Cache and save: Memcached: /var/www/memcached.sock Redis: /var/run/redis/redis-server.sock Frequently Asked Questions How do I Reset my Web Server WebAdmin Password? If you forget your password, you may run the following command to reset it: /usr/local/lsws/admin/misc/admpass.sh It will ask for the WebAdmin username, which should be admin . Then, enter your new password. How do I Create Additional Virtual Hosts? Auto Setup via Script This method will automatically set up Listener/VirtualHost/Force SSL/Let''s Encrypt/WordPress. /Interactive mode wget https://raw.githubusercontent.com/litespeedtech/ls-cloud-image/master/Setup/vhsetup.sh chmod +x vhsetup.sh bash vhsetup.sh Or just run the script without downloading it: /bin/bash <( curl -sk https://raw.githubusercontent.com/litespeedtech/ls-cloud- image/master/Setup/vhsetup.sh ) CLI mode wget https://raw.githubusercontent.com/litespeedtech/ls-cloud-image/master/Setup/vhsetup.sh chmod +x vhsetup.sh bash vhsetup.sh -d www.example.com -le admin@example.com -f -w Or just run the script without downloading it: /bin/bash <( curl -sk https://raw.githubusercontent.com/litespeedtech/ls-cloud- image/master/Setup/vhsetup.sh ) -d www.example.com -le admin@example.com -f -w Please be sure that your domain is already pointing to the server when using -le YOUR_EMAIL Please be sure that your environment has php/sql service/sql root password when using -w Manual Setup By default, OpenLiteSpeed has an example virtual host already created. You can create more virtual hosts if you like. See Create Virtual Hosts on OpenLiteSpeed. How do I Verify if Cache is Working? Visit your website using Chrome. Navigate to Chrome menu > More tools > Developer tools > Network, or simply use the shortcut Ctrl+Shift+I to bring it up. The test page may contain many requests, but you can just click your main domain to check the header. You might see X- LiteSpeed-Cache: miss or X-LiteSpeed-Cache: hit . Normally the rst visit to a page is a miss , but subsequent visits should be a hit . How Certbot''s Auto Renew Script Works? /Image comes with cert auto renew by default in /etc/cron.d/certbot. This cron job would get triggered twice every day to renew certicate. Line certbot -q renew will check if certicate is getting expired in next 30 days or not. If it is getting expired then it will auto renew it quietly without generating output and auto restart web server by hook. If certicate is not getting expired then it will not perform any action. While renewing certicate it will use same information provided during certicate creation such as email address, domain name, web server root path etc. How do I x Object Cache test fail issue? Sometimes system upgrade may cause cong le being updated. So rst thing you can do is to check user permission For Memcached: vi /etc/memcached.conf Make sure -u www-data For Redis: vi /lib/systemd/system/redis-server.service Make sure Group=www-data How Do I Set Up the PageSpeed Module? You should not need to install the PageSpeed Module if the LiteSpeed Cache plugin for WordPress is already in use. Enabling both may degrade performance by 10% or more. To install the module, please see the OpenLiteSpeed PageSpeed Module knowledgebase article. How do I Create Additional Databases? Method 1: Through phpMyAdmin See Installing WordPress Using phpMyAdmin Method2 : Through SSH Log into MySQL as root: /mysql -u root -p Add a new database wordpress2 and user newuser with password password : create database wordpress2; grant all privileges on wordpress2.* to ''newuser''@''localhost'' identified Flush priveleges; exit How do I Install Postx? For Ubuntu (non interactive mode) DEBIAN_FRONTEND=noninteractive apt-get -y \ -o Dpkg::Options::=''--force-confdef'' \ -o Dpkg::Options::=''--force-confold'' install postfix For CentOS yum -y install postfix How do I Recongure Postx? Run the following command: dpkg-reconfigure postfix Congure the settings as follows: General type of mail conguration? Internet Site System mail name: example.com (not mail.example.com) Root and postmaster mail recipient: ubuntu (your user name) Other destinations to accept mail for: (to use default value) Force synchronous updates on mail queue? No Local networks: 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 /Mailbox size limit: 0 Local address extension character: + Internet protocols to use: all Congure Postx to Send Mail Using Gmail How do I secure phpMyAdmin? Method 1. Change your phpMyAdmin URL Navigate to WebAdmin > Virtual Hosts > Context Change URI from /phpmyadmin to (for example) /secure Method 2. Require a Password Log into SSH console and create a password le: touch /usr/local/lsws/conf/PASS chown lsadm:lsadm /usr/local/lsws/conf/PASS Navigate to WebAdmin > Security Set Realm Name = example , and User DB Location = /usr/local/lsws/conf/PASS Click /usr/local/lsws/conf/PASS to create a user/password Navigate to WebAdmin > Virtual Hosts > Context > phpmyadmin Set Realm to example How do I Update phpMyAdmin? The image comes with the latest phpMyAdmin version already, so you shouldn''t need to update it. If you do need to update it, you can run the following commands: cd /var/www/; mv phpmyadmin phpmyadmin.bak wget https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages unzip phpMyAdmin-*.zip; rm -f phpMyAdmin-*.zip mv phpMyAdmin-* phpmyadmin cp phpmyadmin.bak/config.inc.php phpmyadmin chown -R www-data:www-data phpmyadmin /How do I Change PHP Parameters? Edit the following le to congure PHP parameters: vi /usr/local/lsws/lsphp73/etc/php/7.3/litespeed/php.ini NOTE: We are using LSPHP 7.3 as example. If you are using a different version, please adjust the number in the URL accordingly. To increase the allowed le size, for example, you would make the following edits: upload_max_filesize = 64M post_max_size = 64M Other parameters in the le may also be changed, if needed. How do I Fix a Too Many Open Files Issue? The default system value is 1024 . To increase the value to e.g. 65535 , please append following content to the /etc/security/limits.conf le: * soft nproc 65535 * hard nproc 65535 * soft nofile 65535 * hard nofile 65535 root soft nproc 65535 root hard nproc 65535 root soft nofile 65535 root hard nofile 65535 Then, add the following to the /etc/pam.d/common-session le: session required pam_limits.so To verify, run the ulimit -n command. Output should read 65535 . NOTE: 65535 is an example. Feel free to use a different value How do I Set Up Virtual-Host-Specic PHP? /By default virtual hosts inherit the version of PHP that is set at the server level. You may wish to use a different PHP version for certain virtual hosts. Follow the steps below to set up virtual- host-level PHP. Here we will use the PHP version 7.4 as an example. Install PHP 7.4 and commonly used PHP extensions: apt-get install lsphp74 lsphp74-common lsphp74-curl lsphp74-imagick lsphp Navigate to WebAdmin console > Server Conguration > External App > Add > Type > LiteSpeed SAPI App to set up a server-level external application. Set the following values: Name: lsphp74 Address: uds://tmp/lshttpd/lsphp74.sock Max Connections: 35 Environment: LSAPI_AVOID_FORK=200M Initial Request Timeout (secs): 60 Retry Timeout (secs): 0 Command: /usr/local/lsws/lsphp72/bin/lsphp Instances: 1 Navigate to WebAdmin console > Virtual Hosts > your vhost > Script Handler > Add to add a virtual-host-level PHP handler. Set the following values: Sufxes: php Handler Type: LiteSpeed SAPI Handler Name: [Server Level]:lsphp74 OpenLiteSpeed come with php detached mode by default, so need to restart php with command killall -9 lsphpnew to make settings take effect /">
To view the full page, please visit: OpenLiteSpeed WordPress Product Userguide

OpenLiteSpeed WordPress

Blazing-fast WordPress with LSCache, ready to use in production
Buy now