Bekijk de volledige versie : PHP, MySQL, PHPMyAdmin, Serendipity
newbiefan
23-05-2011, 22:37
Ich möchte unsere Community fragen ob Interesse für ein HowTo besteht, auf unserem (Euren) Router einen kompletten Webserver - Lighttpd mit PHP, Eaccelerator, MySQL, PHPMyAdmin und das tolle Weblog System Serendipity aufzusetzen.:cool:
Da dies natürlich einen ordentlichen Haufen an Schreiberei bedeutet, frage ich natürlich vorher, um mir sinnlose Arbeit zu ersparen.
Die gesamte Software läuft hier auf einem WL500gP ohne Probleme und sogar relativ flüssig und stabil. Ich denke, dass hier Eaccelerator ordentlich hilfreich ist. Ich hatte es nicht für möglich gehalten ein komplettes Weblog System wie Serendipity auf dem kleinen Router (32MB) sinnvoll installieren zu können.
Für ganz neugierige User habe ich ein paar Screenshots beigefügt.
Bitte nicht böse sein, falls nur 1-2 User Interesse haben macht es keinen Sinn, dann kann ich jedoch die relevanten Files posten und nur eine Kurzanleitung erstellen. :p
Euer Newbiefan
hi hi
cool, dass du da was geschafft hast :)
meine Versuche mit Wordpress waren grauenhaft - also der zugriff eeeeeeehlend langsam.
Wir haben doch schon php & mysql tutorials, oder? Ich hatte das damals nach tuts gemacht...
Ist denn irgendwas zu beachten, was nicht in der Serendipity User Documentation steht?
vlt. machne wir in der FAQ einfach ne tabelle, was schon erfolgreich getestet wurde (vlt mit Anmerkung, was getan werden musste, damit es wirklich läuft) und was man nicht mehr ausprobieren muss.
Wordpress war da son ein negativ Beispiel, was zwar läuft aber auf nem wl500gpv1 einfach zu langsam ist. Wie es auf den neuen Routern aussieht, kann ich nicht sagen.
vg
newbiefan
25-05-2011, 10:31
meine Versuche mit Wordpress waren grauenhaft - also der zugriff eeeeeeehlend langsam.
Wir haben doch schon php & mysql tutorials, oder? Ich hatte das damals nach tuts gemacht...
Naja, die Indizierung dauert schon etwas, aber danach geht es zügig. Freilich wird der Router bei mehreren Usern (gleichzeitig) in die Knie gehen. Ich habe auch noch wenig in der Datenbank stehen und weiss nicht wie es aussieht, wenn viele Einträge vorhanden sind - das ist aber nicht der Sinn der Sache - ich möchte nur meine Seiten hier in Ruhe ausprobieren.
Wegen der Tuts.: Freilich gibt es schon viele über MySQL, PHP usw., speziell das von WPTE - aber alle Tuts haben Schwierigkeiten mit dem MySQL - deshalb habe ich nachgefragt (Obwohl es eigentlich einfach ist). Freilich sind auch noch Kleinigkeiten bei Serendipity zu beachten - HowTos sind nach meiner Meinung sowieso nur ein Ersatz für längere Google/Forum Suchaktionen. Richtige Neuigkeiten gibt es hier ohnehin kaum........
Viel Spass, Newbiefan
Wegen der Tuts.: Freilich gibt es schon viele über MySQL, PHP usw., speziell das von WPTE - aber alle Tuts haben Schwierigkeiten mit dem MySQL
immer noch Schwierigkeiten mit mysql? Ich haben alle repariert, soweit ich weiß?
meine Versuche mit Wordpress waren grauenhaft - also der zugriff eeeeeeehlend langsam.
WordPress ist langsam darum hab ich quick cache installiert: http://wordpress.org/extend/plugins/quick-cache/
Aber für die WL-500 Router ist dass immer noch zu langsam, denke Ich:)
Ich möchte unsere Community fragen ob Interesse für ein HowTo besteht, auf unserem (Euren) Router einen kompletten Webserver - Lighttpd mit PHP, Eaccelerator, MySQL, PHPMyAdmin und das tolle Weblog System Serendipity aufzusetzen.:cool:
PhpMyAdmin ist eine gute Idee, und Serendipity ist sicher toll;)
Aber entschuldigen Sie mich für Fragen, warum ein andere HowTo für lighttpd?:o
vielleicht können wir zusammen auf meinem How-To arbeiten ?:D
newbiefan
25-05-2011, 17:42
immer noch Schwierigkeiten mit mysql? Ich haben alle repariert, soweit ich weiß?
Hi,
well, your howto is quite good. It solves most of the problems.
Just in case you need a different database like for serendipity it gets a bit delicate. Further, mysql creates any database by default with a swedish character set. I was pretty close to give up, because for instance serendipity use per default utf8 - it took me days....:(
Maybe a MySQL guru is able to solve such a problem within minutes.
At least I've set serendipity to use the native database character set - I had no other solution. But anyway, I'm on the best way to become a MySQL expert some day......:cool:
PhpMyAdmin ist eine gute Idee, und Serendipity ist sicher toll;)
Aber entschuldigen Sie mich für Fragen, warum ein andere HowTo für lighttpd?:o
vielleicht können wir zusammen auf meinem How-To arbeiten ?:D
Regarding PHPmyAdmin: Is very easy to install, just one small change to make it save and with password. But it's very helpful for non mysql-experts.
Regarding lighttpd: I have no intention to write an other HowTo for lighty - yours is very good!
Regarding teamwork on your HowTo: sure, I thought to write a german at first and then to extend yours - if you aggree.
You know Wouter, I'm always happy to work together.
I still have one problem to solve - it's MySQL related - sometimes MySQL will not start after a reboot - this would not be a real problem for me ;) , the much bigger one is that in such a case most of the database gets corrupted somehow. no log-entry nothing. This drives me crazy.... Maybe I try to change MySQL.
In any case, as soon as I achieve a stable installation, I'll contact you in order to put something together. Thanks again for your proposal to put the things together!
Stay tuned - will come back to you (hopefully) soon
Helmut
hehe, I did my best on writing German, but I guess English is easier:p
Hi,
well, your howto is quite good. It solves most of the problems.
Just in case you need a different database like for serendipity it gets a bit delicate. Further, mysql creates any database by default with a swedish character set. I was pretty close to give up, because for instance serendipity use per default utf8 - it took me days....:(
Really? for me it's always UTF-8:confused:
I had an A+ for databases, so maybe we can figure something out;)
mysql these days is quite easy since of the ipkg script it executes:
if [ -d /opt/var/lib/mysql ] ; then
chown -R root:root /opt/var/lib/mysql
fi
fixes it for any user:)
Also I noticed mysql5 is available in the repository these days
Regarding PHPmyAdmin: Is very easy to install, just one small change to make it save and with password. But it's very helpful for non mysql-experts.
Indeed, I have it running, also great for quickly fixing overhead in the tables:)
Regarding lighttpd: I have no intention to write an other HowTo for lighty - yours is very good!
Regarding teamwork on your HowTo: sure, I thought to write a german at first and then to extend yours - if you aggree.
You know Wouter, I'm always happy to work together.
Must be my sloppy German;)
Sounds great! I was thinking of adding some extra things like ssl and secure login as well to the how-to. I even made webdav working, but the lighttpd implementation is far from complete.
I still have one problem to solve - it's MySQL related - sometimes MySQL will not start after a reboot - this would not be a real problem for me ;) , the much bigger one is that in such a case most of the database gets corrupted somehow. no log-entry nothing. This drives me crazy.... Maybe I try to change MySQL.
In any case, as soon as I achieve a stable installation, I'll contact you in order to put something together. Thanks again for your proposal to put the things together!
Stay tuned - will come back to you (hopefully) soon
Helmut
Not start? hmm.. never ran in that problem before, but I do know about corrupted tables, just a horror.
Especially with flashing new firmware I first shut down things like lighty and mysql to be sure nothing will become corrupted:)
I'll stay tuned;)
newbiefan
25-05-2011, 19:06
Really? for me it's always UTF-8:confused:
I had an A+ for databases, so maybe we can figure something out;)
mysql these days is quite easy since of the ipkg script it executes:
Hey, maybe you can figure out what I'm doing wrong:
- I use root instead of admin since several months
- Everything works fine ligthy, php, mysql, phpmyadmin
- just for safety I recreate the mysql database
1.) rm /opt/var/lib/mysql/mysql/*.*
rmdir /opt/var/lib/mysql/mysql
2.) /opt/bin/mysql_install_db
3.) reboot
4.) mysql -u root
5.) use mysql;
6.) update user set Password = PASSWORD('mypasswd') where User ='root';
7.) create database serendipity;
8.) grant ALL PRIVILEGES on serendipity.* to root@localhost;
9.) set password for root@localhost = password('mypasswd');
10.)flush privileges;
11.)exit;
Then I install and setup serendipity without problems, using database serendipity. Serendipity works fine.
Following questions:
How can I set the language in any database?
Do you see a reason why mysql starts normal, but sometimes not?
Usually mysql writes to log server.err: mysql started, ready for connection, used socket aso., but when mysql does not start, I get no message at all, just a corrupted database. Then I have to start again with removing database.....
Maybe the A+ makes the difference...:eek:
Would be nice to solve this issue.
Helmut
Following questions:
How can I set the language in any database?
Do you see a reason why mysql starts normal, but sometimes not?
Usually mysql writes to log server.err: mysql started, ready for connection, used socket aso., but when mysql does not start, I get no message at all, just a corrupted database. Then I have to start again with removing database.....
Maybe the A+ makes the difference...:eek:
Would be nice to solve this issue.
Helmut
Well you can try to create a database with a specific collate:
CREATE DATABASE dbname CHARACTER SET utf8 COLLATE utf8_general_ci;
Also you can enter this lines in my.cfg (config) under [mysqld]
default-character-set=utf8
default-collation=utf8_general_ci
or utf8_unicode_ci if you please
change the database collation en charset:
alter database dbname charset=utf8;
alter database dbname collate=utf8_general_ci;
You can also do this in myphpadmin: http://kb.mediatemple.net/questions/138/Default+MySQL+character+set+and+collation#gs
perhaps backup just to be certain:p
Not sure why you get a lot of corruption tho...
Do you have a lot of file corruption on your drive? I hope it's not a flash drive?:)
newbiefan
26-05-2011, 22:54
Well, seems like an A+ makes the difference.....you found out one of the main-probs within 30 minutes.
It took me several hours, just to figure out the problem of mysql - which is in my oppinion the stupid default charset setting to latin1_swedish - it would be so easy to ask during nstallation the desired charset, or to set it as default to utf8_unicode. Maybe I write a short script to change the language default settings of mysql after installation. A regular user want to install the applications, nothing else. Most of the users are no database gurus and they often have a very limited linux knowledge. In my point of view such cases are closing the door to beginners - I see it very problematicly - such a user give up and stay far away from linux forever.
Further, nobody wants to begin a study of a huge manual, they want to install it and forget - thats what makes microsoft successful and not a deep study of a manual just for one application. A usual user is simple not able to detect and determine the errors like a wrong used charset.
Seriously: I read several articles regarding howto change the default characterset of mysql.
When something gets corrupted, a way is to reinstall serendipity and database which seems to me to be the most easy way as long as your used database ist almost emty - this is during an install always the case. Further, when you alter the database to an other charset, it shows still the same content of the database (I read it in an article from the reference address).
Then you have to ensure, that the mysql-client which connects to the socket has the same charset. As the client runs in our installation on localhost, my.cnf needs an extra line (same as server) "default-character-set=utf8" and some more... see at the reference (Sorry, it's in german) http://www.gerd-riesselmann.de/softwareentwicklung/php-und-utf-8-eine-anleitung-teil-1-mysql and my my.cnf
Well, all this can be solved with the workaround by setting the use of serendipity database to "nativ" without playing around with mysql. But this is not really satisfying when you want to use german chars like äöüß - hence we need a utf8 character set in our database from the beginning. This was my guess, but I'm wrong - now I have everything in utf8 but it will not work proper - when saving something in serendipity with an öäüß (german chars) then I get a fatal error. So I made different settings again with mysql and so on......
Next thing is: seems luck is with me, maybe I figured out what causes the corrupted database; when installing serendipity with "tar -zxf filename.tar.gz" a folder is created with the rights of user 65534 and group 65534 (see at the pic!!) containing the complete serendipity. I missed this fact completly until today, because I'm user root and therefore I hav'nt waste even a second to this. Why I should use chown when I'm root? But anyway, I learned something the hard way: as long as you are using linux, always have a close look at the rigths of users, groups, folders and files, even when you are root.
It seems that this was the reason for the corrupted database - not at startup - during shutdown (is my guess, because only this is an
explanation for me, why the startscript has nothing written to logfile). To be honest, I still do not know exactly why, but since the change of owner from 65534:65534 to root:root it works perfectly, just without utf8. Have to test it for several days. I'm using serendipity-1.5.5-lite.tar.gz
Well Wouter, I proudly can announce that we shortly can extend your howto - only some tests with serendipity are necessary and maybe some small setups, particulary with sending email. And maybe we are able to solve the issue with utf8 too.
Thanks again, your teamplayer Helmut
Man, you made my day!
EDIT: The problem with charset is solved!!
newbiefan
07-06-2011, 15:40
Eine Anleitung für Email versenden (am Router) gibt es nun hier:
http://www.wl500g.info/showthread.php?t=26955
Für das Weblog System Serendipity gibt es in Kürze ebenfalls eine Anleitung.
Newbiefan
newbiefan
11-06-2011, 09:13
Probleme gelöst, das HowTo gibt es hier:
http://www.wl500g.info/showthread.php?t=27024
Viel Spass
Probleme gelöst, das HowTo gibt es hier:
http://www.wl500g.info/showthread.php?t=27024
Viel Spass
Looks great man!
I'll soon check it out:)