HeadStart II tutorial for oleg 1.9.2.7-10
Hi,
Since I've created the HeadStart image for the asus wl500g Premium and oleg released it's v 1.9.2.7-10 version of the firmware I discovered the original HeadStart image didn't work with oleg's new firmware.
After receiving comments (by pm and by answering to the thread) and britnet making this thread sticky (thanks!) I thought it was time to release a new image which supports oleg'sv 1.9.2.7-10 firmware, having a smaller footprint and supporting more (web) packages.
So here it is: HeadStart II image, which works with oleg's firmware v 1.9.2.7-10 .
What is in the package?
A lot, at least to provide the same functionality as would the original firmware (package) would bring, and a lot more.
- Automatic downloading system (providing a replacement for 'Asus Download Master' with ADOS
- BitTorrent Downloader (Transmission)
- Binary Newsgroup Downloader (HellaNZB)
- PHP webserver (lighttpd)
- MySQL Database with phpmyadmin support
- Samba2 (Basic setup for (windows) networking)
- Wake-On-Lan-Application
- Webapplications (like: mp3database (with a few very small mp3s to show tag-support), photo-album (with some pictures of the asus), content management system, AIOCP, filebrowser)
prerequisites?
yes.
- an asus wl500g premium device and a harddrive. (Duh)
- followed wengi's excellent tutorial exactly until and including step 4b.
- (if you're running in Access Point Only mode, like me, you have so set a nameserver in resolv.conf)
- Make sure your device has a 'hostname' (to be set in asus 'original' router setup webpages), otherwise, MySQL gets into trouble.
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)
How to use this tutorial:
In this tutorial you'll have to change, download and extract items by giving certain commands and changes according to example(s) which are given in this tutorial. Furthermore, the tutorial first explaines a step what we're going to do and then supplying to the exact piece of code you have to execute. When you have to execute code (marked with 'Execute'), the code will be displayed in a special code window and, in some cases, be followed by example(s) of code (marked with 'Example'), if you have to change according to the example.
Let's start!
Step 1.
I couldn't have done a better job than WENGI. (Thanks man!)
Follow step 1 to 4b exactly from the excellent tutorial made by WENGI (found here: http://www.wl500g.info/showthread.php?t=10307). If you read Step5: IPKG, stop, and continue this tutorial.
Step 2.
Wengi uses a different mounting point for the data partition. In order for the HeadStart II image to work properly, we have to change the mounting point of the data partition (the 3rd parition).
Change /etc/fstab to match the example.
Execute:
Example: (last line has been changed at the Mountpoint -> /mnt)
Code:
#device Mountpoint FStype Options Dump Pass#
/dev/discs/disc0/part1 none swap sw 0 0
/dev/discs/disc0/part2 /opt ext3 rw,noatime 1 1
/dev/discs/disc0/part3 /mnt ext3 rw,noatime 1 1
Now, to prevent anything to startup at next reboot which could interrupt the image extraction we will change the post-mount script in order to prevent running any services at startup.
Execute:
Code:
vi /usr/local/sbin/post-mount
Example: (last line has been made as a comment -> #, so the script doesn't execute anything)
Code:
#! /bin/sh
#/opt/etc/init.d/rc.unslung start
We have to save our changes to the flash and reboot.
Execute:
Code:
flashfs save && flashfs commit && flashfs enable && reboot
Step 3.
Your (telnet/ssh) connection will be broken, so log in (give it some time -> 30sec) and check after the full reboot if the partitions are mounted correctly. The output will/must match the following example:
Execute:
Example:
Code:
Filesystem Size Used Avail Use% Mounted on
rootfs 3.0M 3.0M 0 100% /
/dev/root 3.0M 3.0M 0 100% /
/dev/discs/disc0/part2
966M 233M 684M 26% /opt
/dev/discs/disc0/part3
17G 235M 16G 2% /mnt
We're now ready to continue the download and extraction of the image:
go to data partition and download the image, then go to root extract the file to /opt, go to program partition, download mnt.tar.gz and install the webapplications and directory structure (this takes a while!)
Execute:
Code:
cd /mnt
wget http://files.wl500g.info/asus/custom/raas/v10/opt.tar.gz
Execute:
Code:
cd /
tar -xvzf /mnt/opt.tar.gz
Execute:
Code:
cd /opt
wget http://files.wl500g.info/asus/custom/raas/v10/mnt.tar.gz
Execute:
Code:
cd /
tar -xvzf /opt/mnt.tar.gz
(if you get an error like: wget: Unable to connect to remote host add your nameserver(default router in your network) to resolv.conf) If the download and image extraction is ok, then we have to enable our services to startup at reboot again.
Execute:
Code:
vi /usr/local/sbin/post-mount
Example: (last line has been decommented -> # removed, so the script does execute)
Code:
#! /bin/sh
/opt/etc/init.d/rc.unslung start
Again, We have to save our changes to the flash and reboot.
Execute:
Code:
flashfs save && flashfs commit && flashfs enable && reboot
Your (telnet/ssh) connection will be broken, so log in (give it some time -> 30sec)
Actual installation done. !!..
Read on in the next post on how to customize.
HeadStart II customization
Step 4.
Now, how to customize?
All user/pass combinations I have used in this image are admin/asus
(only not for ADOS, this is a error which I made in the process, sorry, use: admin/logitech)
besides from the swat/samba login, which uses the standard password you've entered in the router (oleg's firmware) to secure it.
(if you want to see what's running now, before customizing, take a look at http://192.168.1.1:8082 (change the ip address, if you don't use the standard ip address) it will take you to the homepage where most applications are accessible.))
Step 4a. (optional)
Samba
Standard, 2 shares are configured in the system: /opt and /mnt are both shares.
use /mnt for your data, and /opt for a quick-ref to your programs and config files to be accessible from lan.
open http://192.168.1.1:901/ and login with admin and the password you've used for the default asus web site (def. configuration).
You can define your shares here.
If you want to define the shares using the console and a text editor, change the smb.conf file.
Execute:
Code:
nano /opt/etc/samba/smb.conf
Example:
Code:
# Samba config file created using SWAT
# from desktopmr.lan (192.168.1.250)
# Date: 2008/09/18 08:12:36
# Global parameters
[global]
security = SHARE
log level = 1
max log size = 100
dns proxy = No
guest ok = Yes
[opt]
path = /opt
force user = admin
read only = No
[mnt]
path = /mnt
force user = admin
read only = No
Step 4b. (optional)
MySQL
Change the MySQL database password for the root user.
Execute:
Code:
mysql -u root -p mysql
Now the MySQL password is asked: Enter 'asus' (without the quotes)
Execute the command to enter a new password
Execute:
Code:
update user set password=PASSWORD("YourNewPasswordHerePlease") where User='root';
(Where you replace "YourNewPasswordHerePlease" with your new password)
Exit MySQL console and reboot
Execute:
Then Execute:
Your (telnet/ssh) connection will be broken, so log in (give it some time -> 30sec)
Log in and in the following files, change the password so that your mysql login for phpmyadmin works.
(text-editor nano is installed, which I preferably use, so this will be used in the tutorial from now on)
Execute:
Code:
nano /mnt/AIOCP/admin/phpMyAdmin/config.inc.php
(change password at line: 73)
Save the file with CTRL+O, Exit with CTRL+X
Execute:
Code:
nano /mnt/AIOCP/shared/config/cp_db_config.php
(change password at line: 47)
Save the file with CTRL+O, Exit with CTRL+X
Execute:
Code:
nano /mnt/protected/WebUI/ados/database.conf.php
(change password at line: 29)
Save the file with CTRL+O, Exit with CTRL+X
Execute:
Code:
nano /mnt/protected/WebUI/ampjuke/db.php
(change password at line: 4)
Save the file with CTRL+O, Exit with CTRL+X
That's it for MySQL security.
Step 4c (optional)
Webserver.
The webserver it's standard root is /mnt, which means that your whole data partition is accessible through the webpage!
Not all directories are accessible by public, /mnt/protected (your data-storage) is protected, and /mnt/cgi-bin is protected.
The content management systems which are running are: Simple CMS (/mnt/cms) (standard) and AIOCP (/mnt/AIOCP) (installed, but not default CMS.)
Besides that /mnt/AIOCP is public, it also contains the phpmyadmin stuff, which is off-course protected. (if you remove the AIOCP directory, you will loose phpmyadmin.)
Now, if you absolutely don't want the root of your data-partition (/mnt) to be the root of your website, change it in:
Execute:
Quote:
nano /opt/etc/lighttpd/lighttpd.conf
(change server.document-root at line: 40)
(change /mnt/ to /mnt/cms/ or /mnt/AIOCP/)
Save the file with CTRL+O, Exit with CTRL+X
Keep in mind that the installed web application will not work anymore unless you rearrange the directory structure.
Now change the password for the protected area on the webserver. (the stuff behind /mnt/protected)
Execute:
Code:
nano /opt/etc/lighttpd/.lighttpdpassword
(this file uses the 'user: password' combination (without the quotes) define you 'web' users here.)
Save the file with CTRL+O, Exit with CTRL+X
The directories which are user: password protected on the webserver are stored in lighttpd.conf file.
Open the file and go to line: 280, from this point, the file contains the protected directories. Add/remove ass you like.
Execute:
Code:
nano /opt/etc/lighttpd/lighttpd.conf
(change server.document-root at line: 280)
Save the file with CTRL+O, Exit with CTRL+X
Example:
Code:
auth.backend = "plain"
auth.backend.plain.userfile = "/opt/etc/lighttpd/.lighttpdpassword"
auth.require = ( "/protected/" =>
(
"method" => "basic",
"realm" => "Enter Password",
"require" => "user=admin"
),
"/cgi-bin/" =>
(
"method" => "basic",
"realm" => "Enter Password",
"require" => "user=admin"
),
"/AIOCP/admin/phpMyAdmin/" =>
(
"method" => "basic",
"realm" => "Enter Password",
"require" => "user=admin"
)
)
if you change anything in this file, you have to run the following command:
Execute:
Code:
/opt/etc/init.d/S80lighttpd restart
Step 4d (optional)
Configure the newsserver to download binaries.
Execute:
Code:
nano /opt/etc/hellanzb.conf
(on line: 33, change to your newsserver provider)
Step 4e (optional)
Configure transmission if you've other demands than the standard
Execute:
Code:
nano /opt/etc/transmission.conf
Step 4f (optional)
Configure user/passwords in installed webapplications.
(If you've changed your ip-address, then use it below)
ADOS: http://192.168.1.1:8082/protected/WebUI/ados/
AIOCP: http://192.168.1.1:8082/AIOCP
AmpJuke: http://192.168.1.1:8082/protected/WebUI/ampjuke
Step 4g (optional)
Configure a mac-address in /mnt/cgi-bin/wol.cgi
Execute:
Code:
nano /mnt/cgi-bin/wol.cgi
Example:
Code:
#!/bin/sh
ether-wake -i br0 00:16:17:B1:F3:99
echo "<HTML><HEAD><title>test</title></head><BODY>Magic Packet
Sent</Body></html>"
(add your mac-address at the second line at the end.)
once you've entered the correct mac-address in this file, you're able to start the machine once you access the page through a webbrowser -> http://192.168.1.1:8082/cgi-bin/wol.cgi
Step 4h (optional)
FTPserver
proftpd is installed as ftpserver.
you can configure it in :
Execute:
Code:
nano /opt/etc/proftpd.conf
End of basic configuration!
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.
Other than Samba, most of the items installed are webapplications (which has been pointed out at the beginning of this tutorial), open up http://192.168.1.1:8082 in your browser and read the homepage, there is a number of links which will lead you further.
HellaNZB
Well, there are 2 small issues with this one.
1) it doesn't start on itself after the router reboots. start with:
Execute:
/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/WebUI/zussaweb/
After starting HellaNZB, simply put your nzb's in /mnt/protected/Downloaders/HellaNZB/nzb/daemon.queue and download will start.
That's about what I can tell you, play around, if you've any questions, don't hesitate to ask. Also, if you've comments to make it better (the image, or the tutorial, please post)