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:
- Sudo apt-get purge apache2 *
- Sudo apt-get autoremove-y
Run the following command to install nginx:
- Sudo apt-get install nginx
Run the following command to enable the Nginx service:
- 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
- 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.
- Worker_processes 1;
Restart the Nginx service:
- 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.
- 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:
- Sudo nginx-t
Typical output:
- Nginx: the configuration file/etc/nginx. conf syntax is OK
- Nginx: configuration file/etc/nginx. conf test is successful
Restart the nginx service.
- Sudo service nginx restart
For more details, please continue to read the highlights on the next page: