mysql:
sudo apt-get install mysql-server mysql-client
安装过程中会二次提示输入密码,这个是设置mysql中root的密码。
nginx:
1) sudo apt-get install nginx
这样装上的版本是14.01库中版本比较老。
2)sudo add-apt-repository ppa:nginx/stable
sudo apt-get updatesudo
sudo apt-get install nginx
这样目前装上的是1.6版nginx
php:
sudo apt-get install php5-fpm
守护进程的方式安装PHP5
phpmyadmin:
sudo apt-get install phpmyadmin
安装过程中会提示输入mysql的密码。
mark:
1) nginx 1.6的默认web主目录在/var/www目录,通过修改nginx的配置文件可以更改默认目录。/etc/nginx/sites-available/default文件
修改 root /var/www 这行为自己使用的www目录
修改主机名:server_name localhost;
修改重定向到index.php文件 :
location / {
}
把这行的注释去掉,使用FPM守护进程运行PHP
fastcgi_pass unix:/var/run/php5-fpm.sock;
我的default
##
# You should look at the following URL's in order to grasp a solidunderstanding
# of Nginx configuration files in order to fully unleash the powerof Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and startwith a clean
# file but keep this around for reference. Or just disable insites-enabled.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailedexamples.
##
# Default server configuration
#
server {
listen 80default_server;
listen[::]:80 default_server;
# SSLconfiguration
#
# listen 443ssl default_server;
# listen[::]:443 ssl default_server;
#
# Selfsigned certs generated by the ssl-cert package
# Don't usethem in a production server!
#
# includesnippets/snakeoil.conf;
root/home/maxim/www/0550cn/public;
# Addindex.php to the list if you are using PHP
indexindex.php index.html index.htm index.nginx-debian.html;
server_namelocalhost;
location /{
# Firstattempt to serve request as file, then
# asdirectory, then fall back to displaying a 404.
try_files$uri $uri/ =404;
if (!-e$request_filename){
rewrite^(.*)$ /index.php?$1 last;
}
}
# pass thePHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~\.php$ {
# includesnippets/fastcgi-php.conf;
#
# # Withphp5-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # Withphp5-fpm:
# fastcgi_pass unix:/var/run/php5-fpm.sock;
#}
location ~\.php$ {
include snippets/fastcgi-php.conf;
# With php5-cgi alone:
#fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
# denyaccess to .htaccess files, if Apache's document root
# concurswith nginx's one
#
#location ~/\.ht {
# denyall;
#}
}
# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ andsymlink that
# to sites-enabled/ to enable it.
#
#server {
# listen80;
# listen[::]:80;
#
# server_nameexample.com;
#
# root/var/www/example.com;
# indexindex.html;
#
# location /{
# try_files$uri $uri/ =404;
# }
#}
2)php.ini位置在:/etc/php5/fpm/php.ini
3) phpmyadmin默认安装在 /usr/share/phpmyadmin
可以建个符号连接到web目录