13

How do I prepare my site for Ubuntu Bionic? – DreamHost Knowledge Base

 3 years ago
source link: https://help.dreamhost.com/hc/en-us/articles/360022178852-How-do-I-prepare-my-site-for-Ubuntu-Bionic-
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

The following provides information to help you prepare your site for the Ubuntu upgrade from Trusty Tahr to version 18.04.1 LTS (aka Bionic).

What to expect

DreamHost will contact you via email in advance of the upgrade.

The time frame of an upgrade can vary from server to server, however the timing ensures that there are several highly trained engineers on hand should any major issues arise. The upgrade itself should take no longer than an hour to complete.

Any services that rely on the availability of your MySQL server (WordPress or any other database-driven websites, applications, and so on) will not be reachable until the upgrade is complete. This will NOT affect cloud or email services.

Checking the version of Ubuntu

As mentioned above, you will receive an email notifying you of your server's upgrade. However, you can manually check via SSH.

The following command confirms the server is still running Ubuntu 14.

[server]$ cat /etc/issue
Ubuntu 14.04.5 LTS \n \l

And this shows a server running Ubuntu 18.

[server]$ cat /etc/issue
Ubuntu 18.04.1 LTS \n \l

MySQL

Server changes

DreamHost MySQL servers will be upgraded to MySQL version 5.7 as part of the Ubuntu upgrade.

Reserved words

MySQL 5.7 includes a list of "reserved words" (such as 'SELECT', 'DELETE', 'BIGINT', and 'VIRTUAL') that cannot be used as a database name. These words can be used as a database table name, but must be escaped in database queries. Reserved words in MySQL 5.7 require special treatment for use as identifiers, such as table and column names.

See the following article for more information on how to use reserved words in MySQL 5.7:

Web server changes

Apache version change (from 2.2 to 2.4)

Apache is upgrading to version 2.4 (from 2.2). Although this should not cause any major issues to your hosting environment, you can view a list of changes in the following article:

require valid-user

If you're using an .htaccess file to password protect your site, make sure you add this line to your .htaccess file:

require valid-user

If you do not add this, your site will throw a 500 error and the following line will display in your site's error.log:

AH01627: AuthType configured with no corresponding authorization directives

'Coming soon' page displays even though it doesn't exist

You may see your site displaying a 'Coming Soon' page that does not exist on your web server. Add the following line to your site's .htaccess file to resolve this.

DirectoryIndex disabled

WebDAV file listing hidden if index is present

On Apache 2.4, you must add the following text to the .htaccess file in order to access the directory of an index file using WebDAV (not a browser), since it won't show the file list in Windows Explorer:

DirectoryIndex disabled

Boto-rsync

Because boto-rsync is outdated software and is no longer maintained, it is also removed from the latest version of Ubuntu Bionic. DreamHost recommends using S3cmd instead. You can find out more about how to use S3cmd (or AWS CLI) at DreamHost in the following articles:

curl version changed to 7.58.0

The version of curl changed from 7.35.0 to 7.58.0.

FFmpeg and Libav

Both of these libraries are changing in the Bionic upgrade of Ubuntu.

In Ubuntu Trusty, Libav replaced FFmpeg, and FFmpeg was removed from Trusty entirely. With the Bionic upgrade, this is being reversed: FFmpeg is back, and Libav has been removed. Please make sure you update your file settings accordingly.

FilterProvider syntax change

In Apache 2.4, the syntax for FilterProvider has changed.

Sample old version:

FilterProvider COMPRESS DEFLATE resp=Content-Type $text/html

Sample new version:

FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'text/html'"

You can read more about this in the Apache 2.4 mod_filter documentation:

GCC version change to 7

Bionic includes gcc-7, which means versions of Ruby earlier than 2.4 are no longer supported as they require gcc-6.

Sites relying on versions of Ruby earlier than Ruby 2.4 must be migrated to a newer version.

Java version change (from 7u151 to 8u171)

Ubuntu Bionic includes a new version of Java version 8, 8u171.

This is the first major upgrade in quite some time, so it's definitely a good idea to make sure any Java dependencies you may have are compatible with version 8.

For more information on the latest versions of Java, visit the following link:

Node / NVM

When installing a custom version of Node.js/NVM, the installation will get caught by grsec. You must run a command to change the pax flags so grsec ignores the files. View the following article for full instructions:

OpenSSL version change (1.0.1f to 1.1.0g)

Bionic includes version 1.1.0g of OpenSSL.

Passenger

To enable Passenger error-friendly pages (which helps troubleshoot upgrade issues), add the following to an .htaccess file within the application:

PassengerFriendlyErrorPages on

Perl version change (from 5.18.4 to 5.26)

Ubuntu Bionic includes a new version of Perl, 5.26. Among the many changes, this update removes the current directory (".") from @INC for security reasons. You can read about this in more detail here.

For more information on updating your version of Perl, visit the following article:

PHP error logging

PHP errors are logged in your sites error.log file by default. You change which errors are reported and the location of where they are reported by updating your site's phprc file. View the following article for further details:

Python version changes

The following Python versions are changing:

  • Python 2 (from 2.7.5 to 2.7.15)
  • Python 3 (from 3.4.3 to 3.6.5)

Since Bionic includes a new kernel and operating system, it no longer supports custom compiled versions of Python older than 2.7.15. If you are running an application that uses a version of Python that is older than 2.7.15, you must upgrade your code so it is compatible with at least 2.7.15 when applicable.

If you need to use an older-than-2.7.15 version of Python, you can consider using DreamCompute to set up a customized environment that allows sudo access. For more information on DreamCompute, please see the following article:

Ubuntu Bionic includes a new version of Python 2 (2.7.15) and Python 3 (3.6.5). If you used a version older than 2.7.15 when creating your virtualenv, you may need to reinstall your virtualenv and all modules with a newer version:

For more information on the latest versions of Python, visit the following links:

Python Django errors

After the upgrade, you may see errors in your Django application. For example.

django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: libmysqlclient.so.18: cannot open shared object file: No such file or directory.
Did you install mysqlclient or MySQL-python?

Solution

Delete your pip .cache directory.

Python virtual environment

If your website is using a Python virtual environment and you notice any errors after the upgrade, reinstall your virtual environment and all modules. This helps to ensure everything is compatible with the new libraries on the server.

Examples of errors you may see are Django, Passenger, or Python errors/warnings.

Ruby version change (from 1.9.3.4 to 2.5.1)

The Ruby version on the server is changing to 2.5.1. If you would like more control over this, DreamHost strongly recommends using RVM.

If you are using Bundler, you only need to run:

[server]$ bundle exec gem pristine

Then, reload Passenger so that the changes take effect by running touch on a restart.txt file from your apps tmp directory:

[server]$ touch tmp/restart.txt

SSH version change to 7.6p1

The version of SSH on Bionic servers is 7.6p1. Please note that DSA keys are not available on this version.

Telnet

Because Telnet is a deprecated protocol, it is removed from the latest version of Ubuntu Bionic in order to help keep your server secure. If you require Telnet, DreamHost recommends running it on your local computer instead.

How can I find support?

If you have any questions or concerns, please feel free to contact support.


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK