Tiny Core Linux
Off-Topic => Off-Topic - Tiny Core Lounge => Topic started by: curaga on March 16, 2012, 05:34:17 PM
-
I've been working on a light webUI for aria2, for remotely controlling downloads.
Anyone interested in testing?
http://a2web.sourceforge.net
Quick install on busybox httpd:
tce-load -wi compiletc aria2 fcgi fcgi-dev xmlrpc-c-client
make
mkdir -p ~/www
COPYDIR=~/www make copy
cp a2web.conf.sample ~/www/cgi-bin/a2web.conf # set the theme path as "/a2web/crystal", busybox doesn't like regular files under cgi-bin
httpd -f -p 8080 -h ~/www
-
hi curaga
how to setup with lighttpd.tcz ?
-
I don't have my test setup at hand right now, but you need to add "mod_cgi" to the server modules, and assign .cgi to nothing:
$HTTP["url"] =~ "^/cgi-bin" {
cgi.assign = ( ".cgi" => "" )
}
Note this is the CGI setup, I haven't tested FastCGI with lighttpd.
-
a2web.tcz now posted.
Busybox httpd instructions shorten to:
tce-load -wi a2web
# edit config file as needed
httpd -f -p 8080 -h /usr/local/share/a2web
I also tested lighttpd FastCGI, seems there's a bug in lighttpd's passing of SCRIPT_NAME (it passes it fine in CGI mode) or in libfcgi. Not too interested in tracking that down ATM, so lighttpd users please use the CGI mode.
-
Hi Curaga,
I will test the extension and report the result here,
-
I have found the bug in fastcgi. It was in libfcgi's printf. The fixed packages haven't been uploaded yet, I'll ask danielibarnes first.
Here's an example lighttpd conf, in fastcgi mode:
server.document-root = "/usr/local/share/a2web"
server.port = 80
server.modules = ( "mod_access", "mod_fastcgi" )
server.username = "nobody"
server.groupname = "nogroup"
server.errorlog = "/tmp/light.log"
mimetype.assign = (
".css" => "text/css",
".js" => "text/javascript",
".png" => "image/png" )
fastcgi.server = ( ".cgi" =>
(( "bin-path" =>
"/usr/local/share/a2web/cgi-bin/a2web.cgi",
"socket" => "/tmp/a2.socket"
))
)
-
fcgi.tcz is updated, fastcgi should work with all supporting servers.
-
hi curaga,
i have tested a2web.tcz and found no problem so far,
thanks
-
i tried to run a2web under xampp
Firefox can not connect to server localhost:6800
i stopped xampp, installed busybox httpd and did as adviced here
Busybox httpd instructions shorten to:
tce-load -wi a2web
# edit config file as needed
httpd -f -p 8080 -h /usr/local/share/a2web
# set a2web.conf
sudo /usr/local/httpd/bin/httpd -f -p 8080 -h /usr/local/share/a2web
firefox http://localhost:6800/rpc
but result is the same
Firefox can not connect to server localhost:6800
most likely my hands are growing from other side :D
probably it would be easier for me to build something with gui from here
http://sourceforge.net/directory/freshness:recently-updated/?q=aria2
this is reason why i sometimes use fatrat ::)
-
6800/rpc is where aria2 is running, you should point firefox to 8080, where a2web is running ;)
"firefox localhost:8080"
-
i made the following
sudo cp -f /usr/local/share/a2web/a2web.conf.sample /usr/local/share/a2web/cgi-bin/a2web.conf
sudo cp -f /usr/local/share/a2web/a2web /usr/local/share/a2web/cgi-bin
sudo sed -i "5,6s/^# //" /usr/local/share/a2web/cgi-bin/a2web.conf
su ${TCUSER=`cat /etc/sysconfig/tcuser`} -c "aria2c --enable-rpc"
sudo /usr/local/httpd/sbin/httpd -f -p 8080 -h /usr/local/share/a2web -u $TCUSER:staff
as result i get 404
firefox http://localhost:8080
http://pastehtml.com/view/c6xeioq1o.html
or desired a2web but without theming
firefox http://localhost:8080/cgi-bin/a2web.cgi
(http://forum.tinycorelinux.net/index.php?action=dlattach;topic=12831.0;attach=3545)
i again did something wrong?
-
Sorry, I occasionally assume too much. Here's a step by step, for the busybox httpd extension. Note the config file editing is not necessary for other web servers.
Pre-step: Run aria2 --enable-rpc, maybe from a boot script.
1. tce-load -wi a2web busybox-httpd
2. cd /usr/local/share/a2web/cgi-bin
3. sudo cp ../a2web.conf.sample a2web.conf
4. Uncomment the themedir path and add a / (just like in the first post, /a2web/crystal)
5. firefox localhost:8080/cgi-bin/a2web.cgi
edit: Your current setup only misses making the theme path absolute, ie add a / to the theme path's start.
-
here i wrote daemon a2webd for a2web
Usage: a2webd [start|status|reload|restart|stop]
this script examines configuration files
a2webd.conf, aria2.conf (if exists)
and a2web.conf (or creates it if does not exist)
then starts aria2 if not running another instance
and starts busybox httpd with a2web.cgi
if can't find already running a2web.cgi
on another already configured http server
more details as it works is specified in comments
a2webd has configuration file a2webd.conf
which created with default options
at first start if did not exist before
# a2web.conf
# path = /path/to/a2web.cgi
path = /usr/local/share/a2web/cgi-bin/a2web.cgi
# uri = [http://][[password:]user@]server[:port]/path-to/a2web.cgi
uri = http://localhost:8080/cgi-bin/a2web.cgi
options should be changed on your own
(such as user and password for http auth)
to launch busybox httpd with a2web.cgi
or according to already running on other server
i tested and seems it work well
maybe you look how it works
and consider its inclusion to extension a2web.tcz
or maybe also to a2web distribution if it can be applied
-
a2web.tcz, a2web - sure, I can add it.
I see that you check the aria2 conf file for the dir option, and pass it on the command line too. Why? Is there some bug in aria2 that prevents the dir option in the config file from working?
-
indeed most likely that there i'm reinsured :)
i think that aria2 has no such error
i'll check this and most likely this can be removed
and when i rode to home then i thought
that not very well written search for path to busybox httpd
if this will applied for different linux distributions
i'll work with all this tonight and upload corrected version
i also thought how would better
automatically define prefix variable
rather than set it tough...
also i still can't imagine universal method
to user determining for different linux distributions
and if nothing will come to mind then so far leave it as is
-
i also thought how would better
automatically define prefix variable
rather than set it tough...
prefix solved simply
A2WEB=`find /usr -name a2web.cgi`
PREFIX=${A2WEB%%/share*}
-
and when i rode to home then i thought
that not very well written search for path to busybox httpd
if this will applied for different linux distributions
i think that this will be better
# find busybox httpd if running a2web.cgi not found
for item in `find ${PATH//:/ } /usr -name httpd -type l`; do
[ -x $item ] && readlink $item | grep -q busybox && HTBIN=$item && break
done
-
Please upload the complete script instead of snippets ;)
-
sorry for delay
this took two nights instead one as i imagined
changes:
- removed dir option checking and passing it to aria2 command line
- modified hard assignment of prefix to determination by search
- corrected search for determine path to busybox httpd
- changed user/group for busybox httpd to nobody/nogroup
- added simple option validation for configuration file a2web.conf
- added function for determine user instead of hard assignment
- appointed current a2webd version number to 0.2
-
Added it to the a2web repo. The extension update will have to wait a bit (ibiblio low on space again).
-
people say that every idea can be brought to absurd
and i think that i proved it once again in my case :)
i apologize that not warned you but i made a2webd 0.3
i decided to have fun with google code
and watch with what it is eaten
here it is that happened with this
https://code.google.com/p/a2webd/
changes in a2webd 0.3:
- fixed incorrect definition for path to /etc
- corrected function of current user determination
- added creating icon, link a2web->a2debd, desktop entry
- added feature to start a defined, default or found web browser
-
With a separate project, maybe better to have just a link than a copy?
-
sorry, i do not quite understood what you mean?
-
With your script having its own project page, I think it would be better not to include it in a2web, but rather just link to it.
-
i again don't quite understand why you think so
if you mean that i need work with a2webd within github
i yet don't know how to do it but i can try to cope with this
if you make link to wiki then i can add there a2webd pages
but maybe if you don't have time to engage with this
then i really can keep it as separate project
although a2webd is only supplement to a2web
for convenient use by end users
any variants can be considered
p.s.
i can make separate extension a2webd.tcz
to not make changes to existing a2web.tcz
and also for adding xdg-utils.tcz as deps
what do you think about this?
-
With your own project page at google code, it doesn't make sense to keep a copy in the a2web sources. Such a copy is always likely to be a bit less up to date than the direct source.
Yeah, having a separate extension sounds good too. Then you can easily send updates without having to wait for me to get to it.
-
With your own project page at google code, it doesn't make sense to keep a copy in the a2web sources. Such a copy is always likely to be a bit less up to date than the direct source.
i think it will not be a problem
i could add a2webd files to contrib folder
of course if such a possibility exists on github
project pages would remained as info and help
Yeah, having a separate extension sounds good too. Then you can easily send updates without having to wait for me to get to it.
here before make extension remained to make some fixes
first, i mistakenly changed places for user and password
uri = [http://][[password:]user@]server[:port]/path-to/a2web.cgi
and maybe can you advise me
how i can determine command line mode when x is running?
and it seems to me that if i fix this
then it will be last that i would make
-
how i can determine command line mode when x is running?
Please elaborate? I don't understand the question here.
-
sorry
i use pgrep X for determine that x server is running
in order to choose what kind of browser should run
which works under x server or in command line
but if i switch to cmdline by ctrl+alt+f{n} when x works
then how i can determine that need run cli browser?
-
The output of "tty" should be useful. Under X it's *pty*, under a real terminal *tty*.
-
sorry, i did not understood what i should do with tty and pty
maybe i should analyze variable $DISPLAY?
in tinycore under x it has value :0.0
under real terminal it is empty
-
That works too.
-
hope it works well not only in tinycore :)
-
i decided to make a separate topic (http://forum.tinycorelinux.net/index.php/topic,13882.0.html)
because i have another questions
and i don't want transform this topic
completely into discussion about them
-
maybe i should analyze variable $DISPLAY?
in tinycore under x it has value :0.0
:0.0 is given to the instance of X server which is started first. Further instances have different numbers.
-
if i understood correctly
that this numbers are only given for x server instances
but for real linux command line they are not given
if it so then this is entirely suitable for my checks
thank very much tinypoodle :)