第三世代 LinkStation ハックキットでハック de 録!!(3)

Debian HS-DHGL

第三世代 LinkStation ハックキット ハック de 録!!を動かす努力をしている。

その3

(2)必要なファイルを探して 第三世代 LinkStation ハックキットのルートファイルシステム側に コピーする。
(3)ハック de 録!!を動作させる。
の続きで、Link de 録!! の管理画面を動作させる。

apache のインストール

Link de 録!! の管理画面は apache で動いているので、 apache をインストールする。
gin:~# apt-get install apache
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package apache is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package apache has no installation candidate
gin:~#
apache じゃないのね。
探す。
gin:~# apt-cache search apache
adzapper - proxy advertisement zapper add-on
alpine - Text-based email client, friendly for novices but powerful
alpine-dbg - Text-based email client's debugging symbols
apache2 - Apache HTTP Server metapackage
apache2-dbg - Apache debugging symbols
apache2-doc - Apache HTTP Server documentation
apache2-mpm-event - Apache HTTP Server - event driven model
apache2-mpm-itk - multiuser MPM for Apache 2.2
apache2-mpm-prefork - Apache HTTP Server - traditional non-threaded model
apache2-mpm-worker - Apache HTTP Server - high speed threaded model
apache2-prefork-dev - Apache development headers - non-threaded MPM
	:
	:
zope-cachefu - suite of Zope products for speeding up Plone
gin:~#
apache2 みたい。
インストールする。
gin:~# apt-get install apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  apache2-mpm-worker apache2-utils apache2.2-common file libapr1 libaprutil1
  libdb4.5 libexpat1 libkeyutils1 libkrb53 libldap-2.4-2 libmagic1
  libmysqlclient15off libpcre3 libpq5 libsqlite3-0 mime-support mysql-common
  openssl openssl-blacklist python python-minimal python2.5 python2.5-minimal
  ssl-cert
Suggested packages:
  www-browser apache2-doc apache2-suexec apache2-suexec-custom krb5-doc
  krb5-user ca-certificates python-doc python-tk python-profiler python2.5-doc
  binfmt-support
The following NEW packages will be installed:
  apache2 apache2-mpm-worker apache2-utils apache2.2-common file libapr1
  libaprutil1 libdb4.5 libexpat1 libkeyutils1 libkrb53 libldap-2.4-2 libmagic1
  libmysqlclient15off libpcre3 libpq5 libsqlite3-0 mime-support mysql-common
  openssl openssl-blacklist python python-minimal python2.5 python2.5-minimal
  ssl-cert
0 upgraded, 26 newly installed, 0 to remove and 0 not upgraded.
Need to get 17.4MB of archives.
After this operation, 47.2MB of additional disk space will be used.
Do you want to continue [Y/n]? y
	:
	:
Enabling module authn_file.
Enabling module authz_host.
Setting up apache2-mpm-worker (2.2.9-10+lenny1) ...
Starting web server: apache2apache2: Could not reliably determine the server's fully qualified domain name, using 192.168.2.43 for ServerName
.
Setting up apache2 (2.2.9-10+lenny1) ...
Setting up ssl-cert (1.0.23) ...
gin:~#

apache のセットアップ

Link de 録!! の管理画面用の httpd.conf が 標準ファームの /etc/apache/httpd8080.conf 。
debian の apache2 の設定は、/etc/apache2/httpd.conf にすればよい。

/etc/apache/httpd8080.conf を /etc/apache2/httpd.conf にコピーする。

gin:~# ls -l /etc/apache
total 36
-rwxr--r-- 1 root root 34153 Jan 16  2007 httpd8080.conf
gin:~# ls -l /etc/apache2/
total 28
-rw-r--r-- 1 root root 10104 Dec  4 02:34 apache2.conf
drwxr-xr-x 2 root root    35 Jan 12 11:17 conf.d
-rw-r--r-- 1 root root   378 Dec  4 02:34 envvars
-rw-r--r-- 1 root root     0 Jan 12 11:18 httpd.conf
drwxr-xr-x 2 root root  4096 Jan 12 11:17 mods-available
drwxr-xr-x 2 root root  4096 Jan 12 11:18 mods-enabled
-rw-r--r-- 1 root root   513 Dec  4 02:34 ports.conf
drwxr-xr-x 2 root root    38 Jan 12 11:17 sites-available
drwxr-xr-x 2 root root    24 Jan 12 11:17 sites-enabled
gin:~# mv /etc/apache/httpd8080.conf /etc/apache2/httpd.conf
gin:~# rmdir /etc/apache
gin:~#

apache の再起動

/etc/apache2/httpd.conf を書き換えたので、apache を再起動する。
gin:~# /etc/init.d/apache2 stop
Stopping web server: apache2We failed to correctly shutdown apache, so we're now killing all running apache processes. This is almost certainly suboptimal, so please make sure your system is working as you'd expect now! (warning).
 ... waiting .
gin:~# /etc/init.d/apache2 start
Starting web server: apache2apache2: Syntax error on line 189 of /etc/apache2/apache2.conf: Syntax error on line 63 of /etc/apache2/httpd.conf: ServerRoot must be a valid directory
 failed!
gin:~#
これぐらいな英語なら私にも読めるぞ。
gin:~# head -63 /etc/apache2/httpd.conf | tail -1
ServerRoot "/usr/local/apache"
gin:~#
やっぱり中身も見ずに丸ごとコピーしたらあかんな。
gin:~# cd /etc/apache2/
gin:/etc/apache2# mv httpd.conf httpd.conf.orig
gin:/etc/apache2# cp httpd.conf.orig httpd.conf
gin:/etc/apache2# vi httpd.conf
	:
	:
gin:/etc/apache2# diff -c httpd.conf.orig httpd.conf
*** httpd.conf.orig     Tue Jan 16 11:34:03 2007
--- httpd.conf  Mon Jan 12 11:39:41 2009
***************
*** 60,66 ****
  # (available at <URL:http://www.apache.org/docs/mod/core.html#lockfile>);
  # you will save yourself a lot of trouble.
  #
! ServerRoot "/usr/local/apache"

  #
  # The LockFile directive sets the path to the lockfile used when Apache
--- 60,66 ----
  # (available at <URL:http://www.apache.org/docs/mod/core.html#lockfile>);
  # you will save yourself a lot of trouble.
  #
! #yasunari     ServerRoot "/usr/local/apache"

  #
  # The LockFile directive sets the path to the lockfile used when Apache
gin:/etc/apache2#
再々再起動。
gin:/etc/apache2# /etc/init.d/apache2 start
Starting web server: apache2Syntax error on line 52 of /etc/apache2/httpd.conf:
Invalid command 'ServerType', perhaps misspelled or defined by a module not included in the server configuration
 failed!
gin:/etc/apache2#
まだあかん。
編集と再起動を何度も繰り返し。たどり着いたのが、、
gin:/etc/apache2# /etc/init.d/apache2 start
Starting web server: apache2 failed!
gin:/etc/apache2#
なにもメッセージがなかったらわからへんやん。

ごそごぞと試行錯誤の上

gin:/etc/apache2# /etc/init.d/apache2 start
Starting web server: apache2.
gin:/etc/apache2#
ようやく起動した。

gin:/etc/apache2# diff -u httpd.conf.orig httpd.conf
--- httpd.conf.orig     2007-01-16 11:34:03.000000000 +0900
+++ httpd.conf  2009-01-12 11:57:00.292755316 +0900
@@ -49,7 +49,7 @@
 # ServerType is either inetd, or standalone.  Inetd mode is only supported on
 # Unix platforms.
 #
-ServerType standalone
+#yasunari      ServerType standalone

 #
 # ServerRoot: The top of the directory tree under which the server's
@@ -60,7 +60,7 @@
 # (available at <URL:http://www.apache.org/docs/mod/core.html#lockfile>);
 # you will save yourself a lot of trouble.
 #
-ServerRoot "/usr/local/apache"
+#yasunari      ServerRoot "/usr/local/apache"

 #
 # The LockFile directive sets the path to the lockfile used when Apache
@@ -77,7 +77,7 @@
 # PidFile: The file in which the server should record its process
 # identification number when it starts.
 #
-PidFile /var/run/apache/httpd.pid
+#yasunari      PidFile /var/run/apache/httpd.pid

 #
 # ScoreBoardFile: File used to store internal server process information.
@@ -85,7 +85,7 @@
 # this file will be  created when you run Apache) then you *must* ensure that
 # no two invocations of Apache share the same scoreboard file.
 #
-ScoreBoardFile /var/run/apache/httpd.scoreboard
+#yasunari      ScoreBoardFile /var/run/apache/httpd.scoreboard

 #
 # In the standard configuration, the server will process httpd.conf (this
@@ -102,26 +102,26 @@
 #
 # Timeout: The number of seconds before receives and sends time out.
 #
-Timeout 300
+#yasunari      Timeout 300

 #
 # KeepAlive: Whether or not to allow persistent connections (more than
 # one request per connection). Set to "Off" to deactivate.
 #
-KeepAlive On
+#yasunari      KeepAlive On

 #
 # MaxKeepAliveRequests: The maximum number of requests to allow
 # during a persistent connection. Set to 0 to allow an unlimited amount.
 # We recommend you leave this number high, for maximum performance.
 #
-MaxKeepAliveRequests 100
+#yasunari      MaxKeepAliveRequests 100

 #
 # KeepAliveTimeout: Number of seconds to wait for the next request from the
 # same client on the same connection.
 #
-KeepAliveTimeout 15
+#yasunari      KeepAliveTimeout 15

 #
 # Server-pool size regulation.  Rather than making you guess how many
@@ -136,14 +136,14 @@
 # a new spare.  If there are more than MaxSpareServers, some of the
 # spares die off.  The default values are probably OK for most sites.
 #
-MinSpareServers 5
-MaxSpareServers 10
+#yasunari      MinSpareServers 5
+#yasunari      MaxSpareServers 10

 #
 # Number of servers to start initially --- should be a reasonable ballpark
 # figure.
 #
-StartServers 4
+#yasunari      StartServers 4

 #
 # Limit on total number of servers running, i.e., limit on the number
@@ -152,7 +152,7 @@
 # It is intended mainly as a brake to keep a runaway server from taking
 # the system with it as it spirals down...
 #
-MaxClients 20
+#yasunari      MaxClients 20

 #
 # MaxRequestsPerChild: the number of requests each child process is
@@ -168,7 +168,7 @@
 #       an initial request and 10 subsequent "keptalive" requests, it
 #       would only count as 1 request towards this limit.
 #
-MaxRequestsPerChild 0
+#yasunari      MaxRequestsPerChild 0

 #
 # Listen: Allows you to bind Apache to specific IP addresses and/or
@@ -238,7 +238,8 @@
 # ports < 1023, you will need httpd to be run as root initially.
 #
 #Port 80
-Port 8080
+#yasunari      Port 8080
+Listen 8080


 #
@@ -257,8 +258,8 @@
 #Group nobody
 #User apache
 #Group apache
-User root
-Group root
+#yasunari      User root
+#yasunari      Group root

 #
 # ServerAdmin: Your address, where problems with the server should be
@@ -266,7 +267,7 @@
 # as error documents.
 #
 #ServerAdmin root@HS-DHTGL-000000005184
-ServerAdmin admin@localhost
+#yasunari      ServerAdmin admin@localhost

 #
 # ServerName allows you to set a host name which is sent back to clients for
@@ -425,9 +426,9 @@
 # TypesConfig describes where the mime.types file (or equivalent) is
 # to be found.
 #
-<IfModule mod_mime.c>
-    TypesConfig /etc/apache/mime.types
-</IfModule>
+#yasunari      <IfModule mod_mime.c>
+#yasunari          TypesConfig /etc/apache/mime.types
+#yasunari      </IfModule>

 #
 # DefaultType is the default MIME type the server will use for a document
@@ -451,9 +452,9 @@
 # This means that the MIMEMagicFile directive will only be processed if the
 # module is part of the server.
 #
-<IfModule mod_mime_magic.c>
-    MIMEMagicFile /etc/apache/magic
-</IfModule>
+#yasunari      <IfModule mod_mime_magic.c>
+#yasunari          MIMEMagicFile /etc/apache/magic
+#yasunari      </IfModule>

 #
 # HostnameLookups: Log the names of clients or just their IP addresses
@@ -463,7 +464,7 @@
 # each client request will result in AT LEAST one lookup request to the
 # nameserver.
 #
-HostnameLookups Off
+#yasunari      HostnameLookups Off

 #
 # ErrorLog: The location of the error log file.
@@ -472,23 +473,23 @@
 # logged here.  If you *do* define an error logfile for a <VirtualHost>
 # container, that host's errors will be logged there and not here.
 #
-ErrorLog /var/log/apache/error_log
+#yasunari      ErrorLog /var/log/apache/error_log

 #
 # LogLevel: Control the number of messages logged to the error_log.
 # Possible values include: debug, info, notice, warn, error, crit,
 # alert, emerg.
 #
-LogLevel warn
+#yasunari      LogLevel warn

 #
 # 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 \"%r\" %>s %b" common
-LogFormat "%{Referer}i -> %U" referer
-LogFormat "%{User-agent}i" agent
+#yasunari      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
+#yasunari      LogFormat "%h %l %u %t \"%r\" %>s %b" common
+#yasunari      LogFormat "%{Referer}i -> %U" referer
+#yasunari      LogFormat "%{User-agent}i" agent

 #
 # The location and format of the access logfile (Common Logfile Format).
@@ -497,7 +498,7 @@
 # define per-<VirtualHost> access logfiles, transactions will be
 # logged therein and *not* in this file.
 #
-CustomLog /var/log/apache/access_log common
+#yasunari      CustomLog /var/log/apache/access_log common

 #
 # If you would like to have agent and referer logfiles, uncomment the
gin:/etc/apache2#
こんなん、どうやってインストーラ化しよう???

管理画面へのアクセス

ブラウザから http://gin.yamasita.jp:8080/ へアクセスしてみた。
Software error:
Can't load 'module/auto/Socket/Socket.so' for module Socket: module/auto/Socket/Socket.so: undefined symbol: PL_sv_undef at module/XSLoader.pm line 70.
 at module/Socket.pm line 399

For help, please send mail to the webmaster ([no address given]), giving this error message and the time and date of the error. 

だと。
module/auto/Socket/Socket.so は存在するのに。。。

そろそろ断念かな。
最近ボツ続きだが、、、生まれも育ちも違う2つをマージするのは簡単ではない。




HS-DHGL
バッファローダイレクト
楽天市場
Yahoo!ショッピング
somap.com
ValuMore!
ムラウチドットコム


第三世代 LinkStation ハックキットでハック de 録!!(2)
ハックの記録
LinkStation/玄箱 をハックしよう

パッケージ

Copyright (C) 2003-2009 Yasunari Yamashita. All Rights Reserved.
yasunari @ yamasita.jp 山下康成@京都府向日市