"Ubuntu14" Nginx+php5+mysql record

Source: Internet
Author: User
Tags fpm install php intl mcrypt

This time, because of the work, it needs to be developed under Linux. The recommended environment is ubuntu14+nginx+php+mysql. After the environment is set up, install git, install the IDE, feel the MySQL command interface trouble and installed a navicat. The overall use of feeling very sense.

"Virtual machine and image file"

The virtual machine I'm using here is VMWARE11. Other virtual machines are similar.

Ubuntu uses the ubuntu-14.04.3 32-bit. Here to provide one, if it fails, you can leave a message for me to open.

Http://pan.baidu.com/s/1pKhXWIf

"A few suggestions before the operation"

1, if you just play, the memory built 1G is good.

2, if you want to use for development, such as their own computer has 8G, built 4G of memory, 4G can be built 2G memory.

3, in the network, it is recommended to use a bridge network, it is necessary to note that the need for wireless to use the bridge network, so that the native and virtual machines will have two different IPs. Easy to use.

4, the installation process is recommended to use the root user, or use sudo operation.

5, U14 terminal shortcut key: Ctrl+alt+t.

Mirror

It is strongly recommended that you set up a mirror first. Avoid the situation where the face is black and the server is not connected, and the speed is super slow. Or you can fq.

This provides a 163 and Sohu image.

Edit the/etc/apt/sources.list file, (please make a backup before operation) Add the following entry at the front of the file:

NetEase Source:

Deb Http://mirrors.163.com/ubuntu/precise main restricted universe multiverse Deb http://mirrors.163.com/ubuntu/ Precise-security main restricted Universe Multiverse Deb Http://mirrors.163.com/ubuntu/precise-updates main restricted Universe Multiverse Deb http://mirrors.163.com/ubuntu/precise-proposed main restricted Universe Multiverse Deb/HTTP Mirrors.163.com/ubuntu/precise-backports main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ Precise main restricted universe Multiverse deb-src http://mirrors.163.com/ubuntu/precise-security main restricted Universe Multiverse deb-src http://mirrors.163.com/ubuntu/precise-updates main restricted universe multiverse DEB-SRC http://mirrors.163.com/ubuntu/precise-proposed main restricted universe multiverse deb-src http://mirrors.163.com/ Ubuntu/precise-backports Main restricted Universe multiverse

Reference website: http://mirrors.163.com/.help/ubuntu.html

Sohu Source:

Deb Http://mirrors.sohu.com/ubuntu/raring main restricted universe multiverse Deb http://mirrors.sohu.com/ubuntu/ Raring-security main restricted Universe Multiverse Deb Http://mirrors.sohu.com/ubuntu/raring-updates main restricted Universe Multiverse Deb http://mirrors.sohu.com/ubuntu/raring-proposed main restricted Universe Multiverse Deb/HTTP Mirrors.sohu.com/ubuntu/raring-backports main restricted universe multiverse deb-src http://mirrors.sohu.com/ubuntu/ Raring main restricted universe Multiverse deb-src http://mirrors.sohu.com/ubuntu/raring-security main restricted Universe Multiverse deb-src http://mirrors.sohu.com/ubuntu/raring-updates main restricted universe multiverse DEB-SRC http://mirrors.sohu.com/ubuntu/raring-proposed main restricted universe multiverse deb-src http://mirrors.sohu.com/ Ubuntu/raring-backports Main restricted Universe multiverse

Reference website: http://wiki.ubuntu.org.cn/%E6%BA%90%E5%88%97%E8%A1%A8

"Update System"

The main is to update the APT library, and the existing system has installed the software to update.

sudo apt-get updatesudo apt-get upgrade

"Nginx"

sudo apt-get install Nginx

1, nginx configuration virtual Host:

Master configuration file:/etc/nginx/nginx.conf

Additional Configuration files:

/etc/nginx/sites-enabled/*

All the configurations in the Sites-enabled directory are introduced in the Master profile nginx.conf, and only 1 items can be configured directly in nginx.conf, and multiple projects can be configured in sites-enabled in the virtual host.

How to modify the configuration file:

Or

sudo vim/etc/nginx/sites-enabled/llicat

Note that vim also needs to be installed first, or VI.

sudo apt-get install vim

2, the Domain name configuration demo:

To configure a virtual host:

sudo vim/etc/nginx/sites-enabled/llicat

Enter the following:

server {    listen;    # [change] The domain name of the website    server_name www.llicat.com llicat.com;
# Installation path of the program Root/var/www/llicat; # log path access_log/var/log/nginx/llicat.com.access.log; Error_log/var/log/nginx/llicat.com.error.log; Location/{ index index.php; }
}

You need to restart Nginx after modifying the file:

Sudo/etc/init.d/nginx restart

"PHP"

Install PHP

sudo apt-get install php5 php5-cli php5-curl php5-fpm php5-intl php5-mcrypt php5-mysqlnd php5-gd

#php5-cli:php command line Interface, you can type the interface of the executable instruction at the user prompt.
#php5-curl: Data capture tools, similar tools and Httpie.
#php5 the-fpm:php process Manager to start and restart PHP
#php5-intl:intl Extensions
#php5-mcrypt:mcrypt Extensions
#php5-GD:GD Library, working with images

Modify Configuration

Edit Profile: vim/etc/php5/fpm/pool.d/www.conf find: Listen = 127.0.0.1:9000 (by the way, you can use/listen to find characters in a file) replaced by: listen =/var/run/ Php5-fpm.sock

PHP Configuration file directory:

/etc/php5/fpm/php.ini

"MySQL"

1. The installation of MySQL on Ubuntu is similar to that before.

Apt-get Install Mysql-server

During installation, you will be asked to enter your database password and fill it out.

2. Create a database


Privileges: Account password: llicat/123catgrant all privileges on ' test '. * to ' llicat ' @ ' localhost ' identified by ' 123cat '; quit

"Before development"

Once the environment is set up, you can start developing. Prior to development, there are a few basic tools that are essential.

1. Git

2, Navicat

3, a good IDE (Sublime text3/phpstorm)

This is no longer a description of how these 3 things should be installed. Simply mention a few words to note.

1, the use of Git, in the virtual machine can not use SSH to connect, as for the reason. Although your native and virtual machines appear to have two different IPs, the requests received from the GIT server are actually from the same IP.

But this time. Even if you use the RSA file of the host directly. Or you can re-build a secret key file is not OK. If the parents have a solution, you can tell me.

So the GIT usage in the virtual machine is recommended to use the HTTP request directly. Although trouble is a bit of trouble, you need to enter your account password every time. Well, at least it can be solved.

2, the recommended two IDE, Sublime is more lightweight, if you like it more recommend this one. Specific configuration, plug-in processing we can Baidu Baidu. However, compared to individuals, because of the habit of JetBrains do the IDE, so the individual is the use of phpstorm.

"First Project"

Once the environment has been set up, here it begins.

1. Create a Directory

Mkdir/var/wwwcd/var/www

2. Create and develop projects in this directory.

Vim Index.phpphpinfo ();

3, the domain name configuration.

1), first configure the virtual host (see above Nginx configuration).

2), configure the local host file.

sudo vim/etc/hosts add parse record 127.0.0.1 www.llicat.com

4, enter the URL in the browser: If the domain name is not configured, you can access the page directly via IP.

Http://www.llicat.com

Visit the homepage. Get.

Reprint please specify the source:

http://www.cnblogs.com/llicat/

"Ubuntu14" Nginx+php5+mysql record

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.