Ubuntu 14.04.5LTS is a widely popular Linux distro for server and it still receives updates as of Feb 2019. However, the official maintenance period will soon end (April 2019) and hence it is prime time for upgrade.
Upgrading a standard LAMP from 14.04LTS to 16.04LTS is not as straight forward as it seems, especially the original server may be running for years receiving various patches to different minor versions (14.04.1, .2, .3, .4, and .5)
Below are the steps that had worked for me.
1. Ensure the 14.04 version is updated to 14.04.5LTS. This is the latest as of this writing. If you are running ISPConfig 3.1, it is recommended that you also upgrade ISPConfig prior to the distro upgrade.
2. apt-get update
3. apt-get upgrade
4. apt-get dist-upgrade
The above steps should patch the 14.04 to the latest version and with all the patches installed.
5. do-release-upgrade
This should then prompt a new version is ready for upgrade.
6. I have chosen to keep all existing "local" version of config files during the interactive upgrade process (which took about 50-60 minutes), depending on the speed of your server and internet connection etc. I am running on a Rackspace Cloud instance so the speed is quite fast.
7. A problem would occur at the end of the upgrade
(a) MySQL 5.5 to 5.7 upgrade did not work
(b) nano did not work (the binary can't be found)
7a - This is because MySQL 5.5 to 5.7 is not an official upgrade path. It should first be upgraded to 5.6 and then 5.7. Some internet articles suggest upgrading to MySQL 5.7 when you are still at 14.04LTS. I eventually solved this issue by following the steps here:
https://askubuntu.com/questions/760724/16-04-upgrade-broke-mysql-server
The steps are quoted below.
7b) This can be resolved with a single command at shell
hash -r
8. apt-get autoremove - this should clean up the server and remove quite a number of old kernels
9. Re-configure Apache2 so that it runs in correct mode. Follow the articles here:
https://www.mobibrw.com/2017/7068
Upgrading a standard LAMP from 14.04LTS to 16.04LTS is not as straight forward as it seems, especially the original server may be running for years receiving various patches to different minor versions (14.04.1, .2, .3, .4, and .5)
Below are the steps that had worked for me.
1. Ensure the 14.04 version is updated to 14.04.5LTS. This is the latest as of this writing. If you are running ISPConfig 3.1, it is recommended that you also upgrade ISPConfig prior to the distro upgrade.
2. apt-get update
3. apt-get upgrade
4. apt-get dist-upgrade
The above steps should patch the 14.04 to the latest version and with all the patches installed.
5. do-release-upgrade
This should then prompt a new version is ready for upgrade.
6. I have chosen to keep all existing "local" version of config files during the interactive upgrade process (which took about 50-60 minutes), depending on the speed of your server and internet connection etc. I am running on a Rackspace Cloud instance so the speed is quite fast.
7. A problem would occur at the end of the upgrade
(a) MySQL 5.5 to 5.7 upgrade did not work
(b) nano did not work (the binary can't be found)
7a - This is because MySQL 5.5 to 5.7 is not an official upgrade path. It should first be upgraded to 5.6 and then 5.7. Some internet articles suggest upgrading to MySQL 5.7 when you are still at 14.04LTS. I eventually solved this issue by following the steps here:
https://askubuntu.com/questions/760724/16-04-upgrade-broke-mysql-server
The steps are quoted below.
These are the steps I took to correct this:
- Back up your
my.cnf file
in/etc/mysql
and remove or rename itsudo mv /etc/mysql/my.cnf /etc/mysql/my.cnf.bak
- Remove the folder
/etc/mysql/mysql.conf.d/
usingsudo rm -r /etc/mysql/mysql.conf.d/
- Verify you don't have a
my.cnf
file stashed somewhere else (I did in my home dir!) or in/etc/alternatives/my.cnf
usesudo find / -name my.cnf
- Backup and remove
/etc/mysql/debian.cnf
files (not sure if needed, but just in case)sudo mv /etc/mysql/debian.cnf /etc/mysql/debian.cnf.bak sudo apt purge mysql-server mysql-server-5.7 mysql-server-core-5.7 sudo apt install mysql-server
- In case your syslog shows an error like "mysqld: Can't read dir of '/etc/mysql/conf.d/'" create a symbolic link:
sudo ln -s /etc/mysql/mysql.conf.d /etc/mysql/conf.d
Then the service should be able to start withsudo service mysql start
.
That got it working!
Note on step 3, if you found the my.cnf (which I had 2 additional my.cnf, just delete them with rm command). There had been no need to start mysql at end of step 5 because the installation script had started it automatically.7b) This can be resolved with a single command at shell
hash -r
8. apt-get autoremove - this should clean up the server and remove quite a number of old kernels
9. Re-configure Apache2 so that it runs in correct mode. Follow the articles here:
https://www.mobibrw.com/2017/7068
注意,此时
Apache
默认被切换到了Prefork MPM
工作模式,我们需要手工切换回到Event MPM
工作模式。
正常情况下,这个版本的
Apache
可能默认启用了内嵌的PHP 7.0
支持,可是这些默认的模块是不能在Event MPM
模块下工作的,切换后启动时候会报告如下错误:
由于我们使用
Proxy
的方式来调用,因此,我们实际上是不需要Apache
内置PHP
解析模块的,那么我们需要卸载这些模块:
这个版本(
Apache 2.4.18
)已经默认内置Event MPM
了,因此,我们只需要简单的启用这个模块即可:
切换完成后执行
即可查询到当前启用的模型了。
Comments
Post a Comment