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

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS MySQL,集群版 2核4GB 100GB
推荐场景:
搭建个人博客
云数据库 RDS MySQL,高可用版 2核4GB 50GB
简介:

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

简述:本文记录debian6 / 7 系统安nginx php mysql时常遇见的问题。对使用安装DebianLNMP各版本遇到的问题进行解答,并详细给出解决方法。
Debian错误问题一:
默认安装的Debian,选择的apt-get源,默认的security.debian.org在国内会出现无法使用。
类似地址如下:
deb 
http://security.debian.org/  stable/updates main 
deb-src 
http://security.debian.org/debian/  squeeze main
这个时候,请检查 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提示覆盖配置文件
如图:
170349859.jpg
直接选择"Y"
 
 
 
Debian错误问题三:
由于官方网络源不问题导致dotdeb.gpg 源apt-key add dotdeb.gpg无法下载,获取不了apt-key。
会无法成功安装DebianLNMP。
错误提示:
root@debian :~# wget  http://www.dotdeb.org/dotdeb.gpg
--2012-12-25 00:52:26--   http://www.dotdeb.org/dotdeb.gpg
正在解析主机  www.dotdeb.org ... 失败:未知的名称或服务。
wget: 无法解析主机地址 “www.dotdeb.org”
root@debian :~# apt-key add dotdeb.gpg
gpg: 无法打开‘dotdeb.gpg’: 没有那个文件或目录
解决方法:
安装前ping 
www.dotdeb.org
手工下载
wget 
http://www.dotdeb.org/dotdeb.gpg
apt-key add dotdeb.gpg
然后多运行几次,直到成功,提示"OK".
 
 
 
Debian错误问题四:
为什么重启机器后 php5-fpm 总是启动不了?
Debian7.3系统i386版本,安装的DebianLNMP加强版后。启动提示php5-fpm faild错误信息。

wKioL1MNpfujrtK-AAC6x-hqBCc073.jpg

wKiom1MNpiHD6jRQAAB-nYuP3PA275.jpg

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

wKioL1MNpfuDiBO8AAAfL2ZqQ2I737.jpg

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

 

 

 

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

   从Debian7版本开始它的源命名为“wheezy”;而Debian6版本的源名称是“squeeze”。我们可从他们的版本命名规则中估计推理其他更多源列表、源地址。
值得注意的是,不同的Debian版本设置sources.list的源列表至关重要,稍有设置不当是无法安装源里面的软件,无法正确获取到源的信息、内容。并且还要版本能匹配得对,即是说明Deb源要设置正确。


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

Debian7.1 安装 ssh服务

1
2
3
4
#使用apt-get命令快速安装ssh服务
# apt-get install openssh-server
#启动ssh进程
#/etc/init.d/ssh restart


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源,它的默认配置文件为下文:

1
2
3
4
5
6
7
8
9
# deb cdrom:[Debian GNU/Linux 7.1.0 _Wheezy_ - Official amd64 NETINST Binary-1 20130615-23:04]/ wheezy main
#deb cdrom:[Debian GNU/Linux 7.1.0 _Wheezy_ - Official amd64 NETINST Binary-1 20130615-23:04]/ wheezy main
deb http://mirrors.163.com/debian/ wheezy main
deb-src http://mirrors.163.com/debian/ wheezy main
deb http://security.debian.org/ wheezy/updates main
deb-src http://security.debian.org/ wheezy/updates main
# wheezy-updates, previously known as 'volatile'
deb http://mirrors.163.com/debian/ wheezy-updates main
deb-src http://mirrors.163.com/debian/ wheezy-updates main



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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Mysql
[ ok ] Stopping MySQL database server: mysqld.
130622 15:34:38 [Note] Plugin  'FEDERATED' is disabled.
130622 15:34:38 InnoDB: The InnoDB memory heap is disabled
130622 15:34:38 InnoDB: Mutexes and rw_locks useGCC atomic builtins
130622 15:34:38 InnoDB: Compressed tables usezlib 1.2.7
130622 15:34:38 InnoDB: Using Linux native AIO
130622 15:34:38 InnoDB: Initializing buffer pool, size = 128.0M
130622 15:34:38 InnoDB: Completed initialization of buffer pool
130622 15:34:38 InnoDB: highest supported file formatis Barracuda.
130622 15:34:38  InnoDB: Waiting forthe background threads to start
130622 15:34:39 InnoDB: 5.5.31 started; logsequence number 1595675
130622 15:34:39  InnoDB: Starting  shutdown ...
130622 15:34:40  InnoDB: Shutdown completed; logsequence number 1595675
[ ok ] Starting MySQL database server: mysqld ..
[info] Checking fortables which need an upgrade, are corrupt or were
not closed cleanly..
正在设置 libhtml-template-perl (2.91-1) ...
正在设置 mysql-client (5.5.31+dfsg-0+wheezy1) ...
正在设置 mysql-server (5.5.31+dfsg-0+wheezy1) ...


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版本信息,以及默认已编译模块

1
2
3
4
root @debian7 .1.0:~ # nginx -V
nginx version: nginx/1.4.1
TLS SNI support enabled
configure arguments: --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --error- log -path=/var/ log /nginx/error. log --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http- log -path=/var/ log /nginx/access. log --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi -- lock -path=/var/ lock /nginx. lock --pid-path=/var/run/nginx.pid -- with -pcre-jit -- with -debug -- with -file-aio -- with -http_addition_module -- with -http_dav_module -- with -http_geoip_module -- with -http_gzip_static_module -- with -http_image_filter_module -- with -http_realip_module -- with -http_secure_link_module -- with -http_stub_status_module -- with -http_ssl_module -- with -http_sub_module -- with -http_xslt_module -- with -ipv6 -- with -mail -- with -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 -- with -ld-opt=-lossp-uuid

[End]



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



相关文章
|
11月前
chatr 命令不可用 解决办法
chattr 命令 不存在
354 0
|
Ubuntu 虚拟化
Ubuntu系统 安装与配置 常见异常与解决办法
解决办法:以管理员方式打开cmd命令,输入netsh winsock reset(这个命令是重置网络规范,黑屏的原因很可能就是VMware软件跟本地网络规范有冲突),回车之后提示成功重置winsock目录,您必须重新启动计算机才能重新完成配置。重启后打开即可。
Ubuntu系统 安装与配置 常见异常与解决办法
|
Linux
LINUX安装依赖库的解决办法
LINUX安装依赖库的解决办法
202 0
|
并行计算 Linux
LINUX安装CUDA 9.2,提示缺少文件的解决办法
LINUX安装CUDA 9.2,提示缺少文件的解决办法
283 0
|
网络安全
Libzip 版本过低或提示reinstall解决方法
Libzip 版本过低或提示reinstall解决方法
376 0
|
Ubuntu Linux iOS开发
Calibre的Linux安装error:libxcb-xinerama0及解决方法
Calibre的Linux安装error:libxcb-xinerama0及解决方法
947 0
Calibre的Linux安装error:libxcb-xinerama0及解决方法
|
Ubuntu Shell Linux
Ubuntu安装WDCP遇到的无法便于错误解决方法
WDCP v3.2安装 WDCP支持CentOS系统下安装,包括了32bit或者64bit,最新版本建议在6.x以上版本使用,源码安装命令为:   wget http://dl.wdlinux.cn/lanmp_laster.
1556 0