2021-09-19 13:23:16 +00:00
|
|
|
# website
|
|
|
|
|
|
|
|
your `~/public_html` directory is served at:
|
|
|
|
|
|
|
|
- tilde.cafe/~username/
|
|
|
|
- username.tilde.cafe
|
|
|
|
- tilde.cafe/u/username/
|
|
|
|
|
|
|
|
|
|
|
|
## dynamic options
|
|
|
|
|
|
|
|
static content are served normally, but there are also some dynamic options:
|
|
|
|
|
|
|
|
- php: `.php` extension
|
2021-10-10 20:00:06 +00:00
|
|
|
- CGI scripts
|
|
|
|
CGI script have been traditionally limited to any executable file in `/cgi-bin/`.
|
|
|
|
however, we've set them to also allow running from anywhere, as long as they're executable and end in `.cgi`, `.py`, `.lua`, or `.sh` extentions
|
2021-09-19 13:23:16 +00:00
|
|
|
|
|
|
|
<!-- TODO: add chmod in getting-started? -->
|
|
|
|
|
|
|
|
make sure the scripts have the correct shebang, is set as executable
|
|
|
|
and prints the content type header first.
|
|
|
|
|
|
|
|
|
|
|
|
### examples
|
|
|
|
|
|
|
|
**sh:**
|
|
|
|
|
|
|
|
#!/usr/bin/sh
|
|
|
|
printf "Content-type:text/plain\r\n\r\n"
|
|
|
|
echo "hello!!!"
|
|
|
|
|
|
|
|
**python:**
|
|
|
|
|
|
|
|
(you can of course write html in your cgi script too)
|
|
|
|
|
|
|
|
#!/usr/bin/env python3
|
|
|
|
print("Content-type:text/html\r\n\r\n")
|
|
|
|
print("<h1>this is a header</h1>")
|
|
|
|
|
|
|
|
<!--
|
|
|
|
**lua:**
|
|
|
|
TODO: seems lua has both cgi and also this thing called Lua Page?
|
|
|
|
-->
|
|
|
|
|
|
|
|
|
|
|
|
**php:**
|
|
|
|
|
|
|
|
<!-- TODO: better example maybe? -->
|
|
|
|
|
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<body>
|
|
|
|
<h1>here's a header</h1>
|
|
|
|
<?php echo "this will be shown"; ?>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
you can use your `public_html` to write a blog! check out the [blogs](blogs.html) page for more info.
|
|
|
|
|
|
|
|
<!-- TODO: custom domains? -->
|