Upgrade to Ubuntu12.04Server

Source: Internet
Author: User
Tags vps virtualenv
We upgraded Ubuntu11.10 of our VPS to Ubuntu12.04LTS. The result is still quite smooth, but it is still fine-tuned. Note: upgrading to Ubuntu12.04LTSServer from Ubuntu11.10 to Ubuntu12.04 is very simple. Just execute "sudodo-release-upgrade" to confirm, update, download, and install the software package, after upgrading Ubuntu 11.10 of our VPS to Ubuntu 12.04 LTS, the result is still quite smooth, but it is still fine-tuned.

Note:

Upgrade to Ubuntu 12.04 LTS Server

Upgrading from Ubuntu 11.10 to Ubuntu 12.04 is very simple. You only need to run "sudo do-release-upgrade" to confirm, update, download, and install the software package configuration, you can complete the upgrade.

However, the upgrade process is somewhat unexpected:

I used byobu's screen-like tool to connect to the Server for upgrade. when half of the upgrade was completed, the session went out of order (probably caused by service restart). I will log in later, the dpkg process is still running, but byobu is not logged in and cannot continue. You have to delete "/var/lib/dpkg/lock", and then manually execute "sudo dpkg -- configure-a" and "sudo apt-get dist-upgrade 」, everything went smoothly.

Adjustment of some services (nginx and mysql)

The policy for manually upgrading the server is to try to use the new configuration file and then apply the old settings to the new configuration.

For example, after upgrading mysql-server from 5.1 to 5.5, the original utf8 settings may be invalid, so in "/etc/mysql/conf. create a file named "utf8_charset.cnf" under d/"and enter the following content:

[Mysqld]

Max_allowed_packet = 64 M

Collation-server = utf8_unicode_ci

Init-connect = 'set NAMES utf8'

Character-set-server = utf8

Then, when you use "show variables like 'Char % '" to query, you will see that all of them are utf8.

Nginx + uwsgi Problems

The new and old configuration files of nginx are no different. The only difference is that I used the "root" user to run uwsgi with nginx, and now it is changed to "www-data 」, you can change it back.

Now we have a uwsgi tool (or another mode) that is better for running Python apps, and we have time to upgrade it.

Python Virtualenv Problems

With the upgrade of the release version, the Python version is also upgraded, which may lead to a strange problem with the use of Virtualenv WebApp. The best way is to re-establish the virtualenv environment, which is very simple.

For example, the Environment on this site is "imtx. me, you only need "mkvirtualenv imtx", it will automatically re-establish (and overwrite) the original environment, after completion, re-install the software package through pip.

Crontab notifications

Previously, some cron will be run on the VPS, and these cron will be output. Each time you run the command, an email will be sent to the current user. Over time, thousands of emails have been accumulated. These emails usually tell you whether the cron running process and result are smooth. You may want to check them occasionally, but it is not convenient to do so. What should you do?

So I thought of a way, "crontab-e" editing, write a line at the top: MAILTO = "yourmail + cron@gmail.com ", in this way, it will be sent to the specified location of my mailbox, as long as I want to see it, you can view your own private mailbox, instead of logging on to the server to view the mail.

In addition, if you do not need a notification, you can enter ">/dev/null 2> & 1" at the end of the command line in crontab.

Summary

Despite the popularity of various clouds, managing your own VPS is still very valuable. The key is to enjoy the fun and the maximum flexibility and configurability.

In addition, I made a small advertisement. I have used a lot of VPS over the past few years. This year, I started using Linode. Over the past six months, it was really great: stable, fast, and very powerful background and very automated. For example, if I forgot my password yesterday, I reset the root password through the Rescue function.

If you plan to use Linode, you can use my referral code (purchase the Linode product through this link or code): 3a7a044d481045ae2ff2f4469357779e2322f5c6, it's a sponsorship of my blog. Hey

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.