We have upgraded the community system as part of the upgrade a password reset is required for all users before login in.

Install LAMP, FTP and PhpMyAdmin on your Onion Omega



  • @Boken-Lin I have tried following the instructions you give at https://wiki.onion.io/Tutorials/Using-USB-Storage-as-Rootfs for pivot-overlay method.
    I am having a problem.
    When I try the command in Step 3 :

    • mount /dev/sda1 /mnt ; tar -C /overlay -cvf - . | tar -C /mnt -xf - ; umount /mnt

    I get the messages

    • tar: empty archive
      tar: short read

    I think this may be related to the fact that Step 2 said:

    • mount /dev/sda1 /mnt/sda1

    I think there is some issue as to where /dev/sda1 is mounted.
    I am confused - can you clarify please. Thanks.



  • This post is deleted!


  • @Kit-Bishop That's quite strange. Can you try running the commands separately to see if it helps?

    mount /dev/sda1 /mnt
    

    then

    tar -C /overlay -cvf - . | tar -C /mnt -xf -
    

    Finally,

    umount /mnt
    


  • @Boken-Lin I'm having one of those days when nothing seems to go right! šŸ˜ž
    I have managed to move on a bit. Not sure why, but when I tried the

    mount /dev/sda1 /mnt ; tar -C /overlay -cvf - . | tar -C /mnt -xf - ; umount /mnt
    

    via PuTTY I continued to get the same error. However using MobaXTerm it worked.
    Now, my /mnt/sda1 directory has a copy of my /overlay directory.

    So I proceeded with the subsequent steps:

    block detect > /etc/config/fstab
    

    Edited /etc/config/fstab to set enabled to '1'

    reboot
    

    But nothing seems to have changed on my Omega.
    Sorry to swamp you with lots of information, but after the reboot, I have:

    Output from df -h

    root@Omega-0A97:/# df -h
    Filesystem                Size      Used Available Use% Mounted on
    rootfs                    8.4M    376.0K      8.1M   4% /
    /dev/root                 6.5M      6.5M         0 100% /rom
    tmpfs                    29.9M    456.0K     29.4M   1% /tmp
    /dev/mtdblock3            8.4M    376.0K      8.1M   4% /overlay
    overlayfs:/overlay        8.4M    376.0K      8.1M   4% /
    tmpfs                   512.0K         0    512.0K   0% /dev
    /dev/sda1                29.2G     44.0M     27.7G   0% /mnt/sda1
    root@Omega-0A97:/#
    

    Output from mount

    root@Omega-0A97:/# mount
    rootfs on / type rootfs (rw)
    /dev/root on /rom type squashfs (ro,relatime)
    proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
    sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
    tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
    /dev/mtdblock3 on /overlay type jffs2 (rw,noatime)
    overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work)
    tmpfs on /dev type tmpfs (rw,nosuid,relatime,size=512k,mode=755)
    devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600)
    /dev/sda1 on /mnt/sda1 type ext4 (rw,relatime,data=ordered)
    debugfs on /sys/kernel/debug type debugfs (rw,noatime)
    root@Omega-0A97:/#
    

    Contents of /etc/config/fstab

    root@Omega-0A97:/# cat /etc/config/fstab
    config 'global'
            option  anon_swap       '0'
            option  anon_mount      '0'
            option  auto_swap       '1'
            option  auto_mount      '1'
            option  delay_root      '5'
            option  check_fs        '0'
    
    config 'mount'
            option  target  '/mnt/sda1'
            option  uuid    'cad99fb9-c045-467a-b629-3acd4c170ae3'
            option  enabled '1'
    
    root@Omega-0A97:/#
    

    It looks like my USB is not getting mounted on /overlay.

    Do you see anything wrong? Is there some step I have missed? Is there any other info I can supply that might help?



  • @Josip-Mlakar Wiki article is online: https://wiki.onion.io/Tutorials/How-To-Install-LAMP-Stack-on-the-Omega šŸ™‚ I will put up a separate article for PHPMyAdmin.



  • @Kit-Bishop I think you should change:

    config 'mount'
            option  target  '/mnt/sda1'
            option  uuid    'cad99fb9-c045-467a-b629-3acd4c170ae3'
            option  enabled '1'
    

    from /etc/config/fstab to:

    config 'mount'
            option  target  '/overlay'
            option  uuid    'cad99fb9-c045-467a-b629-3acd4c170ae3'
            option  enabled '1'
    


  • @Boken-Lin cool šŸ˜„



  • @Boken-Lin Thanks - had just figured out that something like that was needed - having a slow brain day today šŸ™‚
    That works!
    Perhaps this should be made clearer on the bit on editing /etc/config/fstab in the WiKi page at https://wiki.onion.io/Tutorials/Using-USB-Storage-as-Rootfs



  • @Kit-Bishop Done!



  • @Boken-Lin Cool šŸ™‚ That was quick. Thanks for your help



  • @Boken-Lin ,

    While adapting @Josip-Mlakar 's guide to the Wiki, this step was missed.

    Seems simple enough of a step, but it is assumed the drive is formatted as ext4 in further steps.

    Thanks for both of yours' work!

    @Josip-Mlakar said:

    To do that you will have to format your USB storage into ext4 filesystem. You can do this by following commands:

    opkg update
    opkg install e2fsprogs
    mkfs.ext4 /dev/<your partition>



  • @Chris-MacKay I think I mentioned that somewhere in the prerequisite section.



  • @Josip-Mlakar Great tutorial works like a charm. It only seems that apache isn't autostarting after a boot. Any ways you have solved that one?



  • @Danny-van-der-Sluijs well I tried to make file named apache in /etc/init.d with content:

    #!/bin/sh /etc/rc.common
    START=95
    start() {
    	apachectl start
    }
    restart() {
    	apachectl restart
    }
    stop() {
    	apachectl stop
    }
    

    made it executable with chmod +x /etc/init.d/apache
    and then executed /etc/init.d/apache enable. It gets enabled and I can start it with /etc/init.d/apache startbut script doesen't start on boot šŸ˜ž I'll keep You updated if I find the solution:)



  • @Josip-Mlakar Unless I am much mistaken (I'm sure others will correct me if I am :-)) what you need is:

    • A symlink in /etc/rc.d named S95apache that references your /etc/init.d/apache file
      Files named like S<nn>Xxxx in /etc/rc.d are executed in order of the <nn> at system boot time as S<nn>Xxxx start thus starting the referenced file
      Files named like K<nn>Xxxx in /etc/rc.d are executed in order of the <nn> at system shutdown time as K<nn>Xxxx stop thus stopping the referenced file

    One small thing I would check though is your use of START=95 (and corresponding usage of 95 in S95apache and K95apache) - as far as I can see 95 is currently being used by /etc/init.d/done and /etc/rc.d/S95done and I am unsure about the effects of resuing the same number.



  • @Kit-Bishop Thank You for Your help, but /etc/init.d/apache enable creates symlink automatically. I also tried manual as you stated, but still no luck. Also tried to change START=95 into all kinds of numbers, but nothing works šŸ˜ž



  • @Josip-Mlakar Sorry that didn't help - though I didn't see anything in the /etc/init.d/apache file you posted for handling enable or setting up any symlinks.

    Just for the record, after some quick testing, i can confirm that the symlinks in /etc/rc.d do work as I expected and also that the START value (and the <nn> values) can be reused - I created a test file in /etc/init.d with START=95 and set up the S95 and K95 links which duplicate the 95 used by /etc/init.d/done and all worked fine,



  • @Danny-van-der-Sluijs I think that's because you have not set Apache server to start automatically on boot. Can you try this:

    Create a file /etc/init.d/apache, add the following content:

    #!/bin/sh /etc/rc.common
    
    START=12
    
    USE_PROCD=1
    NAME=apache
    PROG=/usr/sbin/apachectl
    
    start_service() {
            procd_open_instance
            procd_set_param command "$PROG" start
            procd_close_instance
    }
    
    stop() {
            /usr/sbin/apachectl stop
    }
    
    reload() {
            /usr/sbin/apachectl reload
    }
    

    Make the file executable:

    chmod +x /etc/init.d/apache
    

    Reboot again.

    Please let me know if this works šŸ™‚



  • Ok i found what's wrong. Since PhpMyAdmin uses mysql, apache fails to starts before mysql is up. So very very very (did I say very? :D) dirty way to fix this is to add sleep 5 in start() function... Better way would be somthing like while (mysql not running) {wait} but I cant find a way to check mysql status. if I find a way I'll update this comment.
    Anyways @Danny-van-der-Sluijs current solution is:
    Make file named apache in /etc/init.d with content:

    #!/bin/sh /etc/rc.common
    START=95
    start() {
        sleep 5
        apachectl start
    }
    restart() {
        apachectl restart
    }
    stop() {
        apachectl stop
    }
    

    Make it executable with chmod +x /etc/init.d/apache and then execute /etc/init.d/apache enable. Ofcourse don't forget to enable mysql to start on boot, you can do that with a command /etc/init.d/mysqld enable.

    @Kit-Bishop You don't need to manualy handle enable to set up symlink (as stated here in Enable and disable section).



  • Hi, I followed your tutorial. But after setting up phpmyadmin I'm getting this error:

    Screen Shot 2015-12-06 at 22.33.04.png



Looks like your connection to Community was lost, please wait while we try to reconnect.