ubuntu 12.04 安装 Nginx+PHP5 (PHP-FPM) +MySQL主机详解

更新时间:2023-06-08 19:52:02 阅读: 评论:0

ubuntu 12.04 安装 Nginx+PHP5 (PHP-FPM) +MySQL主机详解
很长时间没有在 Ubuntu 安装实际操作安装web服务器了,今天想练练手,在虚拟机上做个试验,我不该保证你也一定会成功,做参考吧!
现象我介绍一下基本系统情况:
虚拟机(Oracle VM
太平洋英语操作系统梯子英语 Ubuntu 12.04 rver (该系统安装时我只选择了ssh rverbra是啥意思呀
真机与虚拟机使用桥接方式
设置为静态IP:192.168.1.208 适情况个人设置
1.首先为了安装方便,我切换到root账户,输入命令:
sudo su
2 安装 MySQL 5
apt-get install mysql-rver mysql-client
系统会提示你设置密码,输入两次密码:
New password for the MySQL “root” ur: (输入密码)
Repeat password for the MySQL “root” ur: (再输入一次)
3 安装 Nginx
thickness
apt-get install nginx
启动Nginx服务:
/etc/init.d/nginx start
浏览器输入网址看看是否正常:192.168.1.208(修改成你设置的静态IP
网页显示”Welcome to nginx!”说明已经安装成功并运行。
4 安装 PHP5
apt-get install php5-fpm
5 设置 nginx ,修改文件:
vi /etc/f
修改下面两行代码:
worker_process  4;
keepalive_timeout  2;
qq英文情侣名
虚拟主机配置文件修改:
tile
vi /etc/nginx/sites-available/default
修改代码如下面的显示:
rver {
        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 localhost/
        rver_name _;
nameless        location / {
                # First attempt to rve 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;
        }
        #error_page 404 /404.html;
        # redirect rver 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 127.0.0.1;
        #}
        # pass the PHP scripts to FastCGI rver listening on 127.0.0.1:9000
        #
        location ~ \.php$ {
                try_files $uri =404;
                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 reload
beancurd
创建一个探针文件,测试:
vi /usr/share/nginx/www/info.php
迪士尼少儿英语教材写入内容
<?php
phpinfo();
?>
然后再打开浏览器输入:192.168.1.208/info.php
会显示一下支持的模块,增加模块支持,输入下面的命令查询PHP模块:
apt-cache arch 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-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl
安装完毕之后重启php5-fpm
/
etc/init.d/php5-fpm restart
新闻网:www.cssq

本文发布于:2023-06-08 19:52:02,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/78/905116.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:安装   输入   模块   设置   修改   百度   系统
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图