Page 1 of 13 12311 ... LastLast
Results 1 to 15 of 188

Thread: [HowTo] Get a HeadStart on a WL-500gP

  1. #1

    Lightbulb [HowTo] Get a HeadStart on a WL-500gP

    Hi, I've released a new version of this system image: HeadStart II
    this one runs under oleg's latest firmware:v1.9.2.7-10
    read on here: http://www.wl500g.info/showthread.ph...117#post112117 how to install it.


    As of now, the old images of the system are not available anymore.


    Since I've became an owner of this device (june/july 2007) I've always been browsing this board on how to get the most out of this machine. Now it's my time to do something back for the board, specifically new users, to give them a headstart.

    That's why I created something like a 'system-image' of a setup with 'basic-needs' running on a asus wl500gp with oleg's (1.9.2.7-8, 1.9.2.7-7g should also work) firmware installed.



    In short: How to get it running?
    1) meet the prerequisites before actually continueing this setup
    2) download the opt.tar.gz package which is needed to setup/replace the '/opt' part on your asus
    3) download the mnt.tar.gz package which is needed to setup/replace the '/mnt' part on your asus
    4) configure to your needs (like other passwords, download/web folders)
    5) read about what you you have installed and how to use it.
    6) enjoy !

    What is in the package?

    central network attached storage device where files are hosted which are used by a wide variety of devices in my home.
    automatic newsgroup and bittorrent downloader
    website to host a website and share (secure) files stored on as if on home network

    Software/tools

    • samba2 with swat (to work with windows filesharing, vista included.)
    • lighttpd webserver with php and mysql support running a version of simpleCMS (with a password protected directory, and choice of running http or https protocol)
    • hellanzb with zussaweb webinterface (to download,verify,unpack binaries from newsservers)
    • Transmission (BitTorrent Downloader)
    • mysql database with myphpadmin (included in AIOCP)
    • Wake On lan application (password protected) with which you can remotely turn-on your pc's at home (if pc-hardware supports)
    • tuned system to get a good and acceptible response on any service regardless of heavy load. (with the use of nice)
    • cron
    • etc. etc. for a complete list of installed packages see the attached file.


    Prerequisites:
    oleg's firmware installed. (at the moment I have running: WL500gp-1.9.2.7-8 version and can confirm it also runs on WL500gp-1.9.2.7-7g))
    a hard drive (with 3 partitions: /opt (system), /mnt (data), and a swap, the tutorial uses these mounting points. if you want to leave your own mounting points intact in the post-boot file, you have to change the configuration files for the various services which are included in this setup and the extraction of the mnt.tar.gz package might fail.)
    post-boot file in which mounting of partitions is done. (mine is attached, use it for reference, but tune to your own needs).


    Need to knows:
    I have never changed my ip of the asus (192.168.1.1) so this setup assumes that address.
    I am running in Access Point only mode, I have no experience with the other settings so I can't answer questions about that. (configure this in the basic asus setup http://192.168.1.1)
    The name of my device is: NAS (Not that I know of it has be configured in this setup, but should you run into something, which I doubt, then this of NAS as the name of the device in the system setup of the basic asus setup http://192.168.1.1)


    Backup your current system:
    If you have nothing setup op on your asus already or do no wish to keep what's installed, skip this step and continue to the next step System/Harddisk preparation without a backup of your current /opt

    2 different ways to try this asus headstart

    • just use an old harddisk, even an old 10gb will do to test this image
      (You will have to backup your post-boot file though !!!)
    • backup your current /opt according to the following steps.
      edit post-boot file to NOT start services on startup (a lot of services don't like being archived when they are running.)
      use your favorite text editor (nano/vi) and edit the following file according to the steps below.
      Code:
      /usr/local/sbin/post-boot
      do as below and comment-out the line to start the services in the post-boot file
      Code:
      # Run all active services - active means starts with S
      #/opt/etc/init.d/rc.unslung
      write file and flash/reboot
      Code:
      flashfs save && flashfs commit && flashfs enable && reboot
      login to console again and create a backup of /opt to /mnt/opt.tar.gz with the following command:
      Code:
      tar -cvzf /mnt/opt.tar.gz /opt
      (or other location if you have your datafile not mounted to /mnt)
      (this process takes quite some time if you have a lot installed. if you have also data (audio/video, I would not recomend it. 370mb of /opt takes 70+ minutes.))

      now, enable the services in the post-boot file like you disabled them above by uncommenting the line you commented before.
      enable the services on bootup in:
      Code:
      /usr/local/sbin/post-boot
      do as below and uncomment the line to start the services in the post-boot file
      Code:
      # Run all active services - active means starts with S
      /opt/etc/init.d/rc.unslung
      write file and flash/reboot
      Code:
      flashfs save && flashfs commit && flashfs enable && reboot
      now you have access to your share again save this opt.tar.gz on /mnt file to another computer/network share. not on the asus.
      THIS IS YOUR BACKUP OF YOUR CURRENT SYSTEM !!!


    System/Harddisk preparation:
    next step is only to be taken for new users or if you don't have created the 3 partitions already. If you already have the 3 partitions continue to the next step.

    For this step I must redirect you to the first steps ( 1,2,3,4a,4b) of the excellent tutorial written by wengi on how to setup and install oleg's firmware: http://www.wl500g.info/showthread.php?t=10307
    (i can copy all those steps here, but I couldn't have done a better job on it than wengi, thanks wengi/oleg, you guys figure it all out, 'i just put stuff toghether')

    Now that you've completed the first steps of wengi's setup, we're going to make a small change in post-boot file you've created in his setup: The data directory in wengi's setup mounts to /tmp/harddisk. this has to be changed to /mnt.

    open the post boot script at
    Code:
    /usr/local/sbin/post-boot
    and change the line: (where part3 is your data partition, if it's not, change it)
    Code:
    mount /dev/discs/disc0/part3 /tmp/harddisk

    to (where part3 is your data partition, if it's not, change it)
    Code:
    mount /dev/discs/disc0/part3 /mnt

    write file and flash/reboot
    Code:
    flashfs save && flashfs commit && flashfs enable && reboot
    I decided to mount to /mnt because it was easier for the system image and /tmp sound to 'temporary' to me that's why /mnt (mounted).

    Now that you've learned how to access the router and issue the commands, it's time to move on to the next step.



    System/Harddisk preparation (continued):
    edit post-boot file to NOT start services on startup (a lot of services don't like being archived when they are running.)
    use your favorite text editor (nano/vi) and edit the following file according to the steps below in:
    Code:
    /usr/local/sbin/post-boot
    do as below and comment-out the line to start the services in the post-boot file
    Code:
    # Run all active services - active means starts with S
    #/opt/etc/init.d/rc.unslung
    write file and flash/reboot
    Code:
    flashfs save && flashfs commit && flashfs enable && reboot
    Now, skip below and continue to "Install the HeadStart 'system-image'" If you are continueing after just making a backup of your current system you have to take the next step.
    because we're installing a new system, it wouldn't hurt to 'flush' the old one, so nothing gets mixed up. (that's why we've created the backup in the step before.)
    unmount all current mounted partitions with umount
    Code:
    umount /opt
    (to view how partitions are mounted, use the df command.)

    open fdisk
    Code:
    fdisk /dev/discs/disc0/disc
    delete your current /opt partition.
    recreate the partition again with the same parameters.
    (exit with w)

    create the filesystem for /opt
    Code:
    mke2fs -j /dev/discs/disc0/part1
    (where /dev/discs/disc0/part1 is your /opt partition, if you have your /opt partition on another partion, change the command to the partition you are using!)
    reboot


    Install the HeadStart 'system-image':

    The parts below are no longer valid ! read on in this reply on this topic

    http://www.wl500g.info/showthread.ph...117#post112117


    log on to your router and download system file to /mnt (77,5MB)
    extract the file to /opt
    Code:
    cd /
    tar -xvzf /mnt/opt.tar.gz
    - sit back and wait (get a beer, takes 4 minutes or so)



    Install the webapplications and directory structure:
    download dir structure and web file to /opt (10,5MB)
    extract the file to /mnt
    Code:
    cd /
    tar -xvzf /opt/mnt.tar.gz
    - sit back and wait (get another beer :-), takes 3 minutes or so)

    enable the services on bootup in:
    Code:
    /usr/local/sbin/post-boot
    do as below and uncomment the line to start the services in the post-boot file
    Code:
    # Run all active services - active means starts with S
    /opt/etc/init.d/rc.unslung
    write file and flash/reboot
    Code:
    flashfs save && flashfs commit && flashfs enable && reboot

    Read on in the next reply how to configure things.
    Attached Files Attached Files
    Last edited by raas; 10-10-2008 at 12:33. Reason: new version, old version unsupported.

  2. #2
    Configure to your needs:
    login and change the passwords as in the following.
    (actually, the login and password I used in the system image is admin/asus,
    except for the swat login, which uses the password you've entered in your device through the standard web interface.)

    for mysql use console, login into mysql using:
    Code:
    mysql -u root -p mysql
    -password is asked: asus

    then at mysql prompt, issue following command:
    Code:
    update user set password=PASSWORD("asus") where User='root';
    (Where you replace "asus" with your new password)

    exit mysql console by entering
    Code:
    exit
    reboot your system
    Code:
    reboot
    login and in the following file, change the password so that your mysql login for phpmyadmin works.
    Code:
    /mnt/AIOCP/admin/phpMyAdmin/config.inc.php
    (line 73)

    And for AIOCP
    Code:
    /mnt/AIOCP/shared/config/cp_db_config.php
    (line 47)


    The user for AIOCP can be changed in the web-gui
    http://192.168.1.1:8082/AIOCP and click the administration panel link (login:admin, pass:asus)

    You have to change the password for the protected web directory (/mnt/protected) in
    Code:
    /opt/etc/lighttpd/.lighttpdpassword
    (if you change anything in this file, you have to run the following command:
    Code:
    /opt/etc/init.d/S80lighttpd restart
    )


    You have to setup your newsserver for HellaNZB in the following file:
    Code:
    /opt/etc/hellanzb.conf
    Transmission is running, but can be configured by:
    Code:
    /opt/etc/transmission.conf
    (if you change anything in this file, you have to reboot)

    Samba is running and can be configured by:
    Code:
    /opt/etc/samba/smb.conf
    and: http://192.168.1.1:901 (this UI uses the password you have entered in your device, instead of the 'asus' password which is used in the config-files above.)

    Webserver (root dir and protected folders, as well as cgi/php implementation can be changed here:
    Code:
    /opt/etc/lighttpd/lighttpd.conf

    Well, congratulations, if you're at this point and all went well you're actually ready with the HeadStart installation! Read the next part on how to use it.




    What did I get and how do I use it:
    I recommend a reboot when you're reading this, this way you make sure all the services are correctly started after you have configured them. In the meantime, you can read along what this system install has installed and how to use it.


    • Samba2, The network share service (connect with your (window$) PC)
      Samba is pretty standard configured.
      On the disk, you have 2 partitions to store programs (/opt) and data (/mnt) these are also writable shares in Samba. In a windows environment (I used WORKGROUP, can be configured with swat http://192.168.1.1:901, name of device is NAS) it would show up as:

      -Microsoft Windows Network
      ___Workgroup
      ______Nas
      _________mnt
      _________opt

      Both shares are writeable, I reccommend writing your data to /mnt (look at the expanded directorystructure by using your pc.) The access to /opt is just there to give you a quick-ref to your program directory without login into your console.

    • lighttpd webserver
      This webserver is configured to run on port 8082 so you can access it here: http://192.168.1.1:8082
      Right now, there are 2 content management systems installed. CMSSimple (standard) and AIOCP
      The webserver has php and mysql support. AIOCP uses the mysql database, CMSSimple does not, it's a straight-forward content management system which only uses 'flat-files'. I decided to do so because it's very light. And if you do a lot of downloading with this machine, mysql response can be slower. And I still wanted to have a 'fast' website in this setup. But you can change to your own needs.
      Also, I know this is going to be a point of discussion: the root of the webserver is /mnt (!)
      I did this because in this setup I wanted a 'open-mind' towards accesibility of your files.
      however. the files in /mnt/protected are password protected from the web, so there is security. If you don't like it, simply change the root dir of the webserver to /mnt/cms or /mnt/AIOCP in /opt/etc/lightpd/lighttpd.conf

      Standard the webserver runs on the http protocol, but https is also supported. A certificate is installed on the system, and this should work.
      In order to run the https protocol instead of the http protocol go to /opt/etc/lighttpd and create a backup of lighttpd.conf and rename lighttpd.conf.ssl to lighttpd.conf
      Then restart your webserver with:
      /opt/etc/init.d/S80lighttpd restart

      You already know how to change the password/users and password protected directories, so configure to your needs.

    • phpMyAdmin
      commenly known web application to control your mysql database. found here http://192.168.1.1:8082/AIOCP/admin/...dmin/index.php
      (user:admin pass:asus, or the other password your set in /opt/etc/lighttpd/.lighttpdpassword)

    • Transmission (BitTorrent Downloader)
      runs in the background.
      Simply put your torrent files in /mnt/protected/Transmission/source and download should start in the background.
      downloads can be configured with WebUI, found here http://192.168.1.1:8082/cgi-bin/transmission.cgi

    • HellaNZB
      Well, there are 2 small issues with this one.
      1) it doesn't start on itself after the router reboots. (start with: /opt/bin/startHellaNZB)
      2) it doesn't download anymore after more than 24h of inactivity.
      However, I've downloaded TB's with this application and i'm very please how well it downloads, verifies and extracts my downloads. That's why I've included this one in the package.
      In my opinion it's workable, because when your are collecting your nzb files, your at your machine. A simple reboot/restart of HellaNZB to get it to download again can be executed then.
      Once you've started HellaNZB with /opt/bin/startHellaNZB, you can access zussaweb WebUI in order to control HellaNZB at http://192.168.1.1:8082/protected/zussaweb/
      After starting HellaNZB, simply put your nzb's in /mnt/protected/HellaNZB/nzb/daemon.queue and download will start.

    • Wake-On-Lan Application.
      If the website running on the asus is accessible from the internet, and if your pc supports WOL and is enabled, and if you've entered the correct MAC-address in /mnt/cgi-bin/wol.cgi then you're able to wake up your machine from anywhere on the internet.
      Point your browser to http://192.168.1.1:8082/cgi-bin/wol.cgi and your machine should boot up.

    • There are other (console) utilities installed and also AIOCP http://192.168.1.1:8082/AIOCP has a lot of tools inside.



    Well, that's about it.

    Because this is my first how-to on this asus, there's still a change there might be a flaw. don't hesitate to mention/ask.

    Good luck, and I hope you enjoy it.

    Raas.
    Last edited by raas; 04-02-2008 at 12:50. Reason: layout

  3. #3
    Join Date
    Sep 2007
    Location
    Canada
    Posts
    15

    Problem

    Hi there,

    I was following your guide but when I tried downloading your image I ran in an error... Any idea what I should do to continue?
    [admin@(none) /mnt]$ wget http://dhost.info/raas/opt.tar.gz
    wget: opt.tar.gz: Read-only file system


    Thanks in advance!

  4. #4
    Join Date
    Sep 2007
    Location
    Canada
    Posts
    15

    Talking It's me again

    Sorry, somehow I managed to solve the problem but now I'm stuck again
    I'm trying to change the mysql password (as far as I can tell you) but after I enter [B]asus/B] as my password I get an error...
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

    Any idea what this means?

    Thanks in advance...

  5. #5
    Hi,

    I think your services are not running.
    Have you checked your post-boot script?

    following lines should be uncommented.
    Code:
    # Run all active services - active means starts with S
    /opt/etc/init.d/rc.unslung
    Edit:
    Yes, I just was able to replicate your error.
    If your don't start the services like above, after entering your password, you will get this error message.
    Don't forget to flash post-boot to the memory after editing.
    Last edited by raas; 02-02-2008 at 18:38.

  6. #6
    Join Date
    Sep 2007
    Location
    Canada
    Posts
    15

    No luck

    actually the line is uncommented, and I still get the same error... any other ideas?

  7. #7
    hi,

    I still have the idea the services aren't running.
    Are you able to start mysql manually using the following code?

    Code:
    /opt/etc/init.d/S70mysqld start
    If the command above reports success, then your services aren't started at startup, and something might be wrong with the post-boot file. (can you post that one here?)

    It's weird. I've done this tutorial 3 times in a row before posting it, and it worked every time.

  8. #8
    Join Date
    Sep 2007
    Location
    Canada
    Posts
    15

    Hmmm

    I tried starting mysql with the /opt/etc/init.d/S70mysqld start command and I got an error
    [admin@(none) root]$ /opt/etc/init.d/S70mysqld start
    Starting MySQL................................... ERROR!

    Here's what I have in my post-boot file.

    #!/bin/sh

    dropbear
    # if USB disc has been attached
    # if not - then insert needed modules
    #
    # uncoment the following 4 lines if using an USB HDD.
    if [ ! -d /dev/discs ]
    then
    insmod scsi_mod && insmod sd_mod && insmod usb-storage && sleep 5s
    fi

    #Wait for /opt to mount
    mount /dev/discs/disc0/part2 /opt
    i=0
    while [ $i -le 30 ]
    do
    if [ -d /opt/etc ]
    then
    break
    fi
    sleep 1
    i=`expr $i + 1`
    done

    mount /dev/discs/disc0/part3 /mnt


    # Activate swap
    swapon /dev/discs/disc0/part1

    # Run all active services - active means starts with S
    /opt/etc/init.d/rc.unslung
    echo "192.168.2.1" > /etc/resolv.conf

    What do you think?

  9. #9
    So mysql service won't start. I don't see why.

    When you try to start mysql with /opt/etc/init.d/S70mysqld start it creates a file 'mysql.sock' on /tmp through which it connects.

    could you take a look at what this /tmp contains in your setup?
    (
    cd /tmp
    ls
    )

    by giving the mount command, you can see what's mounted.. in my case this /tmp contains the memory (or even swap) if I'm not mistaken,

    below the contents of my mount output.

    Code:
    /dev/root on / type squashfs (ro)
    none on /dev type devfs (rw)
    proc on /proc type proc (rw)
    ramfs on /tmp type ramfs (rw)
    usbfs on /proc/bus/usb type usbfs (rw)
    /dev/discs/disc0/part1 on /opt type ext3 (rw)
    /dev/discs/disc0/part3 on /mnt type ext3 (rw)
    your post-book looks fine to me.
    could you also confirm that your swap is working? you can do this with the free command. it should give you a summary about it's internal memory and swap status.

    Code:
    [admin@NAS /tmp]$ free
                 total       used       free     shared    buffers     cached
    Mem:         30084      19348      10736          0       3080      10264
    -/+ buffers/cache:       6004      24080
    Swap:       506036          0     506036
    Also, do other services start or not? like the webserver on http://192.168.1.1:8082

    One last question, what firmware do you run? I see in your post-boot that you're adding a nameserver to the system, I can only confirm that the setup works on the current (8) version and the previous (-7g) one.

    edit:
    thinking that the archive on my host could be corrupt, i did the installation with the file from the host. It worked.
    You sure that you're working with an empty /opt from the start? as i saw in wengi's thread that you were installing software at the same time. No rant or something, just want to help you out, and make this tutorial better.
    Last edited by raas; 03-02-2008 at 11:10.

  10. #10
    Join Date
    Sep 2007
    Location
    Canada
    Posts
    15

    Hi again

    The reason I was posting in wengi's tutorial is because I have two external hdds and I was playing with both (whichever gave me result faster...)

    Anyways, I did everything over and I ended in the same spot
    Here's what's in /mnt:
    [root@(none) root]$ cd /tmp
    [root@(none) /tmp]$ ls
    dnsmasq.log harddisk nas.lan.pid ppp udhcpc0.expires
    etc local nas.wan.conf resolv.conf var
    filter_rules nas.lan.conf nat_rules udhcpc

    Here's the output of mount
    [root@(none) /tmp]$ mount
    /dev/root on / type squashfs (ro)
    none on /dev type devfs (rw)
    proc on /proc type proc (rw)
    ramfs on /tmp type ramfs (rw)
    usbfs on /proc/bus/usb type usbfs (rw)
    /dev/discs/disc0/part2 on /opt type ext3 (rw)
    /dev/discs/disc0/part3 on /mnt type ext3 (rw)

    ...and of free
    [root@(none) /tmp]$ free
    total used free shared buffers cached
    Mem: 30084 29404 680 0 3004 14956
    -/+ buffers/cache: 11444 18640
    Swap: 500712 0 500712

    The webserver starts...
    I upgraded to the latest firmware and removed the nameserver reference from the post-boot file.
    Any other idea?
    Thanks for your time

  11. #11
    Damn...

    all looks exactly the same as it does at my install.

    I will have to take a look at the mysql installation, I don't have an answer ready right now.


    In a couple of days I'm going to meet a friend who has also a wl500premium.
    I will take a look at what happens when I install this image onto his machine.

    Anyway, I'm happy it only affected the mysql installation, and that the rest is running, but it is not as it was intended.

    I will get back to you.

    edit, the problem is that I can't replicate the behaviour of your machine, so I have to assume some thing in the setup. anyway... I'm working on it.

  12. #12
    Hi,

    The only thing I can think of is that on my system I used root once in order to get mysql installed. this was then changed back to admin.

    however. some things might have altered, like root having sufficient rights to /tmp as mysql runs under user:root pass:asus.

    to change the user of the asus device (admin) login to the original administration website on http://192.168.1.1 system setup / change name.

    change admin into root. save settings and reboot.

    try to login into telnet/ssh on to your asus using user root, with the same password it had for admin before you changed the user.

    See if mysql starts.

    if it starts, try to change the user root into admin again, using the original administration website on http://192.168.1.1 .

    This info was taking from lucaspr's reply on the following thread: http://www.wl500g.info/showthread.php?t=8236 which i used to install mysql.

    the only thing I did in another way was changing the name with the webinterface instead of with the code supplied in his howto.

    When I had installed mysql I changed the name back from root to admin, but the mysql keeps running under root, that's why I didn't think it would affect the image, but it just might do that.

    HTH

  13. #13
    Hi gixie,

    I took another approach today.

    Instead of just installing the /opt and /mnt packages, I started from scratch.
    (thinking that something in the mysql installation would have 'nested' itself into the flash.)

    So I backup up the settings.
    Set it to default settings.
    Installed oleg's latest firmware.
    Followed wengi's setup step 1,2,3,4a,4b.
    And continued this howto.

    (took me 1,5 hr total)

    Without doing anything to the system, mysql just runs, i didn't have to do anything with the root user at all.

    I hope there's someone else who can confirm this.

  14. #14
    Join Date
    Dec 2007
    Location
    The Netherlands - Eindhoven
    Posts
    1,767
    Quote Originally Posted by raas View Post
    hi,

    I still have the idea the services aren't running.
    Are you able to start mysql manually using the following code?

    Code:
    /opt/etc/init.d/S70mysqld start
    If the command above reports success, then your services aren't started at startup, and something might be wrong with the post-boot file. (can you post that one here?)

    It's weird. I've done this tutorial 3 times in a row before posting it, and it worked every time.

    You need to change the login-name into "root"
    goto: system setup -> change name

    Also you need to set a host name.
    goto: ipconfig -> wan & lan
    really easy but essential for mysql

  15. #15
    Hi wpte,

    thanks for your reply.

    I only needed to do this while installing the mysql package, after installation I changed root back to admin.

    admin is now main login on the router, but the mysql keeps running under root.

    When I flashed my router with the latest oleg firmware, and only installed this package, I didn't need to change the user to root at all.

    mysql just runs under root.

    Well, maybe I get to meet up with a friend of mine finally so I can try this on his asus.

Page 1 of 13 12311 ... LastLast

Similar Threads

  1. Alle Howto's, all howto's
    By newbiefan in forum German Discussion - Deutsch (DE)
    Replies: 17
    Last Post: 29-03-2013, 13:57
  2. [Howto] Install hddtemp
    By Denmike in forum WL-500gP Tutorials
    Replies: 11
    Last Post: 26-02-2012, 06:46
  3. Compiling [need HowTo]
    By FilimoniC in forum WL-500g Q&A
    Replies: 20
    Last Post: 16-05-2011, 21:40
  4. HowTo: Use Palm as 500gP LCD
    By Tamadite in forum WL-500gP Tutorials
    Replies: 1
    Last Post: 08-02-2009, 21:18
  5. [HOWTO] WL-HDD + Dbox2
    By akbor in forum German Discussion - Deutsch (DE)
    Replies: 14
    Last Post: 07-02-2008, 20:05

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •