Simple installation of Ubuntu under Nginx, PHP, MySQL and Golang

Source: Internet
Author: User
Tags php and mysql
This is a creation in Article, where the information may have evolved or changed.

Http://fuxiaohei.me/article/15/ubuntu-lnmp-golang-installation.html


I'm a php-born, naturally installed Lnmp is a regular skill. The former means is LNMP installation package, such as military brother's lnmp1.0. With the update of PHP and MySQL, most of the one-click installations are beginning to release aging and update difficult issues. So, to re-examine the installation of Ubuntu under the LNMP, found now a lot simpler, record a bit.

Also recently in learning Golang,ubuntu under the installation of nature is also a necessary process. But Golang's installation also has some secrets. Of course, not the source of the installation.

Nginx stable/development

The package Manager under Ubuntu is apt-get or says dpkg . General installation Commands apt-get install (note permissions sudo apt-get install ). Nginx is the most friendly of these software, directly can add stable source:

ppa:nginx/stable

or development Source:

ppa:nginx/development

If you do not have the install command add-apt-repository , install:

apt-get

After the normal operation:

updateapt-get install nginxservice nginx start

PHP 5.4+

php PPA source There's a man who specializes in doing, Ondrej Sury. There are php5.4,php5.5 and php5.6 source, the specific can see the official page. Why not 5.3? You're behind the--! 5.4+ performance improved a lot, 5.5 also have built-in zendopcache . Install php5.5:

updateapt-get install php5 php5-fpmservice php5-fpm start

There are some necessary packages to install, remember to restart PHP5-FPM:

apt-get install php5-gd php5-curl php5-sqlite php5-mysqlnd php5-mcryptservice php5-fpm restart

As for Nginx How to configure PHP-FPM, a search a lot, not much to say.

MySQL 5.5+ & MariaDB

Or this man, mysql5.5, mysql5.6 and MariaDB5.5. So, it's easy, like installing mariadb (not like MySQL, destroyed by Oracle):

add-apt-repository ppa:ondrej/mariadb-5.5apt-get update  apt- Get  Install Mariadb-server-5.5  service MySQL start    

Note here that the installation will prompt InnoDB Plugin Disabled . It doesn't matter, Mariadb put InnoDB built in, actually is already started. Specifically, you can:

SHOW ENGINE INNODB STATUS;

Golang

The plays are Golang. I searched for a half-day PPA source, only to find a can install golang1.1.1 source, very uncomfortable. In fact, you can golang the official download has been compiled linux.tar.gz. But you need to manually set up GOROOT , a bit of trouble ah.

Finally found a good tool godeb. This is actually a Deb package builder. Download the officially compiled tar.gz, package it as Deb and install it.

Take a 64-bit installation as an example:

wgethttps://godeb.s3.amazonaws.com/godeb-amd64.tar.gztar -zxvf godeb-amd64.tar.gz./godeb install

Start installing the latest version. You can also view supported versions and install specific versions:

./godebList1.21.2Rc51.2Rc41.2Rc31.2Rc21.2Rc11.1. 21.1. 11.1(...). /godeb Install1.1

After installation, you can use go env the view, whether the installation is complete.

The rest of the setup GOPATH , GOBIN will not repeat. I was modified in /etc/profile the inside.

Written in the last

Ubuntu under a lot of things are active, easy to install, but also good ah.


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.