Web Server on a Nintendo Wii

原始链接: http://wii.sjmulder.nl/

Hacker Newsnew | past | comments | ask | show | jobs | submitloginWeb Server on a Nintendo Wii (sjmulder.nl)17 points by adunk 2 hours ago | hide | past | favorite | discuss help Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact Search:
相关文章

原文
Sijmen’s Wii

Wouldn’t you believe it, this site is running off my special home server: a Nintendo Wii with a 729 MHz PowerPC CPU and a whopping 64 MB usable RAM! It runs NetBSD 10.1 and serves this site exclusively over IPv6 – clients connecting through IPv4 are proxied via another server.

See Alex Haydock’s blog post that inspired this.

Also available on Gopher: gopher://wii.sjmulder.nl (proxy)

Network trouble

The only trouble I encountered while setting this up was with networking. I had originally purchased a UGREEN USB 2.0 Ethernet Adapter, which uses the AX88772A chip which supposedly works with the Wii, but it didn’t work in the Wii Menu (also not in the other USB port), nor in NetBSD where the axe driver repeatedly printed error messages about invalid buffers.

So instead I got the TP-Link USB 3.0 Gigabit Ethernet Adapter which uses the ubiquitous and widely supported Realtek 8153 chip. It’s not supported by the Wii Menu, but that’s fine – it works perfectly in NetBSD.

Setup

A fairly basic NetBSD 10.1 installation. I set up binary packages from pkgsrc:

wii# export PKG_PATH=https://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/powerpc/10.1/All
wii# pkg_add pkgin
wii# pkgin install git tmux fastfetch nostt ...

For the IPv6 address, normally NetBSD assigns a link-local address and uses router solicitation to assign a rotating outbound privacy address and a more static local inbound address. But I needed a fixed publicly routable address, so in /etc/ifconfig.ure0:

inet6 2a02:a45f:8eaa:0::2/64 alias
rtsol

This assigns a static alias, using my ISP-assigned prefix and ::2 as the identifier (I use ::1 for something else). The rtsol directive keeps the router solicitation for the dynamic addresses and routing.

Then I opened port 80 for that IPv6 address on my router and added an AAAA record for it at my domain registrar.

Some tweaks in /etc/rc.conf:

# disable some things we don't need
ntpd=NO
mdnsd=NO
postfix=NO

# web server
httpd=YES
httpd_wwwchroot="/var/www"
httpd_wwwdir="/htdocs"
httpd_vhost="wii.sjmulder.nl"

This uses some variables I added to /etc/rc.d/httpd to use httpd’s chroot and vhost features:

...
httpd_wwwuser_arg=${httpd_wwwuser:+-U \'$httpd_wwwuser\'}
httpd_wwwchroot_arg=${httpd_wwwchroot:+-t \'$httpd_wwwchroot\'}
command_args="$httpd_wwwuser_arg $httpd_wwwchroot_arg -b '$httpd_wwwdir' '$httpd_vhost'"
required_dirs="$httpd_wwwchroot$httpd_wwwdir"

run_rc_command "$1"

For IPv4 access, my single IPv4 address’ HTTP port was already used for another homeserver. I pointed the wii DNS A record to it and set up proxying in its Nginx configuration:

server {
	listen 80;
	server_name wii.sjmulder.nl;

	location / {
		proxy_pass http://[2a02:a45f:8eaa::2]
	}
}

This means that IPv6 clients connect directly to the Wii’s web server over the internet, but IPv4 clients go through this intermediary.

For Gopher, first, install the server:

wii# pkgin install geomyidae
Copy the example RC file as prompted. Then in /etc/rc.conf:
geomyidae=YES
geomyidae_flags="-c -b /var/www/gopher"

Note the use of -c for chroot, and the custom directory – this was so it could live under the git-versioned /var/www. Then start it:

wii# /etc/rc.d/geomyidae start

Plans

First I’ll need to deal with some basics:

  • IPv4 connectivity for those with an ISP stuck in the 1900s. Probably with an HTTP proxy or such. – done!
  • HTTPS

Before you say: what about a reverse proxy?, I feel that defeats the purpose. It’s fun that your browser gets to talk to the Wii directly. I’ll figure out a way to deal with IPv4 better.

Then, not sure what I’m going to use this for. SSH and web, sure, but that’s a bit basic. Maybe write or run a fun little web application to show that you don’t need 16 cores and 64 GB of RAM for some CRUD site.

Thoughts or comments? Drop me an email or message me on Mastodon!

—Sijmen J. Mulder, 2026

联系我们 contact @ memedata.com