1 1. 手動編譯安裝 Nginx 1.2.0 2 3 Nginx下載頁面:http://nginx.org/en/download.html 4 5 sudo apt-get install -y libpcre3 libpcre3-dev zlib1g-dev 6 7 wget http://nginx.org/download/nginx-1.2.0.tar.gz//如果你沒有指定目錄,則代表文件下載到自己目前的文件夾 8 9 tar -zxvf nginx-1.2.0.tar.gz 10 11 cd nginx-1.2.0 12 13 ./configure --prefix=/usr/local/nginx 14 15 make 16 17 sudo make install 18 19 sudo ln -s /usr/local/nginx/sbin/nginx /etc/init.d/{開機自動啟動} 20 21 sudo /etc/init.d/nginx
1 #! /bin/sh 2 3 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin 4 5 DESC="nginx daemon" 6 NAME=nginx 『nginx 的安裝目錄,下面的/etc/nginx都為nginx的安裝目錄』 7 DAEMON=/etc/nginx/sbin/$NAME 8 CONFIGFILE=/etc/nginx/conf/$NAME.conf 9 PIDFILE=/etc/nginx/logs/$NAME.pid 10 SCRIPTNAME=/etc/init.d/$NAME 11 12 set -e 13 [ -x "$DAEMON" ] || exit 0 14 15 do_start() { 16 $DAEMON -c $CONFIGFILE || echo -n "nginx already running" 17 } 18 19 do_stop() { 20 kill -INT `cat $PIDFILE` || echo -n "nginx not running" 21 } 22 23 do_reload() { 24 kill -HUP `cat $PIDFILE` || echo -n "nginx can't reload" 25 } 26 27 case "$1" in 28 start) 29 echo -n "Starting $DESC: $NAME" 30 do_start 31 echo "." 32 ;; 33 stop) 34 echo -n "Stopping $DESC: $NAME" 35 do_stop 36 echo "." 37 ;; 38 reload|graceful) 39 echo -n "Reloading $DESC configuration..." 40 do_reload 41 echo "." 42 ;; 43 restart) 44 echo -n "Restarting $DESC: $NAME" 45 do_stop 46 do_start 47 echo "." 48 ;; 49 *) 50 echo "Usage: $SCRIPTNAME {start|stop|reload|restart}" >&2 51 exit 3 52 ;; 53 esac 54 55 exit 0
chmod -R 777 nginx
sudo update-rc.d -f nginx defaults 22 23 訪問本機首頁 http://localhost/,如果正常,則說明nginx已啟動
編譯安裝php5.4
1 cd php5.4 2 ./configure 3 make (我寫的是 make -f Makefile) 4 make install
遇到的問題解決如下
****make :no targets No targets specified and no makefile found stop 解決辦法 2 3 wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.6.tar.gz 4 5 tar zxvf ncurses-5.6.tar.gz 6 7 ./configure -prefix=/usr/local -with-shared -without-debug 8 9 make 10 11 make install
****The page you are looking for is temporarily unavailable.Please try again later.
nginx 運行php頁面的時候出錯
1,修改/etc/nginx/conf/scgi_params/ scgi_param SCGI 5;
php結合fastcgi訪問php頁面出錯:2012/12/24 14:41:23 [error] 3725#0: *2 open() "/opt/nginx/html/favicon.ico" failed (2: No such file or directory), client: 10.15.62.138, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "10.15.62.120"故障分析:fastcgi的wrapper不能解析php頁面
解決辦法:::打開nginx配置文件目錄conf下的fastcgi_params文件,
修改fastcgi_param SERVER_SOFTWARE nginx;
nginx 運行php出現,file not found
1,修改/etc/nginx/conf/fastcgi_params
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
2,/etc/nginx/conf/nginx.conf
修改server里面的代碼
root //路徑
autoindex on;
可以參考http://www.nginx.cn/562.html,我感覺這里面的不錯
1 安裝mysql 5.6
1 apt-get install cmake 2 3 apt-get install bison 4 5 apt-get install libncurses5-dev 6 7 cd /etc/mysql5.6 8 9 cmake . -DCMAKE_INSTALL_PREFIX=/etc/mysql5.6/ 10 11 make 12 13 make install