Skip to content

Meatloaf Server Setup and Configuation

datarunners edited this page Jan 20, 2024 · 12 revisions

One of the powerful features of the Meatloaf project is the ability to host files on your own server. You would only need some accessible server space and a web server running Apache or IIS. IIS configurations require PHP.

This is only needed if you want to host files on a server. This isn't required for using a Meatloaf device.

The Server Script

Download this PHP script and place it in the folder where your program files are located. Rename the script to index.php

Server PHP Script

Apache

Add the following entries to the .htaccess file and place it in the root of your web server. This will also add Meatloaf's supported mime types

RewriteEngine on
RewriteCond %{REQUEST_FILENAME}/index.prg -f
RewriteRule ^(.*)$ $1/index.prg
RewriteCond %{REQUEST_FILENAME} -d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*$ /index.php [L,QSA]
AddType application/octet-stream .bas .prg .p00
AddType application/octet-stream .bin .rom .crt
AddType application/octet-stream .bbt .d8b .dfi .rp9
AddType application/octet-stream .d64 .d71 .d80 .d81 .d82 .d90 .dnp
AddType application/octet-stream .g41 .g64 .g71 .nib .nbz
AddType application/octet-stream .t64 .tcrt .tap .htap

IIS

IIS can be configured using the IIS manager program, CPANEL on your host or you can utilize the web.config file located in the root directory. Edit the file and include the following within the <system.webServer> section.

<staticContent>
        <remove fileExtension=".d64" />
        <mimeMap fileExtension=".d64" mimeType="application/octet-stream" />
        <remove fileExtension=".bas" />
        <mimeMap fileExtension=".bas" mimeType="application/octet-stream" />
        <remove fileExtension=".prg" />
        <mimeMap fileExtension=".prg" mimeType="application/octet-stream" />
        <remove fileExtension=".p00" />
        <mimeMap fileExtension=".p00" mimeType="application/octet-stream" />
        <remove fileExtension=".bin" />
        <mimeMap fileExtension=".bin" mimeType="application/octet-stream" />
        <remove fileExtension=".rom" />
        <mimeMap fileExtension=".rom" mimeType="application/octet-stream" />
        <remove fileExtension=".crt" />
        <mimeMap fileExtension=".crt" mimeType="application/octet-stream" />
        <remove fileExtension=".bbt" />
        <mimeMap fileExtension=".bbt" mimeType="application/octet-stream" />
        <remove fileExtension=".d8b" />
        <mimeMap fileExtension=".d8b" mimeType="application/octet-stream" />
        <remove fileExtension=".dfi" />
        <mimeMap fileExtension=".dfi" mimeType="application/octet-stream" />
        <remove fileExtension=".rp9" />
        <mimeMap fileExtension=".rp9" mimeType="application/octet-stream" />
        <remove fileExtension=".d71" />
        <mimeMap fileExtension=".d71" mimeType="application/octet-stream" />
        <remove fileExtension=".d80" />
        <mimeMap fileExtension=".d80" mimeType="application/octet-stream" />
        <remove fileExtension=".d81" />
        <mimeMap fileExtension=".d81" mimeType="application/octet-stream" />
        <remove fileExtension=".d82" />
        <mimeMap fileExtension=".d82" mimeType="application/octet-stream" />
        <remove fileExtension=".d90" />
        <mimeMap fileExtension=".d90" mimeType="application/octet-stream" />
        <remove fileExtension=".dnp" />
        <mimeMap fileExtension=".dnp" mimeType="application/octet-stream" />
        <remove fileExtension=".g41" />
        <mimeMap fileExtension=".g41" mimeType="application/octet-stream" />
        <remove fileExtension=".g64" />
        <mimeMap fileExtension=".g64" mimeType="application/octet-stream" />
        <remove fileExtension=".g71" />
        <mimeMap fileExtension=".g71" mimeType="application/octet-stream" />
        <remove fileExtension=".nib" />
        <mimeMap fileExtension=".nib" mimeType="application/octet-stream" />
        <remove fileExtension=".nbz" />
        <mimeMap fileExtension=".nbz" mimeType="application/octet-stream" />
        <remove fileExtension=".t64" />
        <mimeMap fileExtension=".t64" mimeType="application/octet-stream" />
        <remove fileExtension=".tcrt" />
        <mimeMap fileExtension=".tcrt" mimeType="application/octet-stream" />
        <remove fileExtension=".tap" />
        <mimeMap fileExtension=".tap" mimeType="application/octet-stream" />
        <remove fileExtension=".htap" />
        <mimeMap fileExtension=".htap" mimeType="application/octet-stream" />
</staticContent>   

If adding mime types within the the IIS manager or CPANEL, add the following types as "application/octet-stream" (binary files)

.bas .prg .p00 .bin .rom .crt .bbt .d8b .dfi .rp9 .d64 .d71 .d80 .d81 .d82 .d90 .dnp .g41 .g64 .g71 .nib .nbz .t64 .tcrt .tap .htap

Testing and Troubleshooting

After the script is installed and the mimetypes set up, you can now utilize your server. Copy some files to the directory where the script lives and start playing! The following will load a directory listing of supported files on your server:

LOAD "https://<your-server-name>/<your-file-directory>",8

Note: Soon you will be able to add a short name to the Meatloaf master listing to allow easier access to your server. Stay Tuned.

Verify Your Mime Types

To verify that your mime types are installed correctly, drop a .d64 or other supported type into your files directory. You should be able to directly link to the file via your server, which will attempt a download from your browser. If you get a 404 error, your mime types may not have been enabled.

If you get stuck, jump on the Meatloaf discord for assistance.