python html5 bootstrap 视频教程

德云社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 6053|回复: 2

在 Ubuntu Server 14.04 下安装 LNMP 服务

[复制链接]

172

主题

258

帖子

1114

积分

版主

Rank: 7Rank: 7Rank: 7

金钱
663
金币
7
威望
0
贡献
0
发表于 2014-12-25 22:45:45 | 显示全部楼层 |阅读模式
AI人工智能 语音助理 人工翻译 教程

       LNMP 的通用含义是:Linux 系统下 Nginx + MySQL + PHP 这种网站服务器架构。

       LNMP 另方面是基于 CentOS/Debian 编写的 NginxMySQLPHPphpMyAdmineAccelerator 一键安装包。可以在 VPS、独立主机上轻松的安装 LNMP 生产环境。

LNMP 中的 4 个软件均为免费开源软件。组合在一起,形成了一个免费、高效、扩展性强的网站服务系统

       1、Linux 是类 Unix 计算机操作系统的统称,是目前最流行的免费操作系统。代表版本有:debiancentosubuntufedoragentoo 等。

       2、Nginx 是一个高性能的 HTTP 和反向代理服务器,也是一个 IMAP/POP3/SMTP 代理服务器。

       3、Mysql 是一个小型关系型数据库管理系统。

       4、PHP 是一种在服务器端执行的嵌入 HTML 文档的脚本语言。

安装 Ubuntu Server 14.04
      这里不再多说,请关注 “德云社区” 相关主题

安装 Nginx 1.4.6
       1、apt-get 命令直接安装 Nginx
  1. apt-get install nginx
复制代码
      2、在 FireFox 或 IE 浏览器中键入 http://localhost/http://127.0.0.1/ (或服务器 IP 地址);若出现 “Welcome to nginx!” 信息,说明安装成功:
Welcome to nginx!

If you see this page, the nginx web server is successfully installed andworking. Further configuration is required.

For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.

Thank you for using nginx.
       3、配置 Nginx
  1. vi /etc/nginx/sites-available/default
复制代码
             修改前的配置文件内容:
  1. # You may add here your
  2. # server {
  3. #    ...
  4. # }
  5. # statements for each of your virtual hosts to this file

  6. ##
  7. # You should look at the following URL's in order to grasp a solid understanding
  8. # of Nginx configuration files in order to fully unleash the power of Nginx.
  9. # http://wiki.nginx.org/Pitfalls
  10. # http://wiki.nginx.org/QuickStart
  11. # http://wiki.nginx.org/Configuration
  12. #
  13. # Generally, you will want to move this file somewhere, and start with a clean
  14. # file but keep this around for reference. Or just disable in sites-enabled.
  15. #
  16. # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
  17. ##

  18. server {    #设定虚拟主机,默认为监听 80 端口,改成其他端口会出现问题
  19.     listen 80 default_server;
  20.     listen [::]:80 default_server ipv6only=on;

  21.     root /usr/share/nginx/html;    #定义服务器默认网站根目录位置
  22.     index index.html index.htm;   #定义首页索引文件名称

  23.     # Make site accessible from http://localhost/
  24.     server_name localhost;    #域名可以有多个,使用空格分隔

  25.     access_log /var/log/nginx/forum.access.log;
  26.     error_log /var/log/nginx/forum.error.log;

  27.     location / {    #默认请求
  28.         # First attempt to serve request as file, then
  29.         # as directory, then fall back to displaying a 404.
  30.         try_files $uri $uri/ =404;
  31.         # Uncomment to enable naxsi on this location
  32.         # include /etc/nginx/naxsi.rules
  33.     }

  34.     # Only for nginx-naxsi used with nginx-naxsi-ui : process denied requests
  35.     #location /RequestDenied {
  36.     #    proxy_pass http://127.0.0.1:8080;
  37.     #}

  38.     #error_page 404 /404.html;

  39.     # redirect server error pages to the static page /50x.html
  40.     #
  41.     #error_page 500 502 503 504 /50x.html;
  42.     #location = /50x.html {    #定义错误提示页面
  43.     #    root /usr/share/nginx/html;
  44.     #}

  45.     # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  46.     #
  47.     #location ~ \.php$ {    #PHP 脚本请求全部转发到 FastCGI 处理. 使用 FastCGI 默认配置
  48.     #    fastcgi_split_path_info ^(.+\.php)(/.+)$;
  49.     #    # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
  50.     #
  51.     #    # With php5-cgi alone:
  52.     #    fastcgi_pass 127.0.0.1:9000;
  53.     #    # With php5-fpm:
  54.     #    fastcgi_pass unix:/var/run/php5-fpm.sock;
  55.     #    fastcgi_index index.php;
  56.     #    include fastcgi_params;
  57.     #}

  58.     # deny access to .htaccess files, if Apache's document root
  59.     # concurs with nginx's one
  60.     #
  61.     #location ~ /\.ht {    #禁止访问 .htaccess 文件
  62.     #    deny all;
  63.     #}
  64. }


  65. # another virtual host using mix of IP-, name-, and port-based configuration
  66. #
  67. #server {
  68. #    listen 8000;
  69. #    listen somename:8080;
  70. #    server_name somename alias another.alias;
  71. #    root html;
  72. #    index index.html index.htm;
  73. #
  74. #    location / {
  75. #        try_files $uri $uri/ =404;
  76. #    }
  77. #}


  78. # HTTPS server
  79. #
  80. #server {
  81. #    listen 443;
  82. #    server_name localhost;
  83. #
  84. #    root html;
  85. #    index index.html index.htm;
  86. #
  87. #    ssl on;
  88. #    ssl_certificate cert.pem;
  89. #    ssl_certificate_key cert.key;
  90. #
  91. #    ssl_session_timeout 5m;
  92. #
  93. #    ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
  94. #    ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
  95. #    ssl_prefer_server_ciphers on;
  96. #
  97. #    location / {
  98. #        try_files $uri $uri/ =404;
  99. #    }
  100. #}
复制代码
             修改后的配置文件内容:
  1. # You may add here your
  2. # server {
  3. #    ...
  4. # }
  5. # statements for each of your virtual hosts to this file

  6. ##
  7. # You should look at the following URL's in order to grasp a solid understanding
  8. # of Nginx configuration files in order to fully unleash the power of Nginx.
  9. # http://wiki.nginx.org/Pitfalls
  10. # http://wiki.nginx.org/QuickStart
  11. # http://wiki.nginx.org/Configuration
  12. #
  13. # Generally, you will want to move this file somewhere, and start with a clean
  14. # file but keep this around for reference. Or just disable in sites-enabled.
  15. #
  16. # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
  17. ##

  18. server {    #设定虚拟主机,默认为监听 80 端口,改成其他端口会出现问题
  19.     listen 80 default_server;
  20.     listen [::]:80 default_server ipv6only=on;

  21.     root /usr/share/nginx/html;    #定义服务器默认网站根目录位置
  22.     index index.php index.html index.htm;    #定义首页索引文件名称

  23.     # Make site accessible from http://localhost/
  24.     server_name www.digitser.cn;   #域名可以有多个,使用空格分隔

  25.     location / {    #默认请求
  26.         # First attempt to serve request as file, then
  27.         # as directory, then fall back to displaying a 404.
  28.         try_files $uri $uri/ =404;
  29.         # Uncomment to enable naxsi on this location
  30.         # include /etc/nginx/naxsi.rules
  31.     }

  32.     # Only for nginx-naxsi used with nginx-naxsi-ui : process denied requests
  33.     #location /RequestDenied {
  34.     #    proxy_pass http://127.0.0.1:8080;
  35.     #}

  36.     #error_page 404 /404.html;

  37.     # redirect server error pages to the static page /50x.html
  38.     #
  39.     #error_page 500 502 503 504 /50x.html;
  40.     location = /50x.html {    #定义错误提示页面
  41.         root /usr/share/nginx/html;
  42.     }

  43.     # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  44.     #
  45.     location ~ \.php$ {        #PHP 脚本请求全部转发到 FastCGI 处理. 使用 FastCGI 默认配置
  46.         try_files $uri =404;    #增加这行,用于避免 0day 漏洞
  47.         fastcgi_split_path_info ^(.+\.php)(/.+)$;
  48.     #    # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
  49.     #
  50.     #    # With php5-cgi alone:
  51.     #    fastcgi_pass 127.0.0.1:9000;
  52.     #    # With php5-fpm:
  53.         fastcgi_pass unix:/var/run/php5-fpm.sock;
  54.         fastcgi_index index.php;
  55.         include fastcgi_params;
  56.     }

  57.     # deny access to .htaccess files, if Apache's document root
  58.     # concurs with nginx's one
  59.     #
  60.     #location ~ /\.ht {    #禁止访问 .htaccess 文件
  61.     #    deny all;
  62.     #}
  63. }


  64. # another virtual host using mix of IP-, name-, and port-based configuration
  65. #
  66. #server {
  67. #    listen 8000;
  68. #    listen somename:8080;
  69. #    server_name somename alias another.alias;
  70. #    root html;
  71. #    index index.html index.htm;
  72. #
  73. #    location / {
  74. #        try_files $uri $uri/ =404;
  75. #    }
  76. #}


  77. # HTTPS server
  78. #
  79. #server {
  80. #    listen 443;
  81. #    server_name localhost;
  82. #
  83. #    root html;
  84. #    index index.html index.htm;
  85. #
  86. #    ssl on;
  87. #    ssl_certificate cert.pem;
  88. #    ssl_certificate_key cert.key;
  89. #
  90. #    ssl_session_timeout 5m;
  91. #
  92. #    ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
  93. #    ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
  94. #    ssl_prefer_server_ciphers on;
  95. #
  96. #    location / {
  97. #        try_files $uri $uri/ =404;
  98. #    }
  99. #}
复制代码
       4、重载、测试 Nginx 配置文件
  1. root:# /usr/sbin/nginx -s reload (或 service nginx reload)
  2. root:# /usr/sbin/nginx -t
  3. nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
  4. nginx: configuration file /etc/nginx/nginx.conf test is successful
  5. root:#
复制代码
       5、重启 Nginx
  1. root:# /etc/init.d/nginx restart (或 service nginx restart)
  2. * Restarting nginx nginx                                                                                                [ OK ]
  3. root:#
复制代码
安装 MySQL Server 5.5.40
       1、apt-get 命令直接安装 MySQL
  1. root:# apt-get install mysql-server
  2. 正在读取软件包列表... 完成
  3. 正在分析软件包的依赖关系树      
  4. 正在读取状态信息... 完成      
  5. 下列软件包是自动安装的并且现在不需要了:
  6.   linux-headers-3.13.0-37 linux-headers-3.13.0-37-generic
  7.   linux-headers-3.13.0-39 linux-headers-3.13.0-39-generic
  8.   linux-image-3.13.0-37-generic linux-image-3.13.0-39-generic
  9.   linux-image-extra-3.13.0-37-generic linux-image-extra-3.13.0-39-generic
  10. Use 'apt-get autoremove' to remove them.
  11. 将会安装下列额外的软件包:
  12.   libaio1 libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysqlclient18
  13.   libterm-readkey-perl mysql-client-5.5 mysql-client-core-5.5 mysql-common
  14.   mysql-server-5.5 mysql-server-core-5.5
  15. 建议安装的软件包:
  16.   libmldbm-perl libnet-daemon-perl libplrpc-perl libsql-statement-perl
  17.   libipc-sharedcache-perl tinyca mailx
  18. 下列【新】软件包将被安装:
  19.   libaio1 libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysqlclient18
  20.   libterm-readkey-perl mysql-client-5.5 mysql-client-core-5.5 mysql-common
  21.   mysql-server mysql-server-5.5 mysql-server-core-5.5
  22. 升级了 0 个软件包,新安装了 12 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。
  23. 需要下载 9,064 kB 的软件包。
  24. 解压缩后会消耗掉 96.6 MB 的额外空间。
  25. 您希望继续执行吗? [Y/n] Y
  26. 获取:1 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libaio1 amd64 0.3.109-4 [6,364 B]
  27. 获取:2 http://cn.archive.ubuntu.com/ubuntu/ trusty-updates/main mysql-common all 5.5.40-0ubuntu0.14.04.1 [14.1 kB]
  28. 获取:3 http://cn.archive.ubuntu.com/ubuntu/ trusty-updates/main libmysqlclient18 amd64 5.5.40-0ubuntu0.14.04.1 [598 kB]
  29. 获取:4 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libdbi-perl amd64 1.630-1 [879 kB]
  30. 获取:5 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libdbd-mysql-perl amd64 4.025-1 [99.3 kB]
  31. 获取:6 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libterm-readkey-perl amd64 2.31-1 [27.4 kB]
  32. 获取:7 http://cn.archive.ubuntu.com/ubuntu/ trusty-updates/main mysql-client-core-5.5 amd64 5.5.40-0ubuntu0.14.04.1 [703 kB]
  33. 获取:8 http://cn.archive.ubuntu.com/ubuntu/ trusty-updates/main mysql-client-5.5 amd64 5.5.40-0ubuntu0.14.04.1 [1,466 kB]
  34. 获取:9 http://cn.archive.ubuntu.com/ubuntu/ trusty-updates/main mysql-server-core-5.5 amd64 5.5.40-0ubuntu0.14.04.1 [3,215 kB]
  35. 获取:10 http://cn.archive.ubuntu.com/ubuntu/ trusty-updates/main mysql-server-5.5 amd64 5.5.40-0ubuntu0.14.04.1 [1,978 kB]
  36. 获取:11 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libhtml-template-perl all 2.95-1 [65.5 kB]
  37. 获取:12 http://cn.archive.ubuntu.com/ubuntu/ trusty-updates/main mysql-server all 5.5.40-0ubuntu0.14.04.1 [12.4 kB]
  38. 下载 9,064 kB,耗时 32秒 (279 kB/s)                                            
  39. 正在预设定软件包 ...
  40. Selecting previously unselected package libaio1:amd64.
  41. (正在读取数据库 ... 系统当前共安装有 310580 个文件和目录。)
  42. Preparing to unpack .../libaio1_0.3.109-4_amd64.deb ...
  43. Unpacking libaio1:amd64 (0.3.109-4) ...
  44. Selecting previously unselected package mysql-common.
  45. Preparing to unpack .../mysql-common_5.5.40-0ubuntu0.14.04.1_all.deb ...
  46. Unpacking mysql-common (5.5.40-0ubuntu0.14.04.1) ...
  47. Selecting previously unselected package libmysqlclient18:amd64.
  48. Preparing to unpack .../libmysqlclient18_5.5.40-0ubuntu0.14.04.1_amd64.deb ...
  49. Unpacking libmysqlclient18:amd64 (5.5.40-0ubuntu0.14.04.1) ...
  50. Selecting previously unselected package libdbi-perl.
  51. Preparing to unpack .../libdbi-perl_1.630-1_amd64.deb ...
  52. Unpacking libdbi-perl (1.630-1) ...
  53. Selecting previously unselected package libdbd-mysql-perl.
  54. Preparing to unpack .../libdbd-mysql-perl_4.025-1_amd64.deb ...
  55. Unpacking libdbd-mysql-perl (4.025-1) ...
  56. Selecting previously unselected package libterm-readkey-perl.
  57. Preparing to unpack .../libterm-readkey-perl_2.31-1_amd64.deb ...
  58. Unpacking libterm-readkey-perl (2.31-1) ...
  59. Selecting previously unselected package mysql-client-core-5.5.
  60. Preparing to unpack .../mysql-client-core-5.5_5.5.40-0ubuntu0.14.04.1_amd64.deb ...
  61. Unpacking mysql-client-core-5.5 (5.5.40-0ubuntu0.14.04.1) ...
  62. Selecting previously unselected package mysql-client-5.5.
  63. Preparing to unpack .../mysql-client-5.5_5.5.40-0ubuntu0.14.04.1_amd64.deb ...
  64. Unpacking mysql-client-5.5 (5.5.40-0ubuntu0.14.04.1) ...
  65. Selecting previously unselected package mysql-server-core-5.5.
  66. Preparing to unpack .../mysql-server-core-5.5_5.5.40-0ubuntu0.14.04.1_amd64.deb ...
  67. Unpacking mysql-server-core-5.5 (5.5.40-0ubuntu0.14.04.1) ...
  68. Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
  69. 正在设置 mysql-common (5.5.40-0ubuntu0.14.04.1) ...
  70. Selecting previously unselected package mysql-server-5.5.
  71. (正在读取数据库 ... 系统当前共安装有 310943 个文件和目录。)
  72. Preparing to unpack .../mysql-server-5.5_5.5.40-0ubuntu0.14.04.1_amd64.deb ...
  73. Unpacking mysql-server-5.5 (5.5.40-0ubuntu0.14.04.1) ...
  74. Selecting previously unselected package libhtml-template-perl.
  75. Preparing to unpack .../libhtml-template-perl_2.95-1_all.deb ...
  76. Unpacking libhtml-template-perl (2.95-1) ...
  77. Selecting previously unselected package mysql-server.
  78. Preparing to unpack .../mysql-server_5.5.40-0ubuntu0.14.04.1_all.deb ...
  79. Unpacking mysql-server (5.5.40-0ubuntu0.14.04.1) ...
  80. Processing triggers for ureadahead (0.100.0-16) ...
  81. ureadahead will be reprofiled on next reboot
  82. Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
  83. 正在设置 libaio1:amd64 (0.3.109-4) ...
  84. 正在设置 libmysqlclient18:amd64 (5.5.40-0ubuntu0.14.04.1) ...
  85. 正在设置 libdbi-perl (1.630-1) ...
  86. 正在设置 libdbd-mysql-perl (4.025-1) ...
  87. 正在设置 libterm-readkey-perl (2.31-1) ...
  88. 正在设置 mysql-client-core-5.5 (5.5.40-0ubuntu0.14.04.1) ...
  89. 正在设置 mysql-client-5.5 (5.5.40-0ubuntu0.14.04.1) ...
  90. 正在设置 mysql-server-core-5.5 (5.5.40-0ubuntu0.14.04.1) ...
  91. 正在设置 mysql-server-5.5 (5.5.40-0ubuntu0.14.04.1) ...
  92. 141229 11:38:52 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
  93. mysql start/running, process 8086
  94. 正在设置 libhtml-template-perl (2.95-1) ...
  95. Processing triggers for ureadahead (0.100.0-16) ...
  96. 正在设置 mysql-server (5.5.40-0ubuntu0.14.04.1) ...
  97. Processing triggers for libc-bin (2.19-0ubuntu6.4) ...
  98. root:#
复制代码
      2、设置 MySQL 管理员 root 用户密码
      
     安装过程中,会自动展示上述进程及出现以下窗口:
            设置 MySQL 管理员 root 用户密码,并确认一次;该密码以后很多时候还要使用,不要忘啦。
       3、检查 MySQL 服务器状态
  1. root:# service mysql status
  2. mysql start/running, process 8086
  3. root:#
复制代码
       4、安装 MySQL Client 5.5.40
  1. root:# apt-get install mysql-client    (请选择性安装)
  2. 正在读取软件包列表... 完成
  3. 正在分析软件包的依赖关系树      
  4. 正在读取状态信息... 完成      
  5. 下列软件包是自动安装的并且现在不需要了:
  6.   linux-headers-3.13.0-37 linux-headers-3.13.0-37-generic
  7.   linux-headers-3.13.0-39 linux-headers-3.13.0-39-generic
  8.   linux-image-3.13.0-37-generic linux-image-3.13.0-39-generic
  9.   linux-image-extra-3.13.0-37-generic linux-image-extra-3.13.0-39-generic
  10. Use 'apt-get autoremove' to remove them.
  11. 下列【新】软件包将被安装:
  12.   mysql-client
  13. 升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。
  14. 需要下载 12.3 kB 的软件包。
  15. 解压缩后会消耗掉 126 kB 的额外空间。
  16. 获取:1 [url]http://cn.archive.ubuntu.com/ubuntu/[/url] trusty-updates/main mysql-client all 5.5.40-0ubuntu0.14.04.1 [12.3 kB]
  17. 下载 12.3 kB,耗时 0秒 (27.9 kB/s)   
  18. Selecting previously unselected package mysql-client.
  19. (正在读取数据库 ... 系统当前共安装有 311042 个文件和目录。)
  20. Preparing to unpack .../mysql-client_5.5.40-0ubuntu0.14.04.1_all.deb ...
  21. Unpacking mysql-client (5.5.40-0ubuntu0.14.04.1) ...
  22. 正在设置 mysql-client (5.5.40-0ubuntu0.14.04.1) ...
  23. root:#
复制代码
安装 PHP 5.5.9
       1、apt-get 命令直接安装 php5-fpm 5.5.9
  1. root:# apt-get install php5-fpm
  2. 正在读取软件包列表... 完成
  3. 正在分析软件包的依赖关系树      
  4. 正在读取状态信息... 完成      
  5. 下列软件包是自动安装的并且现在不需要了:
  6.   linux-headers-3.13.0-37 linux-headers-3.13.0-37-generic
  7.   linux-headers-3.13.0-39 linux-headers-3.13.0-39-generic
  8.   linux-image-3.13.0-37-generic linux-image-3.13.0-39-generic
  9.   linux-image-extra-3.13.0-37-generic linux-image-extra-3.13.0-39-generic
  10. Use 'apt-get autoremove' to remove them.
  11. 将会安装下列额外的软件包:
  12.   php5-common php5-json
  13. 建议安装的软件包:
  14.   php5-user-cache php-pear
  15. 下列【新】软件包将被安装:
  16.   php5-common php5-fpm php5-json
  17. 升级了 0 个软件包,新安装了 3 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。
  18. 需要下载 2,667 kB 的软件包。
  19. 解压缩后会消耗掉 10.6 MB 的额外空间。
  20. 您希望继续执行吗? [Y/n] y
  21. 获取:1 [url]http://cn.archive.ubuntu.com/ubuntu/[/url] trusty/main php5-json amd64 1.3.2-2build1 [34.4 kB]
  22. 获取:2 [url]http://cn.archive.ubuntu.com/ubuntu/[/url] trusty-updates/main php5-common amd64 5.5.9+dfsg-1ubuntu4.5 [442 kB]
  23. 获取:3 [url]http://cn.archive.ubuntu.com/ubuntu/[/url] trusty-updates/universe php5-fpm amd64 5.5.9+dfsg-1ubuntu4.5 [2,191 kB]
  24. 下载 2,667 kB,耗时 3秒 (713 kB/s)   
  25. Selecting previously unselected package php5-json.
  26. (正在读取数据库 ... 系统当前共安装有 311042 个文件和目录。)
  27. Preparing to unpack .../php5-json_1.3.2-2build1_amd64.deb ...
  28. Unpacking php5-json (1.3.2-2build1) ...
  29. Selecting previously unselected package php5-common.
  30. Preparing to unpack .../php5-common_5.5.9+dfsg-1ubuntu4.5_amd64.deb ...
  31. Unpacking php5-common (5.5.9+dfsg-1ubuntu4.5) ...
  32. Selecting previously unselected package php5-fpm.
  33. Preparing to unpack .../php5-fpm_5.5.9+dfsg-1ubuntu4.5_amd64.deb ...
  34. Unpacking php5-fpm (5.5.9+dfsg-1ubuntu4.5) ...
  35. Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
  36. Processing triggers for ureadahead (0.100.0-16) ...
  37. 正在设置 php5-common (5.5.9+dfsg-1ubuntu4.5) ...

  38. Creating config file /etc/php5/mods-available/pdo.ini with new version
  39. php5_invoke: Enable module pdo for fpm SAPI

  40. Creating config file /etc/php5/mods-available/opcache.ini with new version
  41. php5_invoke: Enable module opcache for fpm SAPI
  42. 正在设置 php5-fpm (5.5.9+dfsg-1ubuntu4.5) ...

  43. Creating config file /etc/php5/fpm/php.ini with new version
  44. php5_invoke opcache: already enabled for fpm SAPI
  45. php5_invoke pdo: already enabled for fpm SAPI
  46. php5-fpm start/running, process 10370
  47. 正在设置 php5-json (1.3.2-2build1) ...
  48. php5_invoke: Enable module json for fpm SAPI
  49. Processing triggers for ureadahead (0.100.0-16) ...
  50. root:#
复制代码
     2、查看要安装哪些 php5 相关软件包,并安装
  1. root:# apt-cache search php5
  2. libapache2-mod-php5 - server-side, HTML-embedded scripting language (Apache 2 module)
  3. php5 - server-side, HTML-embedded scripting language (metapackage)
  4. php5-cgi - server-side, HTML-embedded scripting language (CGI binary)
  5. php5-cli - command-line interpreter for the php5 scripting language
  6. php5-common - Common files for packages built from the php5 source
  7. php5-curl - CURL module for php5
  8. php5-dbg - Debug symbols for PHP5
  9. php5-dev - Files for PHP5 module development
  10. php5-gd - GD module for php5
  11. php5-gmp - GMP module for php5
  12. php5-json - JSON module for php5
  13. php5-ldap - LDAP module for php5
  14. php5-mysql - MySQL module for php5
  15. php5-odbc - ODBC module for php5
  16. php5-pgsql - PostgreSQL module for php5
  17. php5-pspell - pspell module for php5
  18. php5-readline - Readline module for php5
  19. php5-recode - recode module for php5
  20. php5-snmp - SNMP module for php5
  21. php5-sqlite - SQLite module for php5
  22. php5-tidy - tidy module for php5
  23. php5-xmlrpc - XML-RPC module for php5
  24. php5-xsl - XSL module for php5
  25. cakephp - MVC rapid application development framework for PHP
  26. libapache2-mod-php5filter - server-side, HTML-embedded scripting language (apache 2 filter module)
  27. libexpect-php5 - expect module for PHP 5
  28. libgv-php5 - PHP5 bindings for graphviz
  29. libkohana2-modules-php - lightweight PHP5 MVC framework (extension modules)
  30. libkohana2-php - lightweight PHP5 MVC framework
  31. libkohana3.1-core-php - PHP5 framework core classes
  32. libkohana3.1-php - PHP5 framework metapackage
  33. libkohana3.2-core-php - PHP5 framework core classes
  34. libkohana3.2-php - PHP5 framework metapackage
  35. libow-php5 - Dallas 1-wire support: PHP5 bindings
  36. libphp-jpgraph - Object oriented graph library for php5
  37. libphp-jpgraph-examples - Object oriented graph library for php5 (examples)
  38. libphp5-embed - HTML-embedded scripting language (Embedded SAPI library)
  39. php-auth - Creating an authentication system
  40. php-codesniffer - PHP, CSS and JavaScript coding standard analyzer and checker
  41. php-doc - Documentation for PHP5
  42. php-http-request2 - Provides an easy way to perform HTTP requests
  43. php-imlib - PHP Imlib2 Extension
  44. php-letodms-lucene - Document management system - Fulltext search
  45. php5-adodb - Extension optimising the ADOdb database abstraction library
  46. php5-apcu - APC User Cache for PHP 5
  47. php5-enchant - Enchant module for php5
  48. php5-exactimage - fast image manipulation library (PHP bindings)
  49. php5-fpm - server-side, HTML-embedded scripting language (FPM-CGI binary)
  50. php5-gdcm - Grassroots DICOM PHP5 bindings
  51. php5-gearman - PHP wrapper to libgearman
  52. php5-geoip - GeoIP module for php5
  53. php5-gnupg - wrapper around the gpgme library
  54. php5-imagick - ImageMagick module for php5
  55. php5-imap - IMAP module for php5
  56. php5-interbase - interbase/firebird module for php5
  57. php5-intl - internationalisation module for php5
  58. php5-lasso - Library for Liberty Alliance and SAML protocols - PHP 5 bindings
  59. php5-librdf - PHP5 language bindings for the Redland RDF library
  60. php5-mapscript - php5-cgi module for MapServer
  61. php5-mcrypt - MCrypt module for php5
  62. php5-memcache - memcache extension module for PHP5
  63. php5-memcached - memcached extension module for PHP5, uses libmemcached
  64. php5-midgard2 - Midgard2 Content Repository - PHP5 language bindings and module
  65. php5-ming - Ming module for php5
  66. php5-mongo - MongoDB database driver
  67. php5-msgpack - PHP extension for interfacing with MessagePack
  68. php5-mysqlnd - MySQL module for php5 (Native Driver)
  69. php5-mysqlnd-ms - MySQL replication and load balancing module for PHP
  70. php5-oauth - OAuth 1.0 consumer and provider extension
  71. php5-pinba - Pinba module for PHP 5
  72. php5-ps - ps module for PHP 5
  73. php5-radius - PECL radius module for PHP 5
  74. php5-redis - PHP extension for interfacing with Redis
  75. php5-remctl - PECL module for Kerberos-authenticated command execution
  76. php5-rrd - PHP bindings to rrd tool system
  77. php5-sasl - Cyrus SASL Extension
  78. php5-stomp - Streaming Text Oriented Messaging Protocol (STOMP) client module for PHP 5
  79. php5-svn - PHP Bindings for the Subversion Revision control system
  80. php5-sybase - Sybase / MS SQL Server module for php5
  81. php5-tokyo-tyrant - PHP interface to Tokyo Cabinet's network interface, Tokyo Tyrant
  82. php5-vtkgdcm - Grassroots DICOM VTK PHP bindings
  83. php5-xcache - Fast, stable PHP opcode cacher
  84. php5-xdebug - Xdebug Module for PHP 5
  85. php5-xhprof - Hierarchical Profiler for PHP5
  86. phpunit - Unit testing suite for PHP5
  87. root:#
复制代码
      其中 其中 php5-cgi (CGI 通用网关接口)、php5-curl (客户端 URL)、php5-dev (开发支持)、php5-gd  (GD 图像处理)、php5-mysql (MySQL 支持)、php5-pspell (拼写检查支持)、php5-recode (编码字符集支持)、php5-snmp (SNMP 简单网络管理协议支持)、php5-sqlite (SQLite 数据库支持)、php5-tidy (Tidy HTML 支持)、php5-xmlrpc (XML-RPC 支持)、php5-xsl (XLS 支持)、php5-imagick (ImageMagick 图像处理)、php5-imap (IMAP 邮件客户端支持)、php5-intl (国际化支持)、php5-mcrypt (Mcrypt 加密)、php5-memcache (memcache 客户端)、php5-memcached (memcache 服务器端)、php5-ming (swf 扩展支持)、php5-ps (PostScript 文档支持),这些都需要安装:
  1. root:#apt-get install php5 php5-cgi php5-curl php5-dev php5-gd php5-mysql php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-imagick php5-imap php5-intl php5-mcrypt php5-memcache php5-memcached php5-ming php5-ps php-pear php-apc
复制代码
      3、配置 php.ini
  1. vi /etc/php5/fpm/php.ini
复制代码
            将 ;cgi.fix_pathinfo=1 去掉注释并改为 cgi.fix_pathinfo=0

       4、重载、重启 php5-fpm 5.5.9nginx 1.4.6
  1. root:# service php5-fpm reload
  2. root:# service php5-fpm restart
  3. stop: Unknown instance:
  4. php5-fpm start/running, process 3811
  5. root:# service nginx reload
  6. * Reloading nginx configuration nginx                                                                             [ OK ]
  7. root:# service nginx restart
  8. * Restarting nginx
复制代码
      5、创建名为 “info.php” 的 PHP 探针文件并测试
  1. vi /usr/share/nginx/html/info.php  (或把 info.php 放到支持 php 的网站根目录下)
复制代码
            文件内容:
  1. <?php
  2. phpinfo();
  3. ?>
复制代码
            在 FireFoxIE 浏览器中键入 http://localhost/info.phphttp://127.0.0.1/info.php (或 http://服务器 IP 地址/info.php);若出现以下图片内容,说明 LNMP 安装成功

版权声明:

本文为独家原创稿件,版权归 德云社区,未经许可不得转载;否则,将追究其法律责任。

AI人工智能 语音助理 人工翻译 教程
回复

使用道具 举报

172

主题

258

帖子

1114

积分

版主

Rank: 7Rank: 7Rank: 7

金钱
663
金币
7
威望
0
贡献
0
 楼主| 发表于 2014-12-25 22:45:59 | 显示全部楼层
在线订购 便捷实惠 品质保证 终生保修
回复 支持 反对

使用道具 举报

172

主题

258

帖子

1114

积分

版主

Rank: 7Rank: 7Rank: 7

金钱
663
金币
7
威望
0
贡献
0
 楼主| 发表于 2014-12-25 22:46:49 | 显示全部楼层
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|Sitemap|小黑屋|德云社区 |网站地图  

GMT+8, 2024-11-23 07:19 , Processed in 0.034048 second(s), 30 queries .

工业和信息化部: 粤ICP备14079481号-2

技术支持 乐数软件     版权所有 © 2014-2021 德云社区    

快速回复 返回顶部 返回列表