Debian:例としてphp5-fpmとnginx 1.0.4を使用したApt-Pinning(Debianの方法)

すべてのDebianワーカーは、Debianが「新製品」によって減速されるのと同じくらい安定していることを知っています。 特に、多くの人に愛されているphp5-fpmパッケージは、まだ安定版リポジトリにはありません。 人々がどのように行うかを少し検索することに決めたので、多くの人が「ソート」からそれを収集することに気付きました。 私は何とかそれが好きではなかった。 そこで今日、Apt-Pinningを使用して、Debian-wayのスタイルでインストールしました。



Apt-Pinningは、要するに、どのリポジトリからパッケージをインストールするのが望ましいかを示す技術です。



すべてが非常に簡単に行われます。



テストおよび不安定なリポジトリを/etc/apt/sources.listに追加します

注意:http:の後のURLにスペースが入れられます。 彼らはそこにいるべきではない

#deb http://ftp.ru.debian.org/debian/ squeeze main



deb http://ftp.ru.debian.org/debian/ squeeze main non-free contrib

deb-src http://ftp.ru.debian.org/debian/ squeeze main non-free contrib



#セキュリティ

deb http://security.debian.org/ squeeze /メインcontrib non-freeを更新

deb-src http://security.debian.org/ squeeze /メインcontrib non-freeを更新



#squeeze-updates、以前は「volatile」として知られていました

deb http://ftp.ru.debian.org/debian/ squeeze-updates main contrib non-free

deb-src http://ftp.ru.debian.org/debian/ squeeze-updates main contrib non-free



#不安定

deb http://ftp.ru.debian.org/debian/不安定なメインのnon-free contrib

deb-src http://ftp.ru.debian.org/debian/不安定なメインのnon-free contrib



#テスト

deb http://ftp.ru.debian.org/debian/主要なnon-free contribのテスト

deb-src http://ftp.ru.debian.org/debian/主要なnon-free contribのテスト





次に、ファイル/ etc / apt / preferencesを作成します

#PHP5およびNGINXを更新

#Pin-Priorityフィールドは、どのリポジトリからパケットを取得するのが望ましいかを示します

#パッケージphp5-fpm、nginx、および補助的なものはすべて、安定版から取得し、テストで調べてから、適切であれば不安定版で調べます。

#PHP5、NGINX

パッケージ:php5-fpm nginx php5-common libpcre3 nginx-full libgeoip1

ピン:リリースa =安定

ピンの優先順位:700



パッケージ:php5-fpm nginx php5-common libpcre3 nginx-full libgeoip1

ピン:リリースa =テスト

ピンの優先順位:650



パッケージ:php5-fpm nginx php5-common libpcre3 nginx-full libgeoip1

ピン:リリースa =不安定

ピンの優先順位:600



#OTHER

パッケージ:*

ピン:リリースa =安定

ピン優先:550



#OTHER

パッケージ:*

ピン:リリースa =テスト

ピン優先:500







「ペンテスト」を行う

sudo apt-get update

#-sフラグは「シミュレーション」を意味します。 正しく構成されていれば、アップグレードパッケージはほとんどありません。

sudo apt-get -sアップグレード

#パッケージを注意深く見てください。

sudo apt-get -s php5-fpm nginxをインストール

#問題を引き起こす依存関係を注意深く見て、最初の3つのパッケージに追加します

sudo apt-get -s php5-fpm nginxをインストール

#何かがおかしい場合、すべてがうまくいくように見えるまでシミュレーションを行います-APT設定を修正します



#nginxとphp5-fpmをインストールします

sudo apt-get install php5-fpm nginx

sudo /etc/init.d/php5-fpm start

sudo /etc/init.d/nginx start



http://私たちのIPにアクセスしてください。nginxがあなたを歓迎します!



PHPを有効にします。

sudo echo '<?php phpinfo(); ?> '> /usr/share/nginx/www/info.php

編集/ etc / nginx / sites-available / default

sudo nano -w / etc / nginx / sites-available / default

構成でfcgi_passをカットします。(CTRL + W)文字列「9000」を探し、コメントを除くブロック全体のコメントを外します。 私たちは自分で微調整します。

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000



location ~ \.php$ {

fastcgi_pass unix:/var/php-fpm.sock;

fastcgi_index index.php;

include fastcgi_params;

}






nginxを再起動します

sudo /etc/init.d/nginx restart

http:// IP / info.phpに移動します

出来上がり。



All Articles