21 Website hosting
dragongoose edited this page 2023-07-06 17:59:53 +00:00

exozyme offers free static and dynamic website hosting with exopages, similar to GitHub pages but better!

Static hosting

Greetings, exozyme user! So you want to create a nice, clean website, but are poor and pathetic? Lucky for you, exozyme has got all you need!

1. Settling on a name

Ideally, you want a name that will stand out. I usually go with my username, like 2kwatts.exozy.me, but if you're making it for a project, you can use that instead. (You have unlimited choices!)

2. The back-end basics

SSH into exozyme, then travel over to /srv/http/pages. After that, make a directory. Title it the name you decided in the previous section, as long as it's not taken. Once that's done, enter it and run touch index.html. This will create the main page for your website. So when people travel there, they will see this file by default.

3. Writing the website stuff

Using your favorite text editor, open up the file. Assuming you have some basic HTML knowledge, you should know what to do here. Once you're done writing mindless code for now, save and quit the file. Now open your site in a web browser. It will be something like your foldername.exozy.me.

Now, thanks to exozyme and @megawatts, you have your own Internet place where you can do whatever you want!

TL;DR: If you create a directory with files for your static website at /srv/http/pages/subdomain, the website will be available at subdomain.exozy.me.

Dynamic hosting

The ports 4200 to 4209 are proxied to the domains https://0.exozy.me to https://9.exozy.me. You can also create a Unix socket called /srv/http/pages/subdomain with permissions 660, which will be proxied to https://subdomain.exozy.me. If your website only supports binding to a TCP port but you would like it to bind to a Unix socket, you can use socat UNIX-LISTEN:/srv/http/pages/subdomain,mode=660,fork TCP:localhost:1234. This proxies all requests to https://subdomain.exozy.me to your website hosted on port 1234. To run your website automatically, you should write a systemd user service. If you need a more complex web server configuration than just simply proxying a port, you can submit a pull request to our nginx config file repository.

If you're using podman-compose to run containers, you can use this workaround expose a port to a unix socket:

  tcptosocket:
    image: docker.io/alpine/socat:latest
    environment:
    command: "UNIX-LISTEN:/mnt/<SERVICE_NAME>,fork,mode=660 TCP4:<CONTAINER_NAME_TO_FOWARD>:<CONTAINER_PORT>"
    volumes:
      - /srv/http/pages:/mnt

This uses an alpine container with socat installed, and creates the socket in the pages directory

Custom domains

If you would like to use a custom domain for your exopages website, add a CNAME, ANAME, or ALIAS record in your DNS settings to point your custom domain to exozy.me. Make sure you point your domain to exozy.me and not our IP address, since our IP address changes occasionally. Now fork our nginx configs repo and write a nginx config file (see the config for karawale.in as an example). Send a PR and we'll merge your config file. Finally, shoot us a message on Matrix to generate TLS certificates for your domain, and you're done!