aMule Forum
English => aMule News => Topic started by: lfroen on September 16, 2005, 09:24:30 AM
-
As topic says, php-enabled amuleweb is ready for public testing.
What does it mean ?
Until now, look-and-feel of of amuleweb was mostly hardcoded in amuleweb. Template exists, but it is being very hard to customize due the fact that you can't just load it into you favorite html editor.
Not anymore !
From now on, amuleweb can work similar to any other php-enabled webserver (apache for example). Template is set of regular html pages with inside, which are interpreted by amuleweb in run-time.
That's it - there is no more need to recompile amuleweb to change pages functionality.
How to turn it on
PHP interpreter is always compiled, so all you need is to add --php to amuleweb command line. If you have installed amule in default location, template will be found automatically.
If not - copy "php-default" template from amule snapshot into $HOME/.aMule/webserver
You can give it other name, but then you will need to use -t in command line.
Note: old template will not work for obvoius reason (it's not html+php).
Browser support
Any is good, as long it support javascript and cookies are enabled.
Feel free to report any issues, problems, questions here or directly to me.
-
This is real good news! thanks for your effort, lfroen. I'll try it ASAP.
Regards.
-
nice design :)
looks much cooler then the default webserver :))
-
Nice job lfroen, congratulations for your great work!
Cheers!
-
Hi,
When I start the new webserver with --php (CVS-20050921) I can't login. It just shows login.html. I have tried with firefox 1.0.6, Opera 8 and Konqueror with cookies and javascript enabled. I've also tried with different URLs: http://localhost:4711, http://127.0.0.1:4711, http://hostname:4711. I'm using MEPIS and wxGTK2 v2.6.1 (Unicoded). The webserver diplays:
aMuleweb$
WSThread: Thread started
WSThread: created service
WSThread: created socket listening on :4711
WCThread: Started a new WCThread
No session opened - requesting login
Session created - requesting login
Processing request: login.html
WCThread: Started a new WCThread
Session ok
Processing request: login.html
WCThread: exited [WebSocket closed]
WCThread: exited [WebSocket closed]
WCThread: Started a new WCThread
Session ok
Processing request: login.html
WCThread: exited [WebSocket closed]
WCThread: Started a new WCThread
Session ok
...
The old webserver works OK.
-
Do you have another webserver running on localhost and (possibly) setting cookies ? Take a look @ your cookie list and clean one coming from localhost. The log should look like this:
Processing request: login.html
WCThread: exited [WebSocket closed]
WCThread: Started a new WCThread
Session ok
Checking password
Password ok
Processing request: index.html
I will review the code anyway, and insert additional debug prints.
Let me know how it worked (or not worked)
-
alehack, Did you set your´ configuration manually through the config file?
I had the same problem. It just stays on the login page because your password is incorrect, even if you set it correctly in the config file.
If you set the passwords through the config, make sure they are encrypted. You may wan´t to delete the config, or back it up, then create a new one by running aMule and set it up with the preferences. This seemed to correct the problem for me.
-
PHP interpreter is always compiled, so all you need is to add --php to amuleweb command line.
Hi
How to enable PHP interpreter when amuleweb is started with amuled ?( thanks
-
How to enable PHP interpreter when amuleweb is started with amuled
You can't do it like this. Disable automatic start and run it manually.
-
You could add a liitle checkbox to configuration dialog, saying Enable PHP.
Then just Enable_PHP_at_auto_startup to amule.conf or remote.conf, and all worries are gone.
I don't know if that is difficult, but it sounds to be not.
-
I dont have other webservers running. I have deleted all my cookies. I have also deleted amule.conf with no success. amuleweb always says: Password bad
I have set the password by using aMule so it should be ok.
The problem seems to be at line 3700 of WebServer.cpp:
session->m_loggedin = (PwHash == webInterface->m_AdminPass);
the comparison returns false because m_AdminPas is empty. Perhaps amuleweb is having problems parsing amule.conf. BTW, my password only contains ASCII characters.
Thanks
-
It worked. Anyway, the solution seems a hack... I ran amuleweb -w and then added two MD5 hashs to the generated file in EC and Webserver sections. IMHO amuleweb should read the web password from amule.conf
-
the comparison returns false because m_AdminPas is empty.
Your AdminPass is empty. I forget to mention, that it only checks for 1 password: admin password. I will add support for low rights user later.
-
btw about the password things, there is man page and a wiki page about this.
when you start amuleweb by yourself from console, it will not read the password from amule.conf, instead it will look for a remote.conf and read that.
if it does not exist, pass is empty.
there is a cool feature in forum called search, there have been a lot of threads about this alredy...
tata
-
Originally posted by Vollstrecker
You could add a liitle checkbox to configuration dialog, saying Enable PHP.
full ack. :)
-
add a liitle checkbox to configuration dialog
sorry, but the idea is to replace C++ based webserver with php based when later is debugged enough and provide at least same functionality.
-
Whats the exact Option that I should add to amule.conf for default use of this new feature?
Thanks
-
you cannot specify any "automatic" option
start amuleweb manually in the console and use the
--php flag
-
Originally posted by stefanero
you cannot specify any "automatic" option
start amuleweb manually in the console and use the
--php flag
ok I did this, but when I want connect to :7712 The browser just loads nothing, but hangs.
Any hints?
-
Paste output of amuleweb on terminal window, and btw by default amuleweb listens on port 4711 and not on 7712 as you posted. If you can not see login window (with pretty girl on it) your setup is screwed.
-
Originally posted by lfroen
Paste output of amuleweb on terminal window, and btw by default amuleweb listens on port 4711 and not on 7712 as you posted. If you can not see login window (with pretty girl on it) your setup is screwed.
ok I had some problems with the ports... now it works.
Thank you
The nicest thing is that the search function now works... but hey how can I drop an existing search?
-
how can I drop an existing search
What exactly you mean ?
-
Nice work.... going to try it now :)
-
lfroen:
he means to stop a search which has been started but not finished yet.
Phlogiston:
afaik, you can't ;)
-
Originally posted by lfroen
how can I drop an existing search
What exactly you mean ?
I just regognized that this happens if I start a new search, so no problem. And hey something changed in the normal version of amuleweb, because the search function is now working. At the moment I prefer the normal "old" version, it is more lucid than the new php thing.
Or what are the advantages of this new stuff, if you don't want to change somehting at the webgui yourself?
-
Or what are the advantages of this new stuff, if you don't want to change somehting at the webgui yourself?
1. webgui itself, as you called it, changed. IMHO it's match better now
2. It's easy to have completely different looks: the way amuleweb "looks" is written in html+php and not
hardcoded in c++. Open it in your favorite html editor and change as you see fit.
3. Addition of new features (have you seen new stats page ?) is match easier
4. Other advantages that writing webpages in php have over writing in c++
-
just out of curiosity:
how did you implement php? do you send the files through php by calling it (would require an installed php-interpreter) or did you actually include php in the server?
-
the server has a tiny php-like interpreter.
-
ok, so there's no change to activate additional php modules, update to php5 etc. without recompiling, right?
(well, doesn't bother me much - but it's less fun without that stuff ;) )
-
amuleweb brings along its own PHP interpreter which lfroen wrote completely from scratch. So it is completely independent from any PHP on your system...
-
sounds quite like reinventing the wheel 8o
:P
-
Sounds like a PHP license that wouldn't allow us to use their source in amule ;)
-
Can it be dynamically linked? Or just imported as module like apache does?
-
this would just add another dependency...
-
and much more load than what amuleweb really needs and still would need lots of into-amuleweb code since PHP5, by itself, doesn't provide any information about aMule ;)
-
We had this discussion, too, but lfroen stated that for him it was not a hard and disliked task to write the PHP parser, but rather fun and interesting. He didn't do it because he had to but because he wanted to ;)
-
He didn't do it because he had to but because he wanted to
On my day job I do things that I have to and get paid for. Here, on a contrary, I have a choice :)
But, being serious, using external php interpreter is not trivial thing, and suffer from several drawbacks:
1. External dependancy
2. Installation complexity
3. Dependancy on php version currently installed
4. Dependancy on configuration of installed php
5. Developing such thing would be plain PITA - I did some RTFM to be sure
Implementing own interpreter (parser is only one part of it :) ), on the other hand, is fun and serve the purpose as I see it.
Worth note, that it doesn't prevent me from using external php as choice, and I may add support for this in near future.
-
Not so near, we have to release at some point.
-
hehe, Kry :P
@lfroen
i don't know about the difficulty of implementation, but it would be much more powerfull with the official php-runtime (i guess you haven't implemented all 100s function available *g*). but thanks anyway - looks much better now - and IMHO it's faster than the old webadmin too!
small notice: did i miss something or are the links/hashs of the shared files not shown anymore?
-
hey lfroen! that's the first kind post i read from you! congrats!
you can keep posting rude ones now ;) :P
-
it would be much more powerfull with the official php-runtime
Oh, definitly. I can't compete with Zend which develops php several years. But, that's the trade-off I choose against drawbacks listed above.
small notice: did i miss something or are the links/hashs of the shared files not shown anymore?
No. I don't see what it can be used for. File hash accessed via property "hash" like $file->hash (for shared files and downloads), and link to shared files accessed via $file->link. Add it where you see fit.
I will publish complete manual before release.
-
Is it just me or webserver is broken?
I noticed that amuleweb dont run at amule startup even if run amuleweb at startup option is check in preferences and a "You choose to run amuleweb at startup but amuleweb executable is not installed or not in path" error is raised.
Another thing is is i start amuleweb manually i cant login with a password bad in the log....after a read all posts in this thread i copied the password hash in amule.conf and pasted in the remote.conf webserver section ...same thing :Password bad....i even deleted amule.conf and remote.conf and configure it in the GUI with no luck....and then remember lets run amuleweb with a --no-php switch but hey....i cant login either...
Is there a problem with this??
I guess nothing is perfect.... :))
Good work to everybody involved....
Cheers.....
-
yup your right, same thing here..
when I type pass and the page simple reloads
-
Login part did not changed for weeks. And it work for me. Try to clear cookies.
-
Login part did not changed for weeks. And it work for me. Try to clear cookies.
Changed or not, cvs from yesterday works fine now.... :D
Cheers....
-
hm, strange thing, it works with iexplore, while firefox just loads the frameset, but all pages are the login-sreen, so it just jumps back to the login-screen.
anybody observing the same?
btw, i cleared all cookies from the host amule is running on.
edit: as said on http://forum.amule.org/thread.php?threadid=8680&sid= i disabled all extensions and gave it a try. no progress, still getting back to the login. (just checked: the Sessid-cookie gets set, but there must be a problem with reading it)
no problem with the old webinterface or iexplore though.
-
it works with iexplore, while firefox just loads the frameset, but all pages are the login-sreen
Cookies/Cache/Extensions.
If it works with explorer - webserver setup and network is ok.
-
well, after fiddling around some time, trying to login on hostname or ip etc. it works now...
strange things *g*
-
anybody observing the same?
Yes, i have exactly the same problem. But my "fiddling" attempts didn't solve this.
I would like to know what exactly you did so that it worked.
Greetings,
Chris