Build a LNMP environment under Ubuntu. Compile and install mysql,nginx,php. Finally, install the composer under the Lnmp premise and install the Laravel frame. First, the second step begins to compile the installation Nginx1.8.0
1. Enter the "/usr/local/src" folder First, then type
"sudo wget http://nginx.org/download/nginx-1.8.0.tar.gz" Enter and wait for the download to complete. After downloading, execute "sudo tar zxvf nginx-1.8.0.tar.gz" to unzip the file.
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/77/AA/wKiom1Zq1zCikUTXAACruQku-QA740.png "style=" float: none; "title=" 1.png "alt=" Wkiom1zq1zcikutxaacruqku-qa740.png "/>
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/77/AA/wKiom1Zq1zDBJD5uAAAzd0RXKSg477.png "style=" float: none; "title=" 2.png "alt=" Wkiom1zq1zdbjd5uaaazd0rxksg477.png "/>
2. Then enter the nginx source directory, configure the installation operation. Execute"CD nginx-1.8.0" and then "sudo./configure--prefix=/usr/local/server/nginx--with-http_stub_status_ Module".
If the following error 1 appears :
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/77/AA/wKiom1Zq1zHS_r6jAACeyoX2WnA010.png "style=" float: none; "title=" 3.png "alt=" Wkiom1zq1zhs_r6jaaceyox2wna010.png "/>
is the lack of Pcre Library . Workaround:
sudo wgetftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.gz
sudo tar-xzvf pcre-8.38.tar.gz
cd/usr/local/src/pcre-8.38
sudo./configure
sudo make
sudo make install
After installing pcrelibrary , error 2 appears :
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/77/AA/wKiom1Zq1zLx3532AABry_CHcUY124.png "style=" float: none; "title=" 4.png "alt=" Wkiom1zq1zlx3532aabry_chcuy124.png "/>
Workaround: The zlib library is missing. Execute command: sudo apt-getinstall zlib1g-dev
After installing Zliblibrary, error 3 appears:
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/77/A9/wKioL1Zq1zSj1tZjAABjBBHBLV4077.png "style=" float: none; "title=" 5.png "alt=" Wkiol1zq1zsj1tzjaabjbbhblv4077.png "/>
Workaround: The OpenSSL library is missing.
Execute command sudo apt-get install OpenSSL libssl-dev Libperl-dev
Next; Run command: sudo./configure--prefix=/usr/local/server/nginx--with-http_stub_status_module--with-http_gzip_static_ Module--with-http_ssl_module--with-pcre=. /pcre-8.38/
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/77/A9/wKioL1Zq1zXjtKb9AABCl4A7jiA724.png "style=" float: none; "title=" 6.png "alt=" Wkiol1zq1zxjtkb9aabcl4a7jia724.png "/>
The configuration succeeds if the following conditions occur.
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/77/AA/wKiom1Zq1zWxZevFAADryNN-jlk080.png "style=" float: none; "title=" 7.png "alt=" Wkiom1zq1zwxzevfaadrynn-jlk080.png "/>
3. Run the command sudo make&& make install
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/77/A9/wKioL1Zq1zngUTUaAABsGYgERQo539.png "style=" float: none; "title=" 8.png "alt=" Wkiol1zq1zngutuaaabsgygerqo539.png "/>
4. Copy the following code content to /etc/init.d/nginx, execute "sudo vim/etc/init.d/nginx", and then "sudo chmod +x/etc/ Init.d/nginx".
Code:
#!/bin/bash
#
#chkconfig:-85 15
#description: Nginx is a world Wide Web server.
#processname: Nginx
Nginx=/usr/local/server/nginx/sbin/nginx
Conf=/usr/local/server/nginx/conf/nginx.conf
Case $1in
Echo-n "Starting Nginx"
$nginx-c$conf
echo "Done"
;;
Echo-n "Stopping Nginx"
Killall-9 Nginx
echo "Done"
;;
$nginx-t-c $conf
;;
Echo-n "Reloading Nginx"
PS auxww| grep Nginx | grep Master | awk ' {print $} ' | Xargs Kill-hup
echo "Done"
;;
$ stop
$ start
;;
Ps-aux|grep Nginx
;;
*)
Echo-n "Usage: $ {start|restart|reload|stop|test|show}"
;;
Esac
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/77/AA/wKiom1Zq1zfDOuAiAAAjkOYqNL0115.png "style=" float: none; "title=" 9.png "alt=" Wkiom1zq1zfdouaiaaajkoyqnl0115.png "/>
5. Start nginx, execute "sudo/etc/init.d/nginx start" to start Nginx
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/77/A9/wKioL1Zq1zmA4TVxAAAshrMlZuc016.png "style=" float: none; "title=" 10.png "alt=" Wkiol1zq1zma4tvxaaashrmlzuc016.png "/>
6. The browser enters "http://localhost" and displays the following page, indicating that the server started successfully.
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/77/AA/wKiom1Zq1znDWMcVAAB-yL5V8ZI662.png "style=" float: none; "title=" 11.png "alt=" Wkiom1zq1zndwmcvaab-yl5v8zi662.png "/>
6. Close nginxand perform "Sudo/etc/init.d/nginx stop" to close nginx.
from this,nginx The compilation installation is complete.
。
This article from the "Good Learning Day Up" blog, please be sure to keep this source http://sunrising.blog.51cto.com/10729461/1722194
Second, Ubuntu under the compiler installation Nginx1.8.0