Setup ChimeMUX + MediaWiki on Digital Ocean
-
So things have changed. Things have changed a lot. The "Zero to Mush (with wiki)" is still good, but it's changed and gotten messy with exceptions.
So here's my instructions, partially for myself, on how to set up ChimeMUX (what I call the experimental Chime fork of TinyMUX) on Digital Ocean.
This is not a static post, but I will try to update the thread with what changes have been made.
Get the right Digital Ocean account
For this tutorial, it's going to be the LAMP account.
https://www.digitalocean.com/products/one-click-apps/lamp/Start with the $5/mo account.
Make a Game Account
In my extremely strong opinion, you should not use 'root' for the game. There are a few reasons for this, but the main is that: It's root.
(The secondary is that an account for the game makes it easier to manage.)
Log in to your account as root then do this thing:
sudo adduser <username> sudo adduser <username> sudo
Then log out of root and log into your user. Do as much as you can from the user.
I'm aware that creating an account with super-user abilities is not a whole lot better than using root, but it's cleaner and easier to see what's going on. The rest of this tutorial is going to assume you've done this.
Get ChimeMUX
There's a few steps here because while LAMP has almost everything you need, there are a few packages that won't be there.
sudo apt-get install build-essential gcc make bison libpcre3-dev libmysqlclient-dev
(
bison
is for Omega, which while isn't compiled by default, it can be an important tool for doing some deeper Mux things.)I believe the game should have its own account. For this type
sudo adduser <username> sudo
and then re-log in with that account.Either way, at this point you just need to follow the directions from Chime's GitHub and you'll be fine: https://github.com/lashtear/tinymux
Mostly fine. You need to open the port in the firewall:
sudo ufw allow <game port>
If the game hasn't been started yet, do so now. Log in. You're done.
Important Tidbit: The initial login for #1 is:
connect wizard potrzebie
Configure MySQL
You're going to have to engage MySQL without a password. As Surreality says below, the default install has no password for root. That's fine, because you can do this:
sudo mysql
Now you'll need to make a database for the game, and an account for the Mux to log into that database. From within MySQL:
CREATE DATABASE <gamename>_db; CREATE USER '<acct_name>'@'localhost' IDENTIFIED BY '<password>'; GRANT INDEX, CREATE, SELECT, INSERT, UPDATE, DELETE, ALTER, TRIGGER, LOCK TABLES ON <gamename>_db.* TO '<acct_name>'@'localhost';
You can, of course, change this however you want.
Check that you did well:
SHOW GRANTS FOR '<acct_name>'@'localhost';
Type
exit
to get out of MySQL.
Link TinyMUX to MySQL
cd ~/game pico etc/netmux.conf
Somewhere near the bottom, or even at the bottom:
## database ############################## sql_server localhost sql_database <gamename>_db sql_user <acct_name> sql_password <password>
If your game is running,
@restart
it if not,bin/mux-start
it.Log into the game.
Type the following:
think sql( select 1 )
If everything went well, you'll get a response of '1'. Congrats! You have SQL!
Set Up MediaWiki
A lot of the system is already set up. Digital Ocean does have a "how to set up MediaWiki" page but it's out of date. Right now, here's what you need to do to seal the deal:
sudo apt-get install php-intl sudo apt-get install php-gd sudo apt-get install php-xml sudo apt-get install php-mbstring sudo service apache2 restart curl -O http://releases.wikimedia.org/mediawiki/1.31/mediawiki-1.31.1.tar.gz tar xvzf mediawiki-1.31.1.tar.gz sudo mv mediawiki-1.31.1/* /var/www/html
It's really too bad that there's no easy link to 'most recent stable', but hey. By the time you read this, there will probably be a newer version.
Now check your web site for the "LocalSettings.php not found." message and click on that link below it: "Set up your wiki."
Here are the things to change from default:
Database name: <gamename>_db
Database table prefix: wiki_
Database username: <acct_name>
Database password: <password>The "name of the wiki" and "administrator account" is up to you.
I also suggest turning on "Account Authentication" & "File Uploads". I forgot to record what other good ideas are in there. (Such as 'Cite' and 'Poem'.)
Now the hard part: The wiki setup will give you the LocalSettings.php file. Upload that to /var/www/html/ and, once it's in there, the following critical steps:
cd /var/www/html/ sudo chmod o-r LocalSettings.php sudo chown -R www-data:www-data .
Your Wiki is now set.
<I hope. Further instructions to follow.>
-
The hero we need!
-
There is a new hurdle on DigitalOcean with this one, which appears after you do the mysql_secure_installation step. Not sure how new it is, but it definitely is a thing that is.
The 'step three' in this tutorial is necessary to allow the wiki to communicate with the MySQL database unless you create a separate wiki user, and don't use root. You may want to use a separate MySQL user for the wiki, but if you don't, you will need to follow these steps to allow the wiki to communicate with MySQL. If you don't, root wouldn't connect (as of this morning), but this change did fix it immediately.
https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-18-04 -
$5 a month is super fancy. Following for setup halp, and patiently await the guide to kidna... I mean, hire a coder.
-
LAMP should have MySQL installed and ready to go already. I will put a placeholder in the guide to remember to check it out.
-
@thenomain It is installed -- it's just installed as shown there, with step three being essential if you want a wiki to run, since in the wiki install process, you have to feed it a MySQL password.
If you use root, which is the default for wiki installs, it'll glitch hard with no explanation, and it's due to that step three condition in the tutorial. (It may do this with non-root accounts as well by default.) It kept insisting it could not, would not, not with a goat or in a moat, connect to MySQL until that adjustment was made, on a default install of the LAMP droplet. So, welp, another hoop. Found out the hard way yesterday.
-
Some @Thenomain should just set up a server running TinyMUX empty and then clone images to anyone who wants one.
-
@skew Unfortunately Digital Ocean doesn't let you just tuck away an image to make clones for people easily like that. It's kinda annoying the way they have it set up,
and it costs you $5/mo to keep the base "master clone" server active. (ETA: Apparently they fixed that; you can now keep a snapshot around without the master. It's still kinda a pain to use though IMHO.) -
@faraday Yes and no. You can save snapshots of a droplet that you can create a new droplet from at any time, and they're pennies a month to store.
You'd want to take a couple of snapshots at a time between rounds of spinning it up if you want to hand them out, though, since you can hand off a snapshot that someone else can then spin up as a droplet -- but once you hand it off, you no longer have that copy yourself to work with. It doesn't clone it to them, it transfers full ownership of that particular snapshot to the other party.
I pull stuff up and down a lot in the short term to grab this or that off of an old experiment (of which there are many), so can confirm it's really not that bad.
-
@surreality said in Setup ChimeMUX + MediaWiki on Digital Ocean:
@faraday Yes and no. You can save snapshots of a droplet that you can create a new droplet from at any time, and they're pennies a month to store.
Yes, but I've done it for Ares as well and it felt more like a PITA. Creating the cloned snapshot (so you don't lose your original), waiting for them to accept ownership (and you get charged for the snapshot in the meantime), etc. Also sometimes they change plans, and your snapshot gets associated with a different cost tier... it's not as simple as it should be IMHO. YMMV obviously.
-
@faraday @surreality Oh, boo. I thought you could just keep the snapshot and continually hand it out.
Then, yeah, probably the best way would be to keep the "blank" TinyMUX-with-Wiki game droplet sitting there, doing nothing at all (except getting code updates as necessary). But that's surely an investment.
-
What about using the mocker/docker solution like this guy/gal brought up in the past?
https://www.musoapbox.net/topic/2078/mocker-complete-tinymux-setup-with-docker
-
@thatonedude said in Setup ChimeMUX + MediaWiki on Digital Ocean:
What about using the mocker/docker solution like this guy/gal brought up in the past?
I don't know. The post links to a .tgz file and while I would like to think there's instructions in there, I'm posting my existing experience to help others.
-
Updated SQL section quite a lot.
*** UPDATE ***
If you used the previous method, please @shutdown, run the extended
sudo apt-get
, then follow the ChimeMUX installation instructions again.The SQL dev binaries weren't installed.
-
Update
Base MediaWiki instructions are in. I had to update the instructions on creating the mySQL account in order to complete it without being confusing.
I would like a section on "best-practices wiki setup", as well as some of the most critical wiki plugins for our hobby, if anyone has suggestions.
Thanks.
-
Extensions I won't do without:
https://www.mediawiki.org/wiki/Extension:Page_Forms - not preinstalled
https://www.mediawiki.org/wiki/Extension:DynamicPageList3 - not preinstalled
https://www.mediawiki.org/wiki/Extension:ParserFunctions - preinstalled (enabling string functions is also useful)Extensions I find useful:
https://www.mediawiki.org/wiki/Extension:MagicNoCache - not preinstalled
https://www.mediawiki.org/wiki/Extension:Variables - not preinstalled
https://www.mediawiki.org/wiki/Extension:CollapsibleVector - not preinstalledMrph: (none preinstalled)
https://www.mediawiki.org/wiki/Extension:Arrays - very useful, but not currently maintained, mostly useful to automatically calculate dates/time periods with: https://www.mediawiki.org/wiki/Extension:DateDiff
https://www.mediawiki.org/wiki/Extension:Header_Tabs - I like this one, y'all may not. Not necessarily easy to work with re: custom styling, as it is fussy. -
@surreality said in Setup ChimeMUX + MediaWiki on Digital Ocean:
https://www.mediawiki.org/wiki/Extension:ParserFunctions - preinstalled (enabling string functions is also useful)
Yeah, ParserFunctions is now one of the things you can install by default.
And String Functions isn't useful, it's goddamn mandatory. This is the one I was hoping to be reminded about.
"DPL3" being the other one.
Thanks.
-
I’m told by @skew that the
curl
doesn’t always work or stopped working or something. I will trywget
as mentioned here when I can: https://www.howtoforge.com/tutorial/how-to-install-mediawiki-on-ubuntu-1804/#install-mediawiki -
resurrecting this thread!
I'm getting some errors, not sure if this is something to do with the LAMP stack I've got on digital ocean.
root@chimemux:/tinymux/mux# make -j2 make all-am make[1]: Entering directory '/tinymux/mux' CXX game.o CXX levels.o game.cpp: In function ‘void init_sql()’: game.cpp:2423:6: error: ‘my_bool’ was not declared in this scope 2423 | my_bool reconnect = 1; | ^~~~~~~ game.cpp:2424:71: error: ‘reconnect’ was not declared in this scope; did you mean ‘connect’? 2424 | mysql_options(mush_database, MYSQL_OPT_RECONNECT, (const char *)&reconnect); | ^~~~~~~~~ | connect game.cpp: In function ‘void do_shutdown(dbref, dbref, dbref, int, int, UTF8*, const UTF8**, int)’: game.cpp:1278:18: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result] 1278 | (void) mux_write(fd, message, static_cast<unsigned int>(strlen((char *)message))); game.cpp:1279:18: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result] 1279 | (void) mux_write(fd, ENDLINE, sizeof(ENDLINE)-1); make[1]: *** [Makefile:1567: game.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make[1]: Leaving directory '/tinymux/mux' make: *** [Makefile:1023: all] Error 2
and ...
root@chimemux:/tinymux/mux# make install make install-am make[1]: Entering directory '/tinymux/mux' CXX game.o game.cpp: In function ‘void init_sql()’: game.cpp:2423:6: error: ‘my_bool’ was not declared in this scope 2423 | my_bool reconnect = 1; | ^~~~~~~ game.cpp:2424:71: error: ‘reconnect’ was not declared in this scope; did you mean ‘connect’? 2424 | mysql_options(mush_database, MYSQL_OPT_RECONNECT, (const char *)&reconnect); | ^~~~~~~~~ | connect game.cpp: In function ‘void do_shutdown(dbref, dbref, dbref, int, int, UTF8*, const UTF8**, int)’: game.cpp:1278:18: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result] 1278 | (void) mux_write(fd, message, static_cast<unsigned int>(strlen((char *)message))); game.cpp:1279:18: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result] 1279 | (void) mux_write(fd, ENDLINE, sizeof(ENDLINE)-1); make[1]: *** [Makefile:1567: game.o] Error 1 make[1]: Leaving directory '/tinymux/mux' make: *** [Makefile:2144: install] Error 2```
Any suggestions? The ./configure --prefix=$home/game worked just fine.
Edit: I was able to get past this by changing the my_bool line to just
bool
andreconnect
toconnect
. However, it still hasn't created the /game folder. -
I've blathered about this to Theno on Discord, but figured I'd catalog here.
Soma — Today at 9:16 AM
Okay, so! The LAMP route didn't matter and I was able to get my non-root user to work with it. After digging through some stack exchange posts, it looks like SQL no longer uses the my_bool function, it's just bool. I adjusted the reconnect function to just connect and it processed through which is interesting because usually connect can't be declared in scope. So, it processed through with warnings but didn't error out. However, it didn't create the game folder. I'm wondering if this has something to do with the size issue. I'm not sure if you're still in contact with Chime, but this might be some feedback for her about the directions in her distro -- at least some feedback on the directions for getting ChimeMUX working on a LAMP stack in Digital Ocean.Soma — Today at 10:03 AM
All right, found mux-start but it says it can't open the script.conf file, which is pretty weird. Permissions are fine. For some reason the mux server got installed in the root directory, so I wonder if that has something to do with it. Maybe the mux-start command doesn't have root access.Edit: It got figured out. For posterity's sake, you have to run the command from ~/game:
cd cd game bin/mux-start
Thenomain explained that the reason for this was because Chime intended for there to be the option to run multiple instances of TMux from the same server.