Ubuntu compiled and installed with LNMP environment

Source: Internet
Author: User
Tags configuration php fpm

Here with nginx1.2.0+mysql5.6.33+php5.6.2 installation environment

---------------------------------------------Nginx BEGIN---------------------------------------------

Use the command to download the Nginx installation package, using the stable version, here to download: <nginx1.6.2>

Download it and unzip it.

Unzip and get a nginx-1.12.0 folder

Go to the folder and run the command:

Enter run script configuration, here to note that there may be missing zlib, SSH and other libraries, this does not matter, find sudo apt-cache search xxx (library) and then sudo apt-get install xxx (corresponding library name) on the line

Here you can refer to: Nginx website installation of the article

Run again after success:

sudo makesudo make install

If you want to join the self-launch, you have to build the Nginx under the/etc/init.d/to fill in

#! /bin/SH# # #BEGIN INIT info# provides:nginx# Required-Start: $all # Required-Stop: $all # Default-start:2 3 4 5# Default-stop:0 1 6# Short-description:starts the Nginx Web server# description:starts nginx using Start-stop-daemon### END INIT INFO PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/Bindaemon=/usr/local/nginx/sbin/Nginxname=Nginxdesc=nginx Test-X $DAEMON | | Exit0# Include Nginx defaultsifavailableif[-f/etc/default/nginx]; Then  . /etc/default/nginx#./usr/local/nginx/conffiSet-E./lib/lsb/init-functions Case " $" inchstart)Echo-N"starting $DESC:"Start-stop-daemon--start--quiet--pidfile/usr/local/nginx/logs/$NAME. PID--exec $DAEMON--$DAEMON _opts | |true  Echo "$NAME.";; stop)Echo-N"stopping $DESC:"Start-stop-daemon--stop--quiet--pidfile/usr/local/nginx/logs/$NAME. PID--exec $DAEMON | |true  Echo "$NAME.";; Restart|force-Reload)Echo-N"restarting $DESC:"Start-stop-daemon--stop--quiet--Pidfile/usr/local/nginx/logs/$NAME. PID--exec $DAEMON | |true  Sleep 1Start-stop-daemon--start--quiet--Pidfile/usr/local/nginx/logs/$NAME. PID--exec $DAEMON--$DAEMON _opts | |true  Echo "$NAME.";; reload)Echo-N"Reloading $DESC configuration:"Start-stop-daemon--stop--signal HUP--quiet--pidfile/usr/local/nginx/logs/$NAME. PID--exec $DAEMON | |true   Echo "$NAME.";; status) Status_of_proc-p/usr/local/nginx/logs/$NAME. PID"$DAEMON"Nginx && exit0|| Exit $?   ;; *) N=/etc/init.d/$NAMEEcho "Usage: $N {start|stop|restart|reload|force-reload|status}">&2Exit1  ;;EsacExit0

Start Nginx and see if the startup process is successful

Browser run localhost see this to indicate that the boot was successful:

---------------------------------------------Nginx END---------------------------------------------

---------------------------------------------MySQL BEGIN---------------------------------------------

1 Download by command: http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.33-linux-glibc2.5-x86_64.tar.gz

2 unzip and copy directly to the software folder, free of installation

// Unzip tar -zxvf mysql-5.6. -LINUX-GLIBC2. 5-x86_64. Tar . GZ // Copy the extracted MySQL directory sudo CP -R mysql-5.6. -LINUX-GLIBC2. 5-x86_64/usr/local/mysql

3 Giving permission

cd/usr/local/mysql// Create a Database Data storage folder sudomkdir ./data/MySQL // new Library set user to MySQL and data file path ./scripts/mysql_install_db--user=mysql--datadir=/usr/local/mysql/data/MySQL  // copy a starter cp support-files/mysql.server/etc/init.d/mysqld//  give permission 755 [rwx-rx-x]sudochmod755 /etc/init.d/mysqld

4 Configuring Init.d/mysqld

sudo /etc/init.d/mysqld

5 Start Test

sudo service mysqld start

Errors that may occur here:

Possible causes

[A]/usr/local/mysql/data/mysql.pid file does not have permission to write

Solve:

sudo chmod 755 /usr/local/mysql/data

[II] There may already be a MySQL process in progress

Solve:

PS grep MySQL sudo kill PID

That's why I'm here, kill the process and reboot.

Go to MySQL to see;;;

It worked.....

---------------------------------------------MySQL END---------------------------------------------

---------------------------------------------PHP BEGIN---------------------------------------------

//Downloadwgethttp//mirrors.sohu.com/php/php-5.6.2.tar.gz//UnzipTar-ZXVF php-5.6.2.Tar. GZ//go to php directoryCD php-5.6.2//Run the scriptsudo./configure--prefix=/usr/local/php--enable-fpm--enable-mbstring--with-mysql=/usr/local/MySQL//Compiling PHPsudo  Makesudo  Make Install
Note:--enable-fpm turn on phpfastcgi function
--with-mysql=/usr/local/mysql enable PHP support MySQL is followed by the installation path of the MySQL database

Execute sudo make

Time is longer .... It's so scary here,.,,.,.,.,., long waiting to see ....

Execute sudo make install

View PHP Version

// Copy the PHP installation files provided by the template as PHP.ini sudo CP php.ini-production/usr/local/lib/php.ini// configuration php-fpmsudoCP /usr/local/php/lletc/php-fpm.conf.default/usr/local/etc/php-fpm.conf//  Let PHP-FPM start sudo cp in the form of a service  ./sapi/fpm/init.d.php-fpm/etc/init.d/php-fpm

Run for a look ...

Ok ....

---------------------------------------------PHP END---------------------------------------------

Reference from:

Http://www.cnblogs.com/bookwed/p/5896619.html

http://ilanni.blog.51cto.com/526870/1569322/

Ubuntu compiled and installed with LNMP environment

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.