Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* installation OLS on Ubuntu 20.04 server */
- **update OS**
- sudo apt-get update
- sudo apt-get upgrade
- **disable SElinux (optional)**
- apt install policycoreutils
- sudo sestatus
- nano /etc/selinux/config
- put SELINUX=disabled
- reboot
- **install OLS web server and PHP**
- sudo wget -O - http://rpms.litespeedtech.com/debian/enable_lst_debian_repo.sh | sudo bash
- apt-get install openlitespeed
- apt-get install lsphp74 lsphp74-common lsphp74-curl lsphp74-imagick lsphp74-memcached lsphp74-imap lsphp74-json lsphp74-intl lsphp74-mysql lsphp74-opcache lsphp74-opcache lsphp74-redis
- ln -sf /usr/local/lsws/lsphp74/bin/lsphp /usr/local/lsws/fcgi-bin/lsphp5
- systemctl status openlitespeed
- netstat -plntu
- netstat -pl | grep lsphp
- **install MariaDB SQL database and configuration**
- sudo apt install mariadb-client mariadb-server
- systemctl start mariadb
- systemctl enable mariadb
- Systemctl status mariadb
- mysql_secure_installation
- Set a root password? [Y/n] Y
- Remove anonymous users? [Y/n] Y
- Disallow root login remotely? [Y/n] Y
- Remove test database and access to it? [Y/n] Y
- Reload privilege tables now? [Y/n] Y
- mysql -u root -p
- select User, Password, Host from mysql.user;
- mysql -u root mysql
- SET PASSWORD FOR root@localhost=PASSWORD('new_password');
- FLUSH PRIVILEGES;
- **setup access to WebAdmin Console**
- cd /usr/local/lsws/admin/misc/
- sh admpass.sh - put auth credentials for WebAdmin panel
- open URL and login:
- http://IP_address:7080/
- **install CSF firewall and open ports for OLS(optional)**
- wget http://download.configserver.com/csf.tgz
- tar -xvzf csf.tgz
- cd csf
- bash install.sh
- perl /usr/local/csf/bin/csftest.pl
- nano /etc/csf/csf.conf
- add ports 7080 and 8088 to firewall rules
- csf -r
- **set PHP 7.4 for LiteSpeed**
- http://[IP_address]:7080/
- follow 'Server Configuration' -> 'External App' -> click "+" (Add)
- choose 'LiteSpeed SAPI App' -> click the 'Next'
- fill configuration:
- Name: lsphp74
- Address: uds://tmp/lshttpd/lsphp.sock
- Notes: lsphp74 for OpenLiteSpeed
- Max Connections: 35
- Initial Request Timeout (secs): 60
- Retry Timeout (secs): 0
- Command: $SERVER_ROOT/lsphp74/bin/lsphp
- Save
- follow 'Server Configuration' -> 'Script Handler' -> click edit
- change handler name to 'lsphp74'
- Save
- Graceful restart
- check php version:
- http://IP_address:8088/phpinfo.php
- **set ports 80 and 443**
- follow 'Listeners' -> Default -> view
- edit 'Address Settings'
- change port 8088 to 80 (optional)
- Save
- graceful restart
- follow 'Listeners' -> Add (+)
- Listener name: HTTPS
- IP Address: ANY
- Port: 443
- Secure: Yes
- Save
- graceful restart
- **add new virtual host (domain website)**
- cd /usr/local/lsws
- mkdir domain.com
- cd domain.com
- mkdir {public_html,logs}
- follow 'Virtual Hosts' -> Add (+)
- Virtual Host Name: domain.com
- Virtual Host Root: $SERVER_ROOT/domain.com
- Config File: $SERVER_ROOT/conf/vhosts/domain.com/vhconf.conf
- Enable Scripts/ExtApps: Yes
- Restrained: Yes
- Save
- Click to create vhost.conf
- follow 'Virtual Host' -> View -> 'General' -> Edit
- Document Root: $VH_ROOT/public_html
- Save
- follow 'Listeners' -> Default -> Edit default 'Example.com' Virtual host mappings and change domain
- Save
- follow 'Listeners' -> HTTPS -> Edit and add new Virtual host mappings domain
- Save
- follow 'Virtual Host' -> Domain -> Rewrite and edit
- enable 'Rewrite' and 'Auto load from .htaccess'
- Graceful restart
- check URL:
- http://domain.com
- **install Memcached**
- apt-get install memcached
- systemctl start memcached
- systemctl enable memcached
- Now you can install WordPress in public_html or copy files.
- ***PHP.INI EDIT ***
- nano /usr/local/lsws/lsphp74/etc/php/7.4/litespeed/php.ini
- nano /usr/local/lsws/lsphp74/etc/php/7.3/litespeed/php.ini
- **** COMMANDS ****
- systemctl start lsws
- systemctl stop lsws
- systemctl restart lsws
- cat /usr/local/lsws/bin/openlitespeed -t //errors
- References:
- https://openlitespeed.org/kb/step-by-step-install-ols/
- https://openlitespeed.org/kb/ssl-setup/
- https://openlitespeed.org/kb/wordpress/
- https://openlitespeed.org/kb/how-to-setup-lscache-for-wordpress/
- https://www.howtoforge.com/tutorial/how-to-install-and-configure-openlitespeed-with-php-7-4-on-ubuntu-1804/
- https://www.howtoforge.com/tutorial/how-to-install-openlitespeed-with-php-on-centos-8/
- https://tungdt.net/install-openlitespeed-mariadb-php8-0-on-ubuntu-20-04-18-04-server/
- https://kamrul.dev/deploy-wordpress-with-openlitespeed-on-docker-swarm/
- https://developers.cloudflare.com/fundamentals/get-started/network-ports
- https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-openlitespeed-ubuntu-1804
- https://build-in-saratov.com/openlitespeed-aws/
Advertisement
Add Comment
Please, Sign In to add comment