天天看點

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,如需轉載請自行聯系原作者