Install the LEMP service and phpMyAdmin on Ubuntu 14.10/14.04/13.10

Source: Internet
Author: User

Install the LEMP service and phpMyAdmin on Ubuntu 14.10/14.04/13.10

LEMP is the name of an operating system and several open-source software packages. The abbreviation LEMP is from Linux, Nginx (pronounced engine-x), HTTP server, MySQL database, and the first letter of PHP/Perl/Python.

In this tutorial, let's take a look at how to install Nginx, MySQL, MariaDB, PHP, and phpMyAdmin on Ubuntu 14.10.

LEMP architecture and Application Deployment-Nginx Extension

CentOS 5.6 + Nginx 1.0 + PHP 5.3.6 + MySQL 5.5.11 build the LEMP (X64) Platform

Build a high-performance WEB server LEMP using Nginx in Linux

Example of LAMP architecture collaborative application-phpMyAdmin

PhpMyAdmin and Wordpress for LAMP applications

PhpMyAdmin logon timeout Solution

Install phpMyAdmin and Adminer in Ubuntu

Implement SSL functions based on LAMP and install phpMyAdmin

Configure the LAMP + phpMyAdmin PHP (5.5.9) development environment in Ubuntu 14.04

Install Nginx

Nginx (pronounced engine-x) is a free, open-source, high-performance HTTP server and reverse proxy. It can also be used as an IMAP/POP3 Proxy server developed by Igor Sysoev.

To install Nginx, enter the following command in your terminal:

NOTE: If apache2 has been installed in your system, uninstall it first to avoid conflict. To uninstall apache, run the following command:

  1. Sudo apt-get purge apache2 *
  2. Sudo apt-get autoremove-y

Run the following command to install nginx:

  1. Sudo apt-get install nginx

Run the following command to enable the Nginx service:

  1. Sudo service nginx start
Test nginx

Open your browser to access http: // ip address/or http: // localhost /. You can see something similar to the following.

 

Configure Nginx

Open the file/etc/nginx. conf in any text editor

  1. Sudo nano/etc/nginx. conf

Set worker_processes (for example, the number of CPUs in your system ). To view the number of CPUs, run the "lscpu" command ". Here is "1 ". So I set this value to 1.

  1. Worker_processes 1;

Restart the Nginx service:

  1. Sudo service nginx restart

The default virtual host (Server Module) is defined in the file/etc/nginx/sites-available/default.

Open the/etc/nginx/sites-available/default file in any text editor.

  1. Sudo nano/etc/nginx/sites-available/default

In the Server area, set the Server FQDN or IP address as follows. Make sure that you have added the index. php line.

[...]server {      listen 80 default_server;      listen [::]:80 default_server ipv6only=on;      root /usr/share/nginx/html;      index index.php index.html index.htm;      # Make site accessible from http://localhost/      server_name server.unixmen.local;[...]

Here

  • Listen 80;-> listening for ipv4 ports
  • Listen [:]: 80 default_server listen 6only = on;-> listen to ipv6 wide ports
  • Root/usr/share/nginx/html;-> file root directory
  • Server_name server. unixmen. local;-> server FQDN

Now, scroll down to find the region # location ~ . Php $. Remove the comments and modify them as follows:

 location ~ \.php$ {         try_files $uri =404;   ---------> Add this line         fastcgi_split_path_info ^(.+\.php)(/.+)$;         #       # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini         #         #       # With php5-cgi alone:         #       fastcgi_pass 127.0.0.1:9000;         #       # With php5-fpm:         fastcgi_pass unix:/var/run/php5-fpm.sock;         fastcgi_index index.php;         include fastcgi.conf;    }

Here, I added an additional line 'try _ files $ uri = 404; 'to avoid the 0-day vulnerability.

Save the file and exit.

Test nginx Configuration

Run the following command to test whether the nginx configuration has a syntax error:

  1. Sudo nginx-t

Typical output:

  1. Nginx: the configuration file/etc/nginx. conf syntax is OK
  2. Nginx: configuration file/etc/nginx. conf test is successful

Restart the nginx service.

  1. Sudo service nginx restart

For more details, please continue to read the highlights on the next page:

  • 1
  • 2
  • 3
  • 4
  • Next Page

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.