忍者ブログ

鯖設定とプログラム

メモ。

<< | 2024/05 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | >>

[PR]

×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

PHP5.3.8にアップグレードする RHEL4(RedHat Enterprise Linux ES v4)

curlを有効にしたかったので、ついでに何年ぶりかにPHPをアップグレードした。

PHP5.2.5からPHP5.3.8にサーバをアップグレードする。

前回のPHP5.2.4からPHP5.2.5にアップグレードと同様にインストールしてみる。

# cd /usr/local/src/

# wget http://jp.php.net/get/php-5.3.8.tar.gz/from/a/mirror
# ls -al
php-5.3.8.tar.bz2

# tar jxvf php-5.3.8.tar.bz2
# cd php-5.3.8

# ../configure --prefix=/usr/local --bindir=/usr/local/bin/ --with-apxs2=/usr/sbin/apxs --with-mysql=/usr --enable-mbstring --enable-mbregex --with-freetype-dir=/usr --with-png-dir=/usr --with-gd --enable-gd-native-ttf --with-gettext --with-gmp --with-iconv --with-jpeg -dir=/usr --with-openssl --with-pspell --with-regex --with-zlib --with-layout=GNU --enable-bcmath --enable-exif --enable-ftp --enable-magic-quot
es --enable-safe-mode --enable-sockets --enable-sysvsem --enable-sysvshm --enable-wddx --without-oci8 --with-pear --with-kerberos=/usr/kerberos --with-ldap=shared --enable-bcmath --enable-shmop --enable-calendar --with-pdo-mysql --with-mcrypt --with-curl

+--------------------------------------------------------------------+
| License: |
| This software is subject to the PHP License, available in this |
| distribution in the file LICENSE. By continuing this installation |
| process, you are bound by the terms of this license agreement. |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point. |
+--------------------------------------------------------------------+

Thank you for using PHP.

# make

Build complete.
(It is safe to ignore warnings about tempnam and tmpnam).

アパッチを止める
/etc/init.d/httpd stop
インストール
# make install
アパッチ起動
/etc/init.d/httpd start

これでアップグレードは完了。

# php -v

5.3.8の情報に変わっていた。

Deprecated: Directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and greater in Unknown on line 0
と警告が出ている。5.3以降は'magic_quotes_gpc'が推奨されていないようだ。

# vi /usr/local/etc/php.ini

magic_quotes_gpc = Offとした
もう一つ非推奨のregister_long_arraysも
register_long_arrays = Off
とした。

# php -v
PHP 5.3.8 (cli) (built: Oct 25 2011 00:53:30)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies

エラーも出なくなりcurlも利用可能となった。

PHPアップグレード履歴
PHP4.3.9からPHP5.1.5にアップグレード
PHP5.1.5からPHP5.2.0にアップグレード
PHP5.2.0からPHP5.2.1にアップグレード
PHP5.2.1からPHP5.2.3にアップグレード
PHP5.2.3からPHP5.2.4にアップグレード
PHP5.2.4からPHP5.2.5にアップグレード
PR

EC2 Apache,MySQL,phpをインストールする

Apache MySQL phpをインストール

yum -y install httpd php mysql mysql-server php-mysql

EC2 設定

マシンの言語を日本語に変更
vi /etc/sysconfig/i18n

LANG="en_US.UTF-8"をLANG="ja_JP.UTF-8"

タイムゾーンを日本に変更
cp -i /usr/share/zoneinfo/Japan /etc/localtime

タイムゾーン変えたので、ハマリそうなcrontabを再起動
/etc/init.d/crond restart


EC2メモ

AmazonEC2の始め方が変わっているのでメモ。

Instances立ち上げてrootになるまで。

AWS Management Consoleの左したKey Pairsからキーに名前を付けて保存しておく。
デフォルトでアマゾンがEC2に最適化しているLinuxが表示される。
さっきのキーを選択してInstancesを1つ立ち上げる。
立ち上がったInstancesを選択し、Instances ActionsからConnectを選択。
Connect to your instance using instance's public DNSに書かれているDNSをコピーしておく。
WinならTeraTermなどのホストに貼り付け、ユーザ名はec2-user(前はrootだったみたい)にし、パスは無し。
RSA/DSA鍵を使うを選んで、さっき保存した鍵ファイルを指定。
ログイン出来たら、sudo passwd rootでrootのパスワード作る。
su



Hello World

twitterのAPIで遊ぼうと思ったので、ついでに興味があったRubyで書く事にした。

print("Hello World.\n")

電子証明書の取得方法まとめ


会社で電子証明書を取得する必要があったのでまとめ。

まずはソフトを買っておく。安いのでいいのでNTTデータのでいい。
http://www.nttdata.co.jp/services/syoumei/syoumei_buy.html
5250円

次に申請書を印刷して記載。
http://www.moj.go.jp/ONLINE/ELECTRON/13-1-1.pdf

記載例
http://www.moj.go.jp/ONLINE/ELECTRON/13-1-2.html

代表者が行かないのなら、委任状がいる。
http://www.moj.go.jp/ONLINE/ELECTRON/13-1-5.html

手数料は3か月のときは2500円、3か月を超えるときは3か月当たり1800円を加算した額。
12か月の証明期間を受けるなら2500円+1800+1800+1800=7900円になる。

ソフトが届いたら、申請に必要なCDRを作る。
申請書とソフトで作ったCDRと委任状と印鑑カードをもって法務局に行く。
手数料分の登記印紙(法務局で売ってる)を買って申請書に貼る(収入印紙じゃない)

電子認証局ってのが法務局に入っているので、そこに全部提出でOK。

viでのみ文字化け

catでは文字化けしていないのに、viで文字化けしていた。
当環境は全てUTF-8で合わせてあるので、

:set enc=UTF-8

とする事で解消した。毎回打ち込むのが面倒なので、
ユーザーのルートディレクトリで
vi .vimrc
として
set enc=UTF-8
を記述しておいた。

WordPressの自動アップグレードのエラー

ディレクトリがないとかではなく、接続が出来ないとエラーの場合。

パーミッションやら、PASVモードを無効にしてみたり、ホスト名をIPにしてみたり、何やっても駄目な時。
サーバ内からのFTPアクセスが蹴られている。

/etc/hosts.allow に自鯖のIPを記入 ついでにlocalhost用も

vsftpd: 自鯖のIP
vsftpd: 127.0.0.1

これでFTPが繋がりアップデート出来ました。

PHP5.2.5にアップグレードする RHEL4(RedHat Enterprise Linux ES v4)

PHP5.2.4からPHP5.2.5にローカルサーバをアップグレードする。

前回のPHP5.2.3からPHP5.2.4にアップグレードと同様にインストールしてみる。

# cd /usr/local/src/

# wget http://jp.php.net/get/php-5.2.5.tar.bz2/from/this/mirror
# ls -al
php-5.2.5.tar.bz2

# tar jxvf php-5.2.5.tar.bz2
# cd php-5.2.5

# ./configure --prefix=/usr/local --bindir=/usr/local/bin/ --with-apxs2=/usr/sbin/apxs --with-mysql=/usr --enable-mbstring --enable-mbregex --with-freetype-dir=/usr --with-png-dir=/usr --with-gd --enable-gd-native-ttf --with-ttf --with-gettext --with-ncurses --with-gmp --with-iconv --with-jpeg-dir=/usr --with-openssl --with-pspell --with-regex --with-zlib --with-layout=GNU --enable-bcmath --enable-exif --enable-ftp --enable-magic-quotes --enable-safe-mode --enable-sockets --enable-sysvsem --enable-sysvshm --enable-discard-path --enable-wddx --without-oci8 --with-pear --with-kerberos=/usr/kerberos --with-ldap=shared --enable-bcmath --enable-shmop --enable-calendar --with-pdo-mysql --with-mcrypt

+--------------------------------------------------------------------+
| License:                                                                                                  |
| This software is subject to the PHP License, available in this                          |
| distribution in the file LICENSE.  By continuing this installation                        |
| process, you are bound by the terms of this license agreement.                        |
| If you do not agree with the terms of this license, you must abort                     |
| the installation process at this point.                                                           |
+--------------------------------------------------------------------+

Thank you for using PHP.

# make

Build complete.
(It is safe to ignore warnings about tempnam and tmpnam).

アパッチを止める
/etc/init.d/httpd stop
インストール
# make install
アパッチ起動
/etc/init.d/httpd start

これでアップグレードは完了。

# php -v

5.2.5の情報に変わっていた。
公開サーバにも--with-pgsql=/usrを追加しインストールした。

PHPアップグレード履歴
PHP4.3.9からPHP5.1.5にアップグレード
PHP5.1.5からPHP5.2.0にアップグレード
PHP5.2.0からPHP5.2.1にアップグレード
PHP5.2.1からPHP5.2.3にアップグレード
PHP5.2.3からPHP5.2.4にアップグレード

openads2.4で広告がうまく表示されない場合

他は表示されjavascriptでうまく表示されないのなら下記が作用しているかも。

FirefoxのプラグインでAdblockを入れてる。
NortonのAd Blockerが動いている。
ブログ内検索
カレンダー
04 2024/05 06
S M T W T F S
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
プロフィール
HN:
No Name Ninja
性別:
非公開
自己紹介:
へなちょこサーバ管理者

HPは作れるがプログラムが出来なかったので、PHPを覚えた。

公開サーバ環境:
CPU:Pentium M 740 1.73GHz
Mem:512MB DDR2
HDD1:160GB SATA
HDD2:160GB SATA
OS:RedHat Enterprise Linux ES v4
Apache:httpd-2.0.52-28ent
MySQL:mysql-4.1.20-1
PHP:php-5.2.5
JavaSE:JDK6
Tomcat:apache-tomcat-5.5.20
Apache Tomcat Connector:jk-1.2.19

ローカルサーバ環境:
DELL INSPIRON4000
OS:RedHat Enterprise Linux ES v4
Apache:httpd-2.0.52-28ent
MySQL:mysql-4.1.20-1
PHP:php-5.2.5
JavaSE:JDK6
Tomcat:apache-tomcat-5.5.20
Apache Tomcat Connector:jk-1.2.19

ローカルPC
OS:Windows7
最新コメント
[03/14 mietwagen]
[02/02 Online poker]
[03/13 ほし]
[03/01 へなとこ]
[11/14 ポポ]
アクセス解析
?
カウンター
起動、終了、再起動
Apacheの起動
/etc/init.d/httpd start
Apacheの終了
/etc/init.d/httpd stop
Apacheの再起動
/etc/init.d/httpd restart

Tomcatの起動
/usr/local/tomcat/bin/startup.sh
Toncatの終了
/usr/local/tomcat/bin/shutdown.sh

MySQLの起動
/etc/rc.d/init.d/mysqld start
MySQLの終了
/etc/rc.d/init.d/mysqld stop
MySQLの再起動
/etc/rc.d/init.d/mysqld restart

vsftpdの起動
/etc/init.d/vsftpd start
vsftpdの終了
/etc/init.d/vsftpd stop
vsftpdの再起動
/etc/init.d/vsftpd restart
場所
httpd.conf
/etc/httpd/conf/httpd.conf

AdminControlMenu: AdminMenu | NewEntry | EditComment | EditTrackback

忍者ブログ [PR]