天天看点

DebianLNMP安装错误问题汇总及解决方法

DebianLNMP一键安装包遇到的常见问题

简述:本文记录debian6 / 7 系统安nginx php mysql时常遇见的问题。对使用安装DebianLNMP各版本遇到的问题进行解答,并详细给出解决方法。

Debian错误问题一:

默认安装的Debian,选择的apt-get源,默认的security.debian.org在国内会出现无法使用。

类似地址如下:

这个时候,请检查 vim /etc/apt/sources.list 源地址

解决方法:

国内的服务器换一个 apt-get地址

国内快速的apt-get地址列表:

# vim /etc/apt/sources.list 

#deb cdrom:[Debian GNU/Linux 6.0.5 _Squeeze_ - Official i386 NETINST Binary-1 20120512-20:43]/ squeeze main 

deb http://cdn.debian.net/debian/ squeeze main 

deb-src http://cdn.debian.net/debian/ squeeze main 

# squeeze-updates, previously known as 'volatile' 

deb http://cdn.debian.net/debian/ squeeze-updates main 

deb-src http://cdn.debian.net/debian/ squeeze-updates main

很快提示

Reading package lists... Done

结束

错误提示:

perl: warning: Setting locale failed.

perl: warning: Please check that your locale settings:

LANGUAGE = "zh_CN:zh",

LC_ALL = (unset),

LANG = "zh_CN.UTF-8"

are supported and installed on your system.

perl: warning: Falling back to the standard locale ("C").

locale: Cannot set LC_CTYPE to default locale: No such file or directory

locale: Cannot set LC_MESSAGES to default locale: No such file or directory

locale: Cannot set LC_ALL to default locale: No such file or directory

Debian错误问题二:安装DebianLNMP提示覆盖配置文件

如图:

直接选择"Y"

Debian错误问题三:

由于官方网络源不问题导致dotdeb.gpg 源apt-key add dotdeb.gpg无法下载,获取不了apt-key。

会无法成功安装DebianLNMP。

wget: 无法解析主机地址 “www.dotdeb.org”

gpg: 无法打开‘dotdeb.gpg’: 没有那个文件或目录

手工下载

apt-key add dotdeb.gpg

然后多运行几次,直到成功,提示"OK".

Debian错误问题四:

为什么重启机器后 php5-fpm 总是启动不了?

Debian7.3系统i386版本,安装的DebianLNMP加强版后。启动提示php5-fpm faild错误信息。

<a href="http://s3.51cto.com/wyfs02/M01/12/C1/wKioL1MNpfujrtK-AAC6x-hqBCc073.jpg" target="_blank"></a>

<a href="http://s3.51cto.com/wyfs02/M00/12/C1/wKiom1MNpiHD6jRQAAB-nYuP3PA275.jpg" target="_blank"></a>

解决方法:创建/var/run/php5/目录,命令“mkdir /var/run/php5/”

<a href="http://s3.51cto.com/wyfs02/M02/12/C1/wKioL1MNpfuDiBO8AAAfL2ZqQ2I737.jpg" target="_blank"></a>

如图后,可正常启动php-fpm。

Debian安装后常见错误及解决方法

   从Debian7版本开始它的源命名为“wheezy”;而Debian6版本的源名称是“squeeze”。我们可从他们的版本命名规则中估计推理其他更多源列表、源地址。

值得注意的是,不同的Debian版本设置sources.list的源列表至关重要,稍有设置不当是无法安装源里面的软件,无法正确获取到源的信息、内容。并且还要版本能匹配得对,即是说明Deb源要设置正确。

在最小化安装Debian系统的时候,初始安装的系统没有安装SSH服务,Debian默认没有安装SSH软件包。

Debian7.1 安装 ssh服务

1

2

3

4

<code>#使用apt-get命令快速安装ssh服务</code>

<code># apt-get install openssh-server</code>

<code>#启动ssh进程</code>

<code>#/etc/init.d/ssh restart</code>

Debian7.1系统安装软件常遇见类似错误提示:

root@debian7:~# apt-get install -y php5-suhosin

正在读取软件包列表... 完成

正在分析软件包的依赖关系树

正在读取状态信息... 完成

现在没有可用的软件包 php5-suhosin,但是它被其它的软件包引用了。

这可能意味着这个缺失的软件包可能已被废弃,

或者只能在其他发布源中找到

E: 软件包 php5-suhosin 没有可供安装的候选者

错误解决方法:检查sources.list配置文件,采用apt-get安装软件时,由于配置文件不正确,导致安装失败。

Debian7.1系统默认apt-get配置

#vi /etc/apt/sources.list

安装好Debian7.1.0系统后,默认的apt-get源,它的默认配置文件为下文:

5

6

7

8

9

<code># deb cdrom:[Debian GNU/Linux 7.1.0 _Wheezy_ - Official amd64 NETINST Binary-1 20130615-23:04]/ wheezy main</code>

<code>#deb cdrom:[Debian GNU/Linux 7.1.0 _Wheezy_ - Official amd64 NETINST Binary-1 20130615-23:04]/ wheezy main</code>

<code>deb http://mirrors.163.com/debian/ wheezy main</code>

<code>deb-src http://mirrors.163.com/debian/ wheezy main</code>

<code>deb http://security.debian.org/ wheezy/updates main</code>

<code>deb-src http://security.debian.org/ wheezy/updates main</code>

<code># wheezy-updates, previously known as 'volatile'</code>

<code>deb http://mirrors.163.com/debian/ wheezy-updates main</code>

<code>deb-src http://mirrors.163.com/debian/ wheezy-updates main</code>

Debian7.1系统安装MySQL服务器端正确示例:

10

11

12

13

14

15

16

17

18

19

20

<code>Mysql</code>

<code>[ ok ] Stopping MySQL database server: mysqld.</code>

<code>130622 15:34:38 [Note] Plugin </code><code>'FEDERATED'</code><code>is disabled.</code>

<code>130622 15:34:38 InnoDB: The InnoDB memory heap is disabled</code>

<code>130622 15:34:38 InnoDB: Mutexes and rw_locks useGCC atomic builtins</code>

<code>130622 15:34:38 InnoDB: Compressed tables usezlib 1.2.7</code>

<code>130622 15:34:38 InnoDB: Using Linux native AIO</code>

<code>130622 15:34:38 InnoDB: Initializing buffer pool, size = 128.0M</code>

<code>130622 15:34:38 InnoDB: Completed initialization of buffer pool</code>

<code>130622 15:34:38 InnoDB: highest supported file formatis Barracuda.</code>

<code>130622 15:34:38  InnoDB: Waiting forthe background threads to start</code>

<code>130622 15:34:39 InnoDB: 5.5.31 started; logsequence number 1595675</code>

<code>130622 15:34:39  InnoDB: Starting </code><code>shutdown</code><code>...</code>

<code>130622 15:34:40  InnoDB: Shutdown completed; logsequence number 1595675</code>

<code>[ ok ] Starting MySQL database server: mysqld ..</code>

<code>[info] Checking fortables which need an upgrade, are corrupt or were</code>

<code>not closed cleanly..</code>

<code>正在设置 libhtml-template-perl (2.91-1) ...</code>

<code>正在设置 mysql-client (5.5.31+dfsg-0+wheezy1) ...</code>

<code>正在设置 mysql-server (5.5.31+dfsg-0+wheezy1) ...</code>

Debian7.1系统中默认安装的MySQL、PHP版本信息

MySQL 客户端版本: 5.5.31 服务器版本: 5.5.31-0+wheezy1

PHP版本(php_version): 5.4.16-1~dotdeb.1 

Debian7.1系统中默认安装的 nginx版本信息,以及默认已编译模块

<code>root</code><code>@debian7</code><code>.1.0:~</code><code># nginx -V</code>

<code>nginx version: nginx/1.4.1</code>

<code>TLS SNI support enabled</code>

<code>configure arguments: --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --error-</code><code>log</code><code>-path=/var/</code><code>log</code><code>/nginx/error.</code><code>log</code><code>--http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-</code><code>log</code><code>-path=/var/</code><code>log</code><code>/nginx/access.</code><code>log</code><code>--http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --</code><code>lock</code><code>-path=/var/</code><code>lock</code><code>/nginx.</code><code>lock</code><code>--pid-path=/var/run/nginx.pid --</code><code>with</code><code>-pcre-jit --</code><code>with</code><code>-debug --</code><code>with</code><code>-file-aio --</code><code>with</code><code>-http_addition_module --</code><code>with</code><code>-http_dav_module --</code><code>with</code><code>-http_geoip_module --</code><code>with</code><code>-http_gzip_static_module --</code><code>with</code><code>-http_image_filter_module --</code><code>with</code><code>-http_realip_module --</code><code>with</code><code>-http_secure_link_module --</code><code>with</code><code>-http_stub_status_module --</code><code>with</code><code>-http_ssl_module --</code><code>with</code><code>-http_sub_module --</code><code>with</code><code>-http_xslt_module --</code><code>with</code><code>-ipv6 --</code><code>with</code><code>-mail --</code><code>with</code><code>-mail_ssl_module --add-module=/usr/src/nginx/source/nginx-1.4.1/debian/modules/nginx-auth-pam --add-module=/usr/src/nginx/source/nginx-1.4.1/debian/modules/nginx-dav-ext-module --add-module=/usr/src/nginx/source/nginx-1.4.1/debian/modules/nginx-echo --add-module=/usr/src/nginx/source/nginx-1.4.1/debian/modules/nginx-upstream-fair --add-module=/usr/src/nginx/source/nginx-1.4.1/debian/modules/nginx-syslog --add-module=/usr/src/nginx/source/nginx-1.4.1/debian/modules/nginx-cache-purge --add-module=/usr/src/nginx/source/nginx-1.4.1/debian/modules/ngx_http_pinba_module --add-module=/usr/src/nginx/source/nginx-1.4.1/debian/modules/ngx_http_substitutions_filter_module --add-module=/usr/src/nginx/source/nginx-1.4.1/debian/modules/nginx-x-rid-header --</code><code>with</code><code>-ld-opt=-lossp-uuid</code>

[End]

     本文转自jimmy_lixw 51CTO博客,原文链接:http://blog.51cto.com/jimmyli/1098332,如需转载请自行联系原作者