首先切换root用户,终端输入命令:
sudo su
默认root没有密码 直接输入命令就可以切换到root用户。
用这个命令 可以设置root密码:
sudo passwd root
1.安装 mysql
apt-get install mysql-server mysql-client
2.安装 nginx
apt-get install nginx
启动nginx命令:
/etc/init.d/nginx start
浏览器输入127.0.0.1 测试nginx是否正常运行。
在ubuntu11.04中nginx 默认网站目录为
/usr/share/nginx/www
3.安装PHP5
apt-get install php5-fpm
PHP – FPM是一个守护进程(与初始化脚本 / etc/init.d/php5-fpm )运行FastCGI服务器上的端口 9000 。
4.nginx配置
修改虚拟主机配置文件
地址:
/etc/nginx/sites-available/default
下面DEMO为参考:
server {
listen 80; ## listen for ipv4; this line is default and implied
listen [::]:80 default ipv6only=on; ## listen for ipv6
root /usr/share/nginx/www;
index index.php index.html index.htm;
# Make site accessible from http://localhost/
server_name localhost;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to index.html
try_files $uri $uri/ /index.html;
}
location /doc {
root /usr/share;
autoindex on;
allow 127.0.0.1;
deny all;
}
location /images {
root /usr/share;
autoindex off;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/www;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache’s document root
# concurs with nginx’s one
#
location ~ /\.ht {
deny all;
}
}
然后保存文件并重新启动nginx的:
/etc/init.d/nginx restart
试一试php是否正常运行。
测试phpinfo()
剩下安装php扩展软件:
apt-get install php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl
现在重新启动PHP-FPM:
/etc/init.d/php5-fpm restart
分享到:
相关推荐
Ubuntu11.04下Nginx + PHP + Mysql 安装源文件与安装说明 Ubuntu Nginx PHP Mysql 安装
最新的Ubuntu 11.04安装指南(详细图解)
ubuntu11.04的详细安装方法,其中包括自动分区和手动分区的步骤,希望能对广大用户有帮助!
ubuntu11.04安装wine1.3的图文方法。 ubuntu11.04安装wine1.3的图文方法。 ubuntu11.04安装wine1.3的图文方法。 ubuntu11.04安装wine1.3的图文方法。
Ubuntu 11.04 安装后要做的20件事情 Ubuntu 11.04 安装后要做的20件事情 Ubuntu 11.04 安装后要做的20件事情
Ubuntu11.04 下载
Ubuntu 11.04安装Ruby on rails 连接MySQL数据库.pdf
2011 WIN7+Ubuntu 11.04+openSUSE 11.4 三系统硬盘安装
Linux Ubuntu 11.04 安装手册,主要说明分区和驱动
硬盘全新安装ubuntu11.04 硬盘全新安装ubuntu11.04
Ubuntu 11.04 安装后要做的20件事情.txt Ubuntu 安装 软件 配置 系统
windows7+ubuntu11.04 双系统安装.pdf
最快最全的Ubuntu11.04源,速度超快
ubuntu 11.04 3D安装及事项,实现完美的3D效果,及优化开机速度
安装ubuntu11.04的安装,亲测可用,放心下载 Ubuntu(又称乌班图)是一个以桌面应用为主的开源GNU/Linux操作系统,Ubuntu 是基于Debian GNU/Linux,支持x86、amd64(即x64)、ARM和ppc架构,由全球化的专业开发团队...
本人在VMware虚拟机 安装的 Ubuntu 11.04 & Ubuntu server 12.04 上的安装记录 多部电脑/服务器验证通过
CSI Tool 集成安装包(适配Ubuntu 11.04系统,Intel 5300 无线网卡) csitools
Ubuntu11.04下安装ns-allinone-2.34的总结
ubuntu11.04上编译omap3530内核存在问题解决方法.使用的是天漠公司的sbc8100开发板