ubuntu 12.04 编译安装nginx,php,mysql

 

 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

 

 

posted @ 2013-02-03 17:16  尹少爷  阅读(4487)  评论(0编辑  收藏  举报