ubuntu 安装 lnmp
1. 安装nginx 最新版 sudo vim /etc/apt/sources.list
??? 添加 nginx 官方源
?
deb http://ppa.launchpad.net/nginx/development/ubuntu maverick maindeb-src http://ppa.launchpad.net/nginx/development/ubuntu maverick main
???? 增加key,并更新源。
?
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C300EE8C
sudo apt-get update
sudo apt-get install nginx
配置文件
??? vi /etc/nginx/nginx.conf
?
2. mysql5.5
??? 如果安装过mysq5.1 了 先卸载,并手动删除 配置文件
??? 到这里下载内核对应的版本
?????????? http://download.softagency.net/mysql/Downloads/MySQL-5.5/
?
??? sudo apt-get intall libaio1
??? mv mysql-5.5.25a-linux2.6-i686 /opt/mysql
??? cd /opt/mysql
??? chown -R mysql . //将当前目录的拥有者权限更改为mysql
??? chgrp -R mysql . //将当前的目录的组权限更改为mysql组
??? scripts/mysql_install_db --user=mysql --basedir=/opt/mysql
?
?
cp support-files/my-medium.cnf /etc/mysql/my.cnf
sudo vi /etc/mysql/my.cnf
在【mysqld】
中加入
basedir =/opt/mysql
datadir =/opt/mysql/data
character-set-server = utf8
max_connections = 1024
在【mysql】
加入
default-characters-set=utf8
保存退出!
?
启动
bin/mysqld_safe --user=mysql &
bin/mysqladmin -u root -h localhost password “1234567”
ln -s /opt/mysql/bin/mysql /usr/bin/mysql
?
停止
/opt/mysql/support-files/mysql.server stop
?
3. php5.3
aptitude install python-software-properties
?
add-apt-repository ppa:brianmercer/php
?
aptitude -y update
aptitude -y install php5-cli php5-common php5-mysql php5-suhosin php5-gd php5-fpm php5-cgi php-pear php5-memcache php-apc
启动php5-fpm服务:
?
service php5-fpm start
查看9000端口:
?
netstat -plan | grep :9000
?