您的位置:首页 > 运维架构 > Nginx

ubuntu+nginx+php5+mysql安装配置

2011-11-02 10:17 801 查看
1. 安装ubuntu(此处就不做介绍了,按默认流程安装即可)

2. 网卡配置

vim /etc/network/interfaces

可以进行虚拟IP 的设置

eth1 Link encap:Ethernet HWaddr 00:*:19:85:59:12

inet addr:220.196.*.* Bca*t:*.196.*.* Mask:255.255.255.0

inet6 addr: fe80::222:19ff:fe*5:5912/64 Scope:Link

UP BROADCA*T RUNNING MULTICAST MTU:1500 Metric:1

RX packets:27*7964 errors:0 dropped:0 overruns:0 frame:0

TX packets:245*802 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:71035**742 (710.3 MB) TX bytes:13**698783 (1.3 GB)

Interrupt:16 Memory:f4000000-f4012800

eth1:0 Link encap:Ethernet HWaddr 00:22:**:85:59:12

inet addr:220.196.*.* Bcast:220.196.*.255 Mask:255.255.255.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

Interrupt:16 Memory:f40**000-f4012800

以上的意思是eth1 网卡1 eth1:0是网卡1的虚拟IP设置

重启 /etc/init.d/networking restart

3.vim /etc/resolv.conf

search ***.com

nameserver 202.**.2.101

4.更新源

apt-get update

以上命令是 更新:这指令是用来取得记录在 /etc/apt/sources.list 内的远端服务器的套件档案清单

在使用 「apt-get dist-upgrade」指令升级套件前,一定要记得先用这条指令将套件档案清单更新 ;例如:

apt-get upgrade

升级:这里的升级主要是根据已有的软件包更新而言,并不是更新整个系统,也可以使用图形界面的新立得包管理器:)

5.安装软件

apt-get install nginx

apt-get install mysql-server

apt-cache search php

apt-get install php5-cgi

在/etc/apt/sources.list 加入源

deb http://ppa.launchpad.net/brianmercer/php/ubuntu lucid main

deb-src http://ppa.launchpad.net/brianmercer/php/ubuntu lucid main

然后 若需要取得密钥

gpg --keyserver pgpkeys.mit.edu --recv-key A42227CB8D0DC64F

gpg -a --export A42227CB8D0DC64F | sudo apt-key add -

然后再 查找

apt-cache search fpm

安装

apt-get install php5-fpm

apt-get install php-pear

重启

/etc/init.d/php5-fpm restart

查看端口9000

netstat -tan

端口启动:

ufw status

ufw allow 22

ufw allow 80

ps:

rsync -avr john@220.196.*.*:/etc/nginx/* /etc/nginx/

rsync -avr jhon@220.196.*.*:/etc/nginx/* /etc/nginx/

scp jhon@220.196.*.*:/etc/mysql/my.cnf /etc/mysql/my.cnf

拷贝了之前的配置信息

有需要的话找我 我再写一篇配置书
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: