ubuntu 12.04 安装 Nginx+PHP5 (PHP-FPM) +MySQL主机详解_第1页
ubuntu 12.04 安装 Nginx+PHP5 (PHP-FPM) +MySQL主机详解_第2页
ubuntu 12.04 安装 Nginx+PHP5 (PHP-FPM) +MySQL主机详解_第3页
ubuntu 12.04 安装 Nginx+PHP5 (PHP-FPM) +MySQL主机详解_第4页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

ubuntu 12.04 安装 Nginx+PHP5 (PHP-FPM) +MySQL主机详解很长时间没有在Ubuntu安装实际操作安装web服务器了,今天想练练手,在虚拟机上做个试验,我不该保证你也一定会成功,做参考吧!现象我介绍一下基本系统情况: 虚拟机(Oracle VM) 操作系统Ubuntu12.04 server (该系统安装时我只选择了ssh server) 真机与虚拟机使用桥接方式 设置为静态IP:08 适情况个人设置 1.首先为了安装方便,我切换到root账户,输入命令:sudo su2 安装 MySQL 5apt-get install mysql-server mysql-client系统会提示你设置密码,输入两次密码:New password for the MySQL “root” user: (输入密码)Repeat password for the MySQL “root” user: (再输入一次)3 安装 Nginxapt-get install nginx启动Nginx服务:/etc/init.d/nginx start浏览器输入网址看看是否正常:08(修改成你设置的静态IP)网页显示”Welcome to nginx!”说明已经安装成功并运行。4 安装 PHP5 apt-get install php5-fpm5 设置 nginx ,修改文件:vi /etc/nginx/nginx.conf修改下面两行代码:worker_processes 4;keepalive_timeout 2;虚拟主机配置文件修改:vi /etc/nginx/sites-available/default 修改代码如下面的显示: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 _; 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 ; deny all; #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 :80 # #location .php$ # proxy_pass ; # # pass the PHP scripts to FastCGI server listening on :9000 # location .php$ try_files $uri =404; fastcgi_pass :9000; fastcgi_index index.php; include fastcgi_params; # deny access to .htaccess files, if Apaches document root # concurs with nginxs one # location /.ht deny all; 重新加载nginx:/etc/init.d/nginx reload创建一个探针文件,测试:vi /usr/share/nginx/www/info.php写入内容然后再打开浏览器输入:08/info.php会显示一下支持的模块,增加模块支持,输入下面的命令查询PHP模块:apt-cache search php5会显示模块和模块功能解释(英文的,需要一定英文能力,谷歌或百度翻译一下,了解)例如输入下面安装你要的模块:apt-get install php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recod

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论