If you are running chrooted lighttpd web server, upgrade procedure is a bit tricky. You need to upgrade webserver, as well as php and related extensions.
Following is common sequence you need to follow. I am just going to write down all steps, followed by actual Linux commands. If you need detailed instructions, please see how to install and configure lighttpd in chrooted jail.
Step # 1: Stop or shutdown lighttpd web server
# /etc/init.d/lighttpd stop
Step # 2: Backup existing chrooted directory (such as /webroot) to another partition or directory:
# mkdir /root/old.lighttpd
# tar -zcvf /root/old.lighttpd/webroot.tar.gz /webroot
Step # 3: Download latest lighttpd. Upgrade lighttpd using rpm:
# rpm -Uvh lighttpd*
Or using apt-get
# apt-get update; apt-get install lighttpd
Or using source code installation (make sure you use old ./configure syntax)
# ./configure
Now upgrade PHP and php-mysql extensions using rpm or apt-get commands.
# make
# make install
# rpm php*
OR
# apt-get php4-cgi php4-mysql
Step # 4: Now upgrade chrooted lighttpd which is located at /webroot:
# cd /webroot
# rm -rf usr
# rm -rf lib
# cp /usr/bin/php4-cgi /webroot/usr/bin/
# cp /usr/bin/php4 /webroot/usr/bin/
# /bin/l2chroot /usr/bin/php4
# /bin/l2chroot /usr/bin/php4-cgi
# cp /lib/ld-linux.so.2 /webroot/lib
Copy mysql extnsion
# cp /usr/lib/php4/20060606/mysql.so /webroot/usr/lib/php4/20060606/
Repeat above procedure to copy all your php shared modules such as php-imap, php-gd, php-memcache etc.
Step # 5: Now Start lighttpd:
# /etc/init.d/lighttpd start
Step # 6:Make sure everything is working perfectly:
# tail -f /var/log/message
# netstat -tulpn
Make sure you copy other essentials file such as /usr/sbin/sendmail (or mini_sendmail) to chrooted jail.
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
- RSS feed or Weekly email newsletter
- Share on Twitter • Facebook • 0 comments... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |