How to Hack WD My Book Live

My Book Live

 

WD My Book Live is network storage installed with Debian Linux operating system. We can setup this device to be our web server at home. Here are the steps how I did it.

 

SECTION 1

Follow this section 1 if you haven’t upgrade the firmware and you don’t want to use Debian Squeeze. If you just upgraded your My Book Live to latest firmware and you want to use Squeeze, go to Section 2.

 

1. Activate SSH

Open browser, and go to http://device_ip/UI/ssh and then enable SSH service.

2. Login to SSH

username: root
default password: welc0me

3. Backup the system and protect udev update

Backup system:

# dd if=/dev/sda bs=15728640 count=1 | bzip2 > /DataVolume/shares/Public/SDA_MBR_FREESPACE.bz2
# dd if=/dev/sda1 | bzip2 > /DataVolume/shares/Public/SDA1_IMA.bz2
# dd if=/dev/sda2 | bzip2 > /DataVolume/shares/Public/SDA2_IMA.bz2

Protect udev update:

# aptitude hold udev

4. Disable load cycle count

Download idle3 tool from http://mybookworld.wikidot.com/local–files/mybook-live/idle3ctl.tar.gz

# wget http://mybookworld.wikidot.com/local--files/mybook-live/idle3ctl.tar.gz

Extract, execute and reboot.

# tar zxvf idle3ctl.tar.gz
# ./idle3ctl -d /dev/sda
# reboot

5. Install mysql-server

Comment out debian squeeze references from packaging list

# sed -ie "s/deb .* squeeze/#&/g" /etc/apt/sources.list

Update aptitude and install mysql

# apt-get update
# apt-get install mysql-server mysql-client php5-mysql

Create symlink of /etc/init.d/mysql in /etc/rc2.d/ to autostart the mysql server

# ln -s /etc/init.d/mysql /etc/rc2.d/

Initialize mysql data dir and create system tables

# mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql

Restart apache

# /etc/init.d/apache2 restart

6. Create apache virtual host

Go to apache vhost folder:

# cd /etc/apache2/sites-available/

Copy current vhost configuration file:

# cp wdnas mywebsite

Edit mywebsite vhost file:

# nano mywebsite

Modify to the following:

<VirtualHost *:80>
ServerName mywebsite.mooo.com
ServerAlias www.mywebsite.mooo.com
ServerAdmin webmaster@localhost

DocumentRoot /DataVolume/shares/mywebsite/

<IfModule mod_rewrite.c>
RewriteLog /var/log/apache2/rewrite.log
RewriteLogLevel 0

RewriteEngine On

</IfModule>

<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>

<Directory /DataVolume/shares/mywebsite/>
Options -Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

ErrorLog /var/log/mywebsite_error.log

LogLevel warn

</VirtualHost>

Create document root folder:

# mkdir /DataVolume/shares/mywebsite

Enable virtual host file:

# a2ensite mywebsite

Restart apache:

# /etc/init.d/apache2 restart

7. Create your domain mywebsite.mooo.com using free DNS service by afraid.org. Follow this article on step no. 4, 5, 6.

8. Make cron running when in standby mode

Kill monitorio.sh script:

# killall monitorio.sh
# nano /usr/local/sbin/monitorio.sh

Comment out the following line:

#/etc/init.d/cron start > /dev/null
#/etc/init.d/cron stop > /dev/null

9. You can access your website at http://mywebsite.mooo.com. My Book Live UI also available at http://device_ip

 

SECTION 2

Use this section if you are just upgrading your My Book Live to latest firmware.

 

1. Activate SSH

Open browser, and go to http://device_ip/UI/ssh and then enable SSH service.

2. Login to SSH

username: root
default password: welc0me

3. Backup the system and protect udev update

Backup system:

# dd if=/dev/sda bs=15728640 count=1 | bzip2 > /DataVolume/shares/Public/SDA_MBR_FREESPACE.bz2
# dd if=/dev/sda1 | bzip2 > /DataVolume/shares/Public/SDA1_IMA.bz2
# dd if=/dev/sda2 | bzip2 > /DataVolume/shares/Public/SDA2_IMA.bz2

Protect udev update:

# aptitude hold udev

4. Disable load cycle count

Download idle3 tool from http://mybookworld.wikidot.com/local–files/mybook-live/idle3ctl.tar.gz

# wget http://mybookworld.wikidot.com/local--files/mybook-live/idle3ctl.tar.gz

Extract, execute and reboot.

# tar zxvf idle3ctl.tar.gz
# ./idle3ctl -d /dev/sda
# reboot

5. Install mysql-server

Update aptitude and install mysql

# apt-get update
# apt-get install mysql-server mysql-client php5-mysql

Create symlink of /etc/init.d/mysql in /etc/rc2.d/ to autostart the mysql server

# ln -s /etc/init.d/mysql /etc/rc2.d/

Initialize mysql data dir and create system tables

# mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql

Restart apache

# /etc/init.d/apache2 restart

6. Create apache virtual host

Go to apache vhost folder:

# cd /etc/apache2/sites-available/

Copy current vhost configuration file:

# cp wdnas mywebsite

Edit mywebsite vhost file:

# nano mywebsite

Modify to the following:

<VirtualHost *:80>
ServerName mywebsite.mooo.com
ServerAlias www.mywebsite.mooo.com
ServerAdmin webmaster@localhost

DocumentRoot /DataVolume/shares/mywebsite/

<IfModule mod_rewrite.c>
RewriteLog /var/log/apache2/rewrite.log
RewriteLogLevel 0

RewriteEngine On

</IfModule>

<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>

<Directory /DataVolume/shares/mywebsite/>
Options -Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

ErrorLog /var/log/mywebsite_error.log

LogLevel warn

</VirtualHost>

Create document root folder:

# mkdir /DataVolume/shares/mywebsite

Enable virtual host file:

# a2ensite mywebsite

Restart apache:

# /etc/init.d/apache2 restart

7. Create your domain mywebsite.mooo.com using free DNS service by afraid.org. Follow this article on step no. 4, 5, 6.

8. You can access your website at http://mywebsite.mooo.com. My Book Live UI also available at http://device_ip

 

Reference: http://mybookworld.wikidot.com/mybook-live

 

Keywords:

  • my book live hack
  • mybook live hack
  • wd my book live hack
  • my book live hacks
  • hack my book live
  • hacking my book live
  • mybook live hacking
  • hacking wd my book live
  • hack mybook live
  • mybook live hacks

Related posts:

  1. How to Replace Old Domain URL in wp_posts Table
  2. Distributed ColdFusion MX and IIS
  3. Read to Them A Book

Filed Under: FeaturedLinuxNetworkingTechnologyTips and TricksTutorial

RSSComments (22)

Leave a Reply | Trackback URL

  1. elmany says:

    Hi,

    Can this be done in an already updated WD MyBook Live 2Tb?
    I want to use it to host my web page while I learn to program and to configure PostFix mail server

    • kumkum says:

      Hi, elmany. Yes, as long as you can get root login, you can setup your web server on it. Let me know if you need any help.

  2. ubuntu says:

    Is it normal that the 3. step takes over an hour ?

  3. chkstar says:

    When I attempt to do the apt-get install mysql-server mysql-client php5-mysql I get the following:
    Reading package lists… Done
    Building dependency tree
    Reading State information… Done
    Note, selecting mysql-server-5.0 instead of mysql-server
    Package mysql-server-5.0 is not available, but is refferred to by another package.
    This may mean that the package is missing, has been obsoleted, or is only available from another source
    E: Package mysql-server-5.0 has no installation candidate

    Its a MyBook Live 2TB and all the commands prior worked fine. Any ideas on how to get this to work?

  4. Alex says:

    Can somebody send me original vhost configuration file, that was copied on step 6? I lost it :-(
    My mail is mr.fomos@gmail.com. Thanks.

  5. Karl says:

    Hi!
    How do I reste MyBook to it’s original state after doing all of this (I am tryin gto learn more about Debian OS etc. hacking).

  6. the_lumpster says:

    I am not using any of the other features of my 3rd generation MBL except the share creation. I need access to the share through a mapped drive, which has been accomplished in setup, but I also want intranet web access to the share for music and video streaming that needs to be able to see directories and files i.e. ht tp ://192.168.1.100/Media/ to give a listing of files and folders in the media share folder, without any authentication. I am ok with disabling the UI through SSH and only turning it on when needed.

    • joboborab says:

      I needed the same thing. This is how I did it.

      ‘set up a share using UI’

      ‘go to http://device/UI/ssh to enable ssh’

      ‘ssh in’
      Username root
      Password welc0me

      cd /etc/apache2/sites-available/
      nano webshare
      ‘add this to the file and save’

      ServerAdmin webmaster@localhost

      DocumentRoot /DataVolume/shares/

      RewriteLog /var/log/apache2/rewrite.log
      RewriteLogLevel 0

      RewriteEngine On

      Options FollowSymLinks
      AllowOverride None

      Options Indexes FollowSymLinks MultiViews
      AllowOverride None
      Order allow,deny
      allow from all

      ErrorLog /var/log/mywebsite_error.log

      LogLevel warn

      cp wdnas wdnasbakup
      cp webshare wdnas
      a2enmod autoindex
      /etc/init.d/apache2 restart

      That’s it. Remember that your share is case sensitive.

      • joboborab says:

        That just derped all my code for the webshare file, but it is the same as the tutorial, with the directory pointing to DataVolume/shares/ instead of DataVolume/shares/mywebsite

  7. Mark says:

    Got apache and php successfully working (able to display a page with .

    However, having trouble with mysql. Specifically, the mysql_install_db command fails with the following:

    —–

    # mysql_install_db –user=mysql –basedir=/usr –datadir=/DataVolume/www/mysql_data
    Installing MySQL system tables…
    ERROR: 1 Can’t create/write to file ‘/DataVolume/www/mysql_data/mysql/db.MYI’ (Errcode: 13)
    120425 21:42:26 [ERROR] Aborting

    120425 21:42:26 [Note] /usr/sbin/mysqld: Shutdown complete

    —–

    Installation of system tables failed! Examine the logs in
    /DataVolume/www/mysql_data for more information.

    I checked permissions of mysql_data and the owner is mysql with group root. Attempted setting permissions to 777 with no success.

    Any ideas?

    • kumkum says:

      Hi, Mark.
      Can you check mysql log for any error message?
      Maybe can check on /DataVolume/www/mysql_data or /var/log

Leave a Reply




If you want a picture to show with your comment, go get a Gravatar.