Warning (2): include_once(/var/www/html/xxxxxx/app/config/database.php) [function.include-once]: failed to open stream: No such file or directory [CORE/cake/libs/model/connection_manager.php, line 23]
Warning (2): include_once() [function.include]: Failed opening '/var/www/html/xxxxxx/app/config/database.php' for inclusion (include_path='/var/www/html/xxxxxx:/var/www/html/xxxxxx/app/:.:/usr/share/pear:/usr/share/php') [CORE/cake/libs/model/connection_manager.php, line 23]

ファイル名を変更する必要があるらしい。
[root@localhost  ~]# cp -p /var/www/html/xxxxxx/app/config/database.php.default /var/www/html/xxxxxx/app/config/database.php

ちなみにバージョンは1.3.14

著者の言っていることが正しいのか、著者が名前を挙げて批判している大学教授や新聞社の言っていることが正しいのかは人それぞれが判断すれば良い。

ただ、いまだに学校では戦勝国が押し付けた歴史教育しかされないので、大人になってから自分の判断で選んだ教材で戦争や各国の植民地支配などの近代史を学習することは大切なことだと思う。フランクリン・ルーズベルトについてはかなり細かく書かれていたので、知らないことも多かった。

最後は以下のように結ばれている。

引用
奴隷をもち、残忍な戦争をし、掠奪と強姦を喜びにしてきた国々にとって掠奪も強姦もしない、奴隷も植民地ももたない日本は煙たいどころか、存在してもらっては困る国に見えた。その伏流を見落とすと、近代史は見えてこない。
日本対白人国家プラス支那という対立構造ができ、先の戦争が起きた。日本を制したのが中でも最も邪悪な米国であり、その米国がいま丸腰の日本の保護者となっているのは歴史の皮肉というより、もはやたちの悪い冗談でしかない。

内容は、うちにもそういう上司いる。的な「あるあるネタ」だった。なぜ平社員の時、優秀だった人が肩書き付きになるとバカになってしまうのかというところを、もっと掘り下げて欲しかった。

守ってくれない上司、独裁的な上司など、バカな上司に対しての対策が書かれているが、上司とはそういうものだと思って諦めるとか、ほとんどがネガティブな対策ばかりで、そんなことをしていたらバカな上司を助長させるだけだし、自分のためにもならないように思う。

バカな上司に悩んでいる人にとっては、この本を読むことによって、よその会社にも馬鹿な上司はいるんだと、心理的ストレスの緩和にはなるかも...

yumのグループ単位のパッケージ管理コマンドをまとめておく。

一覧表示
[root@localhost ~]# yum grouplist
Installed Groups:
   GNOME デスクトップ環境
   MySQL データベース
   Office/生産性
   Web サーバー
   X Window System
   Yum Utilities
   エディタ
   グラフィカルインターネット
   グラフィクス
   ゲームと娯楽
   サウンドとビデオ
   サーバー設定ツール
   システムツール
   ダイヤルアップネットワークサポート
   テキストベースのインターネット
   ネットワークサーバー
   メールサーバー
   レガシーなネットワークサーバー
   印刷サポート
   管理ツール
Available Groups:
   Beagle
   DNS ネームサーバー
   Emacs
   FTP サーバー
   Fedora パッケージャ
   FreeNX and NX
   GNOME ソフトウェア開発
   Horde
   Java
   Java 開発
   KDE ( K デスクトップ環境)
   KDE ソフトウェア開発
   KVM
   Mono
   OpenFabrics Enterprise ディストリビューション
   PostgreSQL データベース
   Ruby
   Tomboy
   Web 開発環境
   Windows ファイルサーバー
   X ソフトウェア開発
   XFCE-4.4
   ウィンドウマネージャ
   クラスタストレージ
   クラスタリング
   ニュースサーバー
   ハードウェアサポート
   ベース
   レガシーなソフトウェアのサポート
   レガシーなソフトウェアの開発
   仮想化
   技術系と科学系
   教育用ソフトウェア
   著作と発行
   開発ツール
   開発ライブラリ
   電子ラボラトリ
Done

英名で表示させたい場合は、環境変数の値を一時的に変更する。
[root@localhost ~]# echo $LANG
ja_JP.UTF-8
[root@localhost ~]# export LANG=C
[root@localhost ~]# yum grouplist
Installed Groups:
   Administration Tools
   Dialup Networking Support
   Editors
   GNOME Desktop Environment
   Games and Entertainment
   Graphical Internet
   Graphics
   Legacy Network Server
   Mail Server
   MySQL Database
   Network Servers
   Office/Productivity
   Printing Support
   Server Configuration Tools
   Sound and Video
   System Tools
   Text-based Internet
   Web Server
   X Window System
   Yum Utilities
Available Groups:
   Authoring and Publishing
   Base
   Beagle
   Cluster Storage
   Clustering
   DNS Name Server
   Development Libraries
   Development Tools
   Educational Software
   Electronic Lab
   Emacs
   Engineering and Scientific
   FTP Server
   Fedora Packager
   FreeNX and NX
   GNOME Software Development
   Hardware Support
   Horde
   Java
   Java Development
   KDE (K Desktop Environment)
   KDE Software Development
   KVM
   Legacy Software Development
   Legacy Software Support
   Mono
   News Server
   OpenFabrics Enterprise Distribution
   PostgreSQL Database
   Ruby
   Tomboy
   Virtualization
   Web Development
   Window Managers
   Windows File Server
   X Software Development
   XFCE-4.4
Done
[root@localhost ~]# export LANG=ja_JP.UTF-8

インストール
[root@localhost ~]# yum groupinstall "X Window System" "GNOME デスクトップ環境"

インストール(英名で指定する場合)
[root@localhost ~]# yum groupinstall "X Window System" "GNOME Desktop Environment"

削除
[root@localhost ~]# yum groupremove "X Window System" "GNOME Desktop Environment"

アップデート
[root@localhost ~]# yum groupupdate "X Window System" "GNOME Desktop Environment"

詳細情報表示
[root@localhost ~]# yum groupinfo "X Window System"
Group: X Window System
 Description: 基本的なグラフィカル (X) ユーザーインターフェースを使用するには、このパッケージグループをインストールしてください。
 Mandatory Packages:
   bitmap-fonts
   desktop-backgrounds-basic
   xorg-x11-drivers
   xorg-x11-fonts-100dpi
   xorg-x11-fonts-75dpi
   xorg-x11-fonts-ISO8859-1-100dpi
   xorg-x11-fonts-ISO8859-1-75dpi
   xorg-x11-fonts-Type1
   xorg-x11-fonts-misc
   xorg-x11-fonts-truetype
   xorg-x11-server-Xorg
   xorg-x11-xauth
   xorg-x11-xfs
   xorg-x11-xinit
 Default Packages:
   authconfig-gtk
   bitstream-vera-fonts
   dejavu-lgc-fonts
   firstboot
   gdm
   glx-utils
   krb5-auth-dialog
   linuxwacom
   openssh-askpass
   pirut
   pup
   rhgb
   rhn-setup-gnome
   synaptics
   system-config-date
   system-config-display
   system-config-network
   system-config-printer-gui
   system-config-services
   system-config-soundcard
   system-config-users
   vnc-server
   wdaemon
   xorg-x11-apps
   xorg-x11-twm
   xterm
 Optional Packages:
   freefont
   switchdesk
   xorg-x11-resutils
   xorg-x11-server-Xnest
   xorg-x11-server-Xvfb
   xorg-x11-xfs-utils
   xorg-x11-xsm
mysql-serverをインストールする。
[root@localhost ~]# yum -y install mysql-server
my.cnfファイルを編集する。
[root@localhost ~]# vi /etc/my.cnf

/etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
default-character-set = utf8

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

[mysql]
default-character-set = utf8

mysqldを起動する。
[root@localhost ~]# /etc/rc.d/init.d/mysqld start
[root@localhost ~]# chkconfig mysqld on

初期設定を行う。
[root@localhost ~]# mysql_secure_installation
   ・
   ・
   ・
Enter current password for root (enter for none): 空Enter
   ・
   ・
   ・
Set root password? [Y/n] 空Enter
New password: 任意のパスワードを入力
Re-enter new password: 任意のパスワードを再入力
   ・
   ・
   ・
Remove anonymous users? [Y/n] 空Enter
   ・
   ・
   ・
Disallow root login remotely? [Y/n] 空Enter
   ・
   ・
   ・
Remove test database and access to it? [Y/n]  空Enter
   ・
   ・
   ・
Reload privilege tables now? [Y/n] 空Enter
   ・
   ・
   ・

httpdをインストールする。
Apache インストール手順(CensOS 6)」参照

EPELリポジトリをインストールする。
RPMforge/EPEL/Remi リポジトリインストール手順(CentOS 6)」参照

php、php-mbstring、php-Smartyをインストールする。
[root@localhost ~]# yum -y install php php-mbstring php-Smarty

php.iniファイルを編集する。
[root@localhost ~]# vi /etc/php.ini

/etc/php.ini



[Date] ; Defines the default timezone used by the date functions ; http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone ;date.timezone = date.timezone = "Asia/Tokyo"




httpdを再起動する。
[root@localhost ~]# /etc/rc.d/init.d/httpd restart

以降、動作確認。
[root@localhost ~]# mkdir /var/www/smarty
[root@localhost ~]# mkdir /var/www/smarty/templates
[root@localhost ~]# mkdir /var/www/smarty/templates_c
[root@localhost ~]# chown apache. /var/www/smarty/templates_c
[root@localhost ~]# mkdir /var/www/html/myapp
[root@localhost ~]# vi /var/www/html/myapp/hello.php
[root@localhost ~]# vi /var/www/smarty/templates/hello.tpl

/var/www/html/myapp/hello.php
<?php
require_once("Smarty/Smarty.class.php");
$o_smarty = new Smarty();
$o_smarty->template_dir = "../../smarty/templates/";
$o_smarty->compile_dir = "../../smarty/templates_c/";
$o_smarty->assign("name", "Tatsu");
$o_smarty->display("hello.tpl");
?>

/var/www/smarty/templates/hello.tpl
<html>
<head>
<title>Hello!</title>
</head>
<body>
Hello, {$name}!
</body>
</html>

ブラウザでアクセスして、「Hello, Tatsu!」と表示されることを確認する。

httpdとmod_sslをインストールする。
[root@localhost ~]# yum -y install httpd mod_ssl
httpd.confファイルを編集する。
[root@localhost ~]# vi /etc/httpd/conf/httpd.conf

/etc/httpd/conf/httpd.conf
   ・
   ・
   ・
#
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If this is not set to valid DNS name for your host, server-generated
# redirections will not work.  See also the UseCanonicalName directive.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
# You will have to access it by its address anyway, and this will make
# redirections work in a sensible way.
#
#ServerName www.example.com:80
ServerName localhost.localdomain:80
   ・
   ・
   ・
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important.  Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
    #Options Indexes FollowSymLinks
    Options Includes ExecCGI FollowSymLinks
   ・
   ・
   ・
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
    #AllowOverride None
    AllowOverride All
   ・
   ・
   ・
#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
#LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%!414r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
   ・
   ・
   ・
#
# Optionally add a line containing the server version and virtual host
# name to server-generated pages (internal error documents, FTP directory
# listings, mod_status and mod_info output etc., but not CGI generated
# documents or custom error documents).
# Set to "EMail" to also include a mailto: link to the ServerAdmin.
# Set to one of:  On | Off | EMail
#
#ServerSignature On
ServerSignature Off
   ・
   ・
   ・
#AddDefaultCharset UTF-8
   ・
   ・
   ・
#
# AddHandler allows you to map certain file extensions to "handlers":
# actions unrelated to filetype. These can be either built into the server
# or added with the Action directive (see below)
#
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
#AddHandler cgi-script .cgi
AddHandler cgi-script .cgi .pl
   ・
   ・
   ・
<Directory "/var/www/icons">
    #Options Indexes MultiViews FollowSymLinks
    Options MultiViews FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</directory>
   ・
   ・
   ・

httpdを起動する。
[root@localhost ~]# /etc/rc.d/init.d/httpd start
[root@localhost ~]# chkconfig httpd on
「/etc/php.ini」で指定する場合(要再起動(リロード))
;エラーを出力しない
;display_errors = Off
;エラーを出力する
display_errors = On

PHPソースコードで指定する場合
// エラーを出力しない
//ini_set('display_errors', 0);
// エラーを出力する
ini_set('display_errors', 1);

yum-prioritiesをインストールする。
[root@localhost ~]# yum -y install yum-plugin-priorities

標準リポジトリの優先順位を最上位に設定する。
[root@localhost ~]# vi /etc/yum.repos.d/CentOS-Base.repo

/etc/yum.repos.d/CentOS-Base.repo
[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
priority=1

#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
priority=1

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
priority=1
 ・
 ・
 ・

RPMforgeリポジトリのインストール(32bit)
[root@localhost ~]# rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm

RPMforgeリポジトリのインストール(64bit)
[root@localhost ~]# rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm

EPELリポジトリのインストール(32bit)
[root@localhost ~]# rpm -Uvh http://ftp.riken.jp/Linux/fedora/epel/6/i386/epel-release-6-5.noarch.rpm

EPELリポジトリのインストール(64bit)
[root@localhost ~]# rpm -Uvh http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/epel-release-6-5.noarch.rpm

Remiリポジトリのインストール
[root@localhost ~]# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

マニュアルによると、5.2.3以降では
mysql_query('SET NAMES utf8');
ではなく
mysql_set_charset("utf8");
を使うことが推奨されている。(UTF-8の場合)

そうなのか...
MySQLが5.0.7以降でないと使えないとの事。

最近のコメント

アイテム

  • asagao.jpg
  • ap.jpg

ウェブページ

Powered by Movable Type 5.01