Debian Jessie にXAMPP 導入

明日の 第3回鹿児島Node.jsの会 でXAMPP を使うってことで導入を試みました.何時もはpkg かsource からでXAMPP は使ったこと無いのです>< - 第3回鹿児島node.jsの会資料_内村

#そいやNiigata Linux ってこういうのが一通り揃ってるのが売りのディストリビューションがあったけど最近OSC Tokyo とかで見かけないような.

以下からXAMPP をもらってきます.
XAMPP | Free Development software downloads at SourceForge.net

今回は xampp-linux-x64-1.8.3-1-installer.run を以下からもらってきました.hash はファイル名の右の (i) マークを押すと確認できます.
XAMPP – Browse /XAMPP Linux/1.8.3 at SourceForge.net

念の為hash を確認します.

% md5sum xampp-linux-x64-1.8.3-1-installer.run
4e464cec2b49da3e8c539511b0817478 xampp-linux-x64-1.8.3-1-installer.run
% sha1sum xampp-linux-x64-1.8.3-1-installer.run
2da87a7acb57bcac6156e702c619e102057308df xampp-linux-x64-1.8.3-1-installer.run

そのまま実行する感じのようです.

% file xampp-linux-x64-1.8.3-1-installer.run
xampp-linux-x64-1.8.3-1-installer.run: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, stripped


% chmod +x ./xampp-linux-x64-1.8.3-1-installer.run
% ./xampp-linux-x64-1.8.3-1-installer.run --help
XAMPP 1.8.3-1
Usage:

--help Display the list of valid options

--version Display product information

--unattendedmodeui Unattended Mode UI
Default: none
Allowed: none minimal minimalWithDialogs

--optionfile Installation option file
Default:

--debuglevel Debug information level of verbosity
Default: 2
Allowed: 0 1 2 3 4

--mode Installation mode
Default: qt
Allowed: qt gtk xwindow text unattended

--debugtrace Debug filename
Default:

--enable-components Comma-separated list of components
Default: xampp_core_files,xampp_developer_files
Allowed: xampp_developer_files

--disable-components Comma-separated list of components
Default:
Allowed: xampp_developer_files

--installer-language Language selection
Default: en
Allowed: en ar bg ca da nl et fr fi de el es es_AR he hr hu it ja lt ko pl pt_BR pt ro ru no sl sk sq sv sr tr zh_TW zh_CN va cy cs th

--launchapps Learn more about BitNami for XAMPP
Default: 1

規定値で言語だけ買えてインストーラを起動します.一般ユーザで起動したら要root と言われました>< Screenshot_from_2013-10-25 00:40:38
% sudo paco -p 'xampp-linux-x64-1.8.3-1' "./xampp-linux-x64-1.8.3-1-installer.run --installer-language ja"

もしpaco を使わない場合は以下のような感じでいいと思います.(未確認)

% sudo ./xampp-linux-x64-1.8.3-1-installer.run --installer-language ja

スプラッシュ表示後にインストーラが起動します.次へ.
Screenshot_from_2013-10-25 00:44:50

インストールコンポーネントの選択.規定値のまま次へ.
Screenshot_from_2013-10-25 00:44:56

インストールディレクトリの確認.次へ.(–prefix も無いし変更方法は不明><) Screenshot_from_2013-10-25 00:45:00

XAMPP 用のDrupal とかがDL 出来るページを表示するかい?て感じだと思います.このチェック着けたまま次へ押すとroot 権限でブラウザが起動してしまうのであまりよろしくない気がします.以下のURL が開かれるようなので,それかその下のシンプルなURL を開くと良いと思います.
http://bitnami.com/stack/xampp?utm_source=bitnami&utm_medium=installer&utm_campaign=XAMPP%2BInstaller
http://bitnami.com/stack/xampp
てことでチェック外して次へ.
Screenshot_from_2013-10-25 00:46:24

確認画面.次へ.
Screenshot_from_2013-10-25 00:47:07

インストールが始まります.しばらく待ちます.
Screenshot_from_2013-10-25 00:47:10

インストール完了画面.起動にチェックをつけると例に寄ってroot でブラウザが開いてしまうので着けないほうがいいかもしれません.
Screenshot_from_2013-10-25 00:49:49

てことで
http://localhost/xampp/splash.php
辺りに繋ぐと起動確認できます.

http://localhost/xampp/index.php
辺りから色々出来ますが,初めこのページが開きませんでした.XAMPP をstop/start して解決しました.
(start してみたら以下のように中途半端に起動していたのが多分悪い)

% sudo /opt/lampp/lampp start
Starting XAMPP for Linux 1.8.3-1...
XAMPP: Starting Apache...already running.
XAMPP: Starting MySQL...ok.
XAMPP: Starting ProFTPD...ok.

XAMPP start

% sudo /opt/lampp/lampp start
Starting XAMPP for Linux 1.8.3-1...
XAMPP: Starting Apache...ok.
XAMPP: Starting MySQL...ok.
XAMPP: Starting ProFTPD...ok.

XAMPP stop

% sudo /opt/lampp/lampp stop
Stopping XAMPP for Linux 1.8.3-1...
XAMPP: Stopping Apache...ok.
XAMPP: Stopping MySQL...ok.
XAMPP: Stopping ProFTPD...ok.

さて,これで使える…と思ったらリモートからアクセスできるのにパスワードも設定されてなかったり規定値のパスワードだったりとあれなので変更します.
( http://localhost/xampp/security.php である程度確認できます )

% sudo /opt/lampp/xampp security
[sudo] password for mk:
XAMPP: Quick security check...
XAMPP: Your XAMPP pages are NOT secured by a password.
XAMPP: Do you want to set a password? [yes]
XAMPP: Password:
XAMPP: Password (again):
XAMPP: Password protection active. Please use 'xampp' as user name!
XAMPP: MySQL is accessable via network.
XAMPP: Normaly that's not recommended. Do you want me to turn it off? [yes]
XAMPP: Turned off.
XAMPP: Stopping MySQL...ok.
XAMPP: Starting MySQL...ok.
XAMPP: The MySQL/phpMyAdmin user pma has no password set!!!
XAMPP: Do you want to set a password? [yes]
XAMPP: Password:
XAMPP: Password (again):
XAMPP: Setting new MySQL pma password.
XAMPP: Setting phpMyAdmin's pma password to the new one.
XAMPP: MySQL has no root passwort set!!!
XAMPP: Do you want to set a password? [yes]
XAMPP: Write the password somewhere down to make sure you won't forget it!!!
XAMPP: Password:
XAMPP: Password (again):
XAMPP: Setting new MySQL root password.
XAMPP: Change phpMyAdmin's authentication method.
XAMPP: The FTP password for user 'daemon' is still set to 'xampp'.
XAMPP: Do you want to change the password? [yes]
XAMPP: Password:
XAMPP: Password (again):
XAMPP: Reload ProFTPD...ok.
XAMPP: Done.

ftpd も使わないので止めます.

% sudo /opt/lampp/xampp stopftp
[sudo] password for mk:
XAMPP: Stopping ProFTPD...ok.

これで起動しなくなりました.xampp stop/start でも無視されるようになります.

Debian Jessie にTizen SDK を導入

第3回鹿児島Node.jsの会 でTizen ハッカソンが併催されるということで手元のマシン(Debian Jessie amd64)にTizen SDK を入れました.

先ずは次のページからインストーラーを入手します.
Tizen SDK | Tizen Developers
今回はUbuntu 64bits 用のインストールマネージャーを使ってみました.
2013/10/24 時点では tizen-sdk-ubuntu64-v2.2.32.bin でした.
これをダウンロードした後md5sum コマンドでハッシュを確認します.


% md5sum tizen-sdk-ubuntu64-v2.2.32.bin
80d9fb633fbe7dcdfbd1c24fcd67a068 tizen-sdk-ubuntu64-v2.2.32.bin

※md5sumファイルが見当たらないので目視で…

hash値が一致したら実行します.

% bash tizen-sdk-ubuntu64-v2.2.32.bin

インストーラーが起動してきます.次へ.
Screenshot_from_2013-10-24 20:42:40

ライセンス条項の確認ページ.チェック付けて次へ.
Screenshot_from_2013-10-24 20:42:48

インストールタイプ.Typical でいいと思うけど念のため全部にチェックをして次へ.
Screenshot_from_2013-10-24 20:43:08

インストールパスの設定.とりあえず規定値で次へ.
Screenshot_from_2013-10-24 20:43:18

SDK のダウンロードが始まります….長いです.途中で回線が切れてもインストーラーが落ちても起動しなおしたら続きからダウンロード出来ました.(家のADSL 環境では7回ほど切れて3.5時間ほどかかってしまいました.多分インストールイメージをwget -c とかしたほうが楽だったと思いますorz)
Screenshot_from_2013-10-24 20:43:22

ダウンロードが終わるとパスワードを2回聞かれるので自分のパスワードを入れます.(SS取得失敗><) root のパスワードを設定していたりsudo の設定がなければroot のパスワードが必要になるかもしれません. インストールの完了です. Screenshot_from_2013-10-24 23:58:13

さて,Tizen IDE を起動すると見慣れたものが….普通にEclipse だし.
Screenshot_from_2013-10-24 23:58:13
Screenshot_from_2013-10-24 23:58:57
Screenshot_from_2013-10-25 00:04:08

てことでUbuntu 用となっていましたがDebian Jessie だとそのまま入りました.

Debian Wheezy から Jessie にディストリビューションアップグレードしてみる

しばらく待つと正式の文章が出ると思うけれどWheezy のアップグレードの文章を見ながら試しにあげてみた.
テスト環境だし,素に近い環境なので大雑把ですが><

パッケージを最新に

$ sudo apt-get update
$ sudo apt-get upgrade

backup

pkg 情報

/usr/bin/dpkg --get-selections "*"
を保存しておく.

いつもは以下のようにしてcrontab で毎日取得している.
7 8 * * * /usr/bin/dpkg --get-selections "*" > /home/mk/.dpkg_--get-selections

/etc 以下

$ sudo sh -c "cd /;tar cvJf /var/tmp/x61_etc.tar.xz /etc"
$ scp -P 2222 /var/tmp/x61_etc.tar.xz 192.168.1.102:/export/backup/

etckeeper を使っているけれど念の為バックアップ.

/home

日時バックアップがとれているのでよしとする.

Pin の解除

$ find /etc/apt/ -type f|grep preferences
使ってないのでそのまま.

パッケージ状態の確認

$ sudo dpkg --audit
$ sudo dpkg --get-selections | grep 'hold$'

特に問題は無さそう.

ソースリストの確認

公式だけにする.

$ cat /etc/apt/sources.list
# deb http://ftp.jp.debian.org/debian/ wheezy main

deb http://ftp.jp.debian.org/debian/ wheezy main non-free contrib
deb-src http://ftp.jp.debian.org/debian/ wheezy main non-free contrib

deb http://security.debian.org/ wheezy/updates main contrib non-free
deb-src http://security.debian.org/ wheezy/updates main contrib non-free

ソースリストをJessie に書き換える

$ cat /etc/apt/sources.list
# deb http://ftp.jp.debian.org/debian/ jessie main

deb http://ftp.jp.debian.org/debian/ jessie main non-free contrib
deb-src http://ftp.jp.debian.org/debian/ jessie main non-free contrib

deb http://security.debian.org/ jessie/updates main contrib non-free
deb-src http://security.debian.org/ jessie/updates main contrib non-free

root 権限になる

$ sudo -s

ログの取得開始

# script -t 2 ~mk/Wheezy2Jessie.log

パッケージ情報を更新

# apt-get update

アップグレードに必要な容量を確認する

# apt-get -o APT::Get::Trivial-Only=true dist-upgrade
--snip--
アップグレード: 554 個、新規インストール: 47 個、削除: 2 個、保留: 0 個。
401 MB のアーカイブを取得する必要があります。
この操作後に追加で 33.1 MB のディスク容量が消費されます。
E: Trivial Only が指定されましたが、これは簡単な操作ではありません。

最小アップグレード

# apt-get upgrade
--snip--
アップグレード: 436 個、新規インストール: 0 個、削除: 0 個、保留: 118 個。
270 MB のアーカイブを取得する必要があります。
この操作後に 218 kB のディスク容量が解放されます。
続行しますか [Y/n]? Y
----snip--

アップグレード

# apt-get dist-upgrade
--snip--
アップグレード: 118 個、新規インストール: 47 個、削除: 2 個、保留: 0 個。
131 MB のアーカイブを取得する必要があります。
この操作後に追加で 33.3 MB のディスク容量が消費されます。
続行しますか [Y/n]? Y
--snip--

パッケージの衝突なども発生せず無事アップグレードできた.

ログ終了

# exit

sudo 設定

# visudo
で確認.
必要な権限がなくなっていたりしたら登録する.

※この確認が終わるまでsu 状態から未だ抜けないように

再起動

# reboot

Version 確認

$ cat /etc/debian_version 
jessie/sid
$ uname -a
Linux x61s 3.2.0-4-amd64 #1 SMP Debian 3.2.41-2+deb7u2 x86_64 GNU/Linux

参考URL
– [[http://www.debian.org/releases/wheezy/amd64/release-notes/ch-upgrading.ja.html|第4章 Debian 6.0 (squeeze) からのアップグレード]]

オンラインストレージサービスCopy を試す

オンラインストレージサービスのcopy というものを知りました.
Copy

Linux Client もあるみたい(Linux/Mac/Win/iOS/Android)なので少し試してみました.
#以下のアンカから登録で無料5GB + 紹介ボーナスで5GB = 10GB になります.
https://copy.com?r=WrvHLs
##アカウント登録までは5GB で,アプリ入れてログインするとボーナスの5GB が反映されるみたいです.

copy for Linux をDebian Wheezy に.
ダウンロードして展開,amd64 の実行ファイルを ~/opt/copy にcp して実行.

$ tar xvzf copy_agent-1.28.0657.tgz
$ mkdir -p ~/opt/copy
$ cp -pr copy/x86_64/* ~/opt/copy
$ \rm -rf copy
$ ~/opt/copy/CopyAgent

初回起動時自動起動の設定も自動でされます.
とりあえずこれでOK と思います.
初め全然同期されなかったのですが,一旦サスペンドして復帰したら同期されるようになりました.
もしうまく行かない場合は再起動してみるといいかもしれません.
しばらく試してみようと思います.
#コマンドライン版もあるようなのでまた試してみます.

Debian Squeeze にWP を試しに立ててみる

IMGP8267

ずっとblog 放置してて最近はGoogle+ やPukiwiki にメモしたりしてますがblog もたまに書きたくなって来ました.
ということで,blog を立ち上げてみようかと思います.
先ずはこのblog の為にWP を入れてみたエントリから.

環境

$ cat /etc/debian_version 
6.0.5

導入

$ sudo apt-get install wordpress wordpress-l10n

設定

apache の設定

$ cd /etc/apache2/sites-enabled
$ sudo vi 004-matoken.org
$ sudo git diff 004-matoken.org
diff --git a/apache2/sites-enabled/004-matoken.org b/apache2/sites-enabled/004-matoken.org
index df3c502..1c9f8b7 100644
--- a/apache2/sites-enabled/004-matoken.org
+++ b/apache2/sites-enabled/004-matoken.org
@@ -14,6 +14,13 @@
                allow from all
        </Directory>

+       Alias /blog /usr/share/wordpress
+       <directory /usr/share/wordpress>
+               Options FollowSymLinks
+               AllowOverride Limit Options FileInfo
+               DirectoryIndex index.php
+       </directory>
+
        ErrorLog ${APACHE_LOG_DIR}/error-matoken.org.log

        # Possible values include: debug, info, notice, warn, error, crit,
$ sudo /etc/init.d/apache2 restart

db の作成

DB 名 : wordpress
DB User : wp
DB Password : password

$ mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7158
Server version: 5.1.63-0+squeeze1 (Debian)

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> CREATE DATABASE wordpress;
Query OK, 1 row affected (0.04 sec)

mysql> GRANT ALL PRIVILEGES ON wordpress.* TO wp@localhost IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.22 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.16 sec)

mysql> EXIT
Bye

wordpress の設定

$ cat /etc/wordpress/config-matoken.org.php
<?php                                                                                                                                                 
define('DB_NAME', 'wordpress');                                                                                                                       
define('DB_USER', 'wp');                                                                                                                              
define('DB_PASSWORD', 'password');                                                                                                                 
define('DB_HOST', 'localhost');                                                                                                                       
define('DB_CHARSET', 'utf8');                                                                                                                         
define('DB_COLLATE', '');                                                                                                                             
define ('WPLANG', 'ja');                                                                                                                              
define('WP_HOME', 'https://matoken.org/blog');                                                                                                         
define('AUTH_KEY', 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');                                                                                                                                                         
define('SECURE_AUTH_KEY', 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');                                                                                                                                                  
define('LOGGED_IN_KEY', 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');                                                                                                                                                    
define('NONCE_KEY', 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
?>

https://matoken.org/blog/ にアクセスして設定.

Plugin の導入

WordPress › Markdown on Save Improved « WordPress Plugins

Markdown 記法が使えるようになるPlugin です.

$ cd /tmp
$ wget http://downloads.wordpress.org/plugin/markdown-on-save-improved.2.2.zip
$ cd /usr/share/wordpress/wp-content/plugins
$ sudo unzip /tmp/markdown-on-save-improved.2.2.zip

管理画面の「プラグイン」から Markdown on Save Improved を有効化

その他

パーマリンク設定が有効にならない

rewrite が無効になっているので有効にする

$ sudo a2enmod rewrite
Enabling module rewrite.
Run '/etc/init.d/apache2 restart' to activate new configuration!
$ sudo /etc/init.d/apache2 restart
Restarting web server: apache2 ... waiting .