Autoupdate

#1
Hi all,
My client need to autoupdate openlitespeed regularly without console access.
OLS installed from binary repo.
Can I use cron to test?
lsup cannot do this - test and upgrade if new version appears, as I see.
Any help would be welcome.
 

Pong

Administrator
#2
If you install from LiteSpeed repo, you can continute doing so , such as "yum update openlitespeed" and set it in your daily cron.
 

Pong

Administrator
#4
You should enable edge repo, https://openlitespeed.org/kb/upgrade-ols-to-edge-tier/.


How did you install 1.6.5 before? you should not mix the installation method, for example, if you install OLS 1.6.5 through the binary install, you should not change to repo install. If you install OLS through repo without edge repo enabled, it should be only 1.5.x. If you have enabled edged repo before, it should just upgrade 1.6.5 to latest version 1.6.6. this KB tells you more about this https://openlitespeed.org/kb/how-to-upgrade-openlitespeed/
 
Last edited:
#5
Yes, I uninstalled ls with apt purge and upgraded it with binary. But the question remains - how to automatically update binary installation?
 
#7
It updates the installation from 1.6.5 to 1.6.5 - not only test. Moreover, it downloads binary each time when launched.
But the question is - how to test installation and update when only needed?

Code:
lsup.sh Version: v2.3-12/27/2019.
download URL is https://openlitespeed.org/packages/openlitespeed-1.6.6.tgz
2020-01-27 16:09:04 URL:https://openlitespeed.org/packages/openlitespeed-1.6.6.tgz [51504888/51504888] -> "ols.tgz" [1]
[OK] litespeed: stopped.
Openlitespeed web server exists, will upgrade.
[ERROR] litespeed is not running.
INSTALL_TYPE is upgrade
Cannot find RUBY installation, remember to fix up the ruby path configuration
before you can use our easy RubyOnRails setup.

Target_Dir:/usr/local/lsws User:www-data Group:www-data
Admin:admin Password: AdminSSL:yes ADMIN_PORT:7080
LSINSTALL_DIR:/usr/local/lsws/autoupdate/openlitespeed
TEMP_DIR:/tmp/lshttpd PID_FILE:/tmp/lshttpd/lshttpd.pid

-e Installing, please wait...

Admin SSL enabled!
download comamnd is wget -nv -O
2020-01-27 16:09:08 URL:http://cyberpanel.sh/?ip [13/13] -> "/usr/local/lsws/myip" [1]
Can't load /root/.rnd into RNG
140589355385280:error:2406F079:random number generator:RAND_load_file:Cannot open file:../crypto/rand/randfile.c:88:Filename=/root/.rnd
Generating a RSA private key
............+++++
...........................................................+++++
writing new private key to 'webadmin.key'
-----
SSL host is [webadmin], use adminSSL
groupadd: group 'lsadm' already exists
useradd: user 'lsadm' already exists
download comamnd is wget -nv -O
admin_php found and mv to admin_php.bak
2020-01-27 16:09:12 URL:http://www.litespeedtech.com/packages/lsphp5_bin/x86_64/lsphp5 [4902224/4902224] -> "/usr/local/lsws/admin/fcgi-bin/admin_php" [1]
admin_php downloaded.
[OK] lshttpd.service has been successfully installed!
-e Updating webcache manager, please waiting ...
Downloading latest shared code tar file...
Checking tar file md5...
Removing existing shared code directory...
Extracting downloaded shared code...
Removing local shared code tar file...
Updating lscmctl script...
Done!

-e Installation finished, Enjoy!

-e Your webAdmin password not changed.
sh: 0: getcwd() failed: No such file or directory
[OK] litespeed: pid=27729.
All binaries are updated and service is on.
 

Pong

Administrator
#8
Do you mean it just install 1.6.5 instead of 1.6.6? but I can see it download 1.6.6 and install it. Please confirm. seems upgrade successfully through manually running.

There is no such "test installation". The script should check what's the stable version and compare with the version installed and upgrade when needed.
 
Last edited:
#9
I have updated it tomorrow morning to 1.6.6. lsup installed 1.6.6 over 1.6.6.
Once more:
Code:
# /usr/local/lsws/admin/misc/lsup.sh
lsup.sh Version: v2.3-12/27/2019.
download URL is https://openlitespeed.org/packages/openlitespeed-1.6.6.tgz
2020-01-27 16:50:51 URL:https://openlitespeed.org/packages/openlitespeed-1.6.6.tgz [51504888/51504888] -> "ols.tgz" [1]
[OK] litespeed: stopped.
Openlitespeed web server exists, will upgrade.
[ERROR] litespeed is not running.
INSTALL_TYPE is upgrade
Cannot find RUBY installation, remember to fix up the ruby path configuration
before you can use our easy RubyOnRails setup.

Target_Dir:/usr/local/lsws User:www-data Group:www-data
Admin:admin Password: AdminSSL:yes ADMIN_PORT:7080
LSINSTALL_DIR:/usr/local/lsws/autoupdate/openlitespeed
TEMP_DIR:/tmp/lshttpd PID_FILE:/tmp/lshttpd/lshttpd.pid

-e Installing, please wait...

Admin SSL enabled!
download comamnd is wget -nv -O
2020-01-27 16:50:56 URL:http://cyberpanel.sh/?ip [13/13] -> "/usr/local/lsws/myip" [1]
Can't load /root/.rnd into RNG
139805732184512:error:2406F079:random number generator:RAND_load_file:Cannot open file:../crypto/rand/randfile.c:88:Filename=/root/.rnd
Generating a RSA private key
...............+++++
..............................+++++
writing new private key to 'webadmin.key'
-----
SSL host is [webadmin], use adminSSL
groupadd: group 'lsadm' already exists
useradd: user 'lsadm' already exists
download comamnd is wget -nv -O
admin_php found and mv to admin_php.bak
2020-01-27 16:50:59 URL:http://www.litespeedtech.com/packages/lsphp5_bin/x86_64/lsphp5 [4902224/4902224] -> "/usr/local/lsws/admin/fcgi-bin/admin_php" [1]
admin_php downloaded.
[OK] lshttpd.service has been successfully installed!
-e Updating webcache manager, please waiting ...
Downloading latest shared code tar file...
Checking tar file md5...
Removing existing shared code directory...
Extracting downloaded shared code...
Removing local shared code tar file...
Updating lscmctl script...
Done!

-e Installation finished, Enjoy!

-e Your webAdmin password not changed.
sh: 0: getcwd() failed: No such file or directory
[OK] litespeed: pid=29129.
All binaries are updated and service is on.
i.e. it makes update without the testing the version
 

Pong

Administrator
#13
OLS can be run as www-data, but the installation of OLS or upgrade OLS will need to run as "root" user, can not be other users, hence the upgrade will be root or sudo
 
#16
I cannot remember where I read this, but I have a conflict of rights on virtual server (log files access for example) when I used repo installation. After installing from binary and edited ols.conf all problems escaped.
So I choose installation from binary. It works like a charm, but the problem of automatically updating persists.
 

Pong

Administrator
#17
1. repo installation should not cause a problem. if you like, we can take a look to see where misconfigured if you want to log a ticket and send us the login.
2. you can build your script to run as "root" user through lsup.sh script. The webserver and PHP will run as "www-data:www-data" after installation, but you will need "root" to run lsup.sh.
I hope it clear.
 
#19
The bash script to insert in your crontab
Code:
#!/bin/bash
if [ "$( curl -s 'https://openlitespeed.org/packages/release' )" != "$( cat '/usr/local/lsws/VERSION' )" ]
then
        /usr/local/lsws/admin/misc/lsup.sh
else
        echo "Openlitespeed is up to date"
fi
 
Top