Install LAMP, FTP and PhpMyAdmin on your Onion Omega
-
@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
-
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 start
but 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.
- A symlink in /etc/rc.d named S95apache that references your /etc/init.d/apache file
-
@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 namedapache
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:
-
Hi @Milan-Vuckovic, according to this post: https://community.onion.io/topic/220/lamp-stack-rights-management-issues, you can try reinstalling apache a couple times to see if it fixes the issue.
Cheers.
-
What should I use for server name in httpd.conf ?
-
@Milan-Vuckovic wathever You want (example: www.example.com, www.my-page.com ...)
-
@Milan-Vuckovic I'm having the same problem as well. I've tried reinstalling apache with no luck. (opkg install apache --force-reinstall). Any help would be appreciated.
-
Try this. I changed some of the settings and it worked.