Run Service with Your Linux Machine
Table of Contents
1. Blogging
The most common usage of Linux, I bet you have heard of,
must be headless server.
While that is true, you can actually host website safely on your machine as well.
And blogging, much much easier to achieve on Linux than on Windows,
thanks to the native support of terminal usage.
No matter whether you want to ultilize free platforms like Github Pages or serve on your own infrastructure.
Well, a server should be on 7/24, but my personal computer couldn't, you might wonder.
Indeed true, but it would be as easy as a good old rsync command to deploy the test content on your pc to the production ready server, given they are kept in the same format.
Imagine you can read your blog on http://localhost:8080/ in browser,
test the view on mobile phone with http://myoldpc.local:8080/ ,
when satisfied, rsync, boom!
Now it lives at https://hufufu.com/ , cool!
Below I would like to explain how.
Let's say you do not happen to have a Linux VPS, but it does not hurt to me assuming you have a free Github account.
Open my project about easy blogging with org-mode in browser,
click "Fork" to create your own writtable repo.
Now you have 2 choices:
- clone your fork locally as suggested by Github
better choice when we got some familarity with linux later - just edit and save on Github
if you have no experience with git, just go this way, not powerful but really convenient
Try modify the index.org a bit, common markups from org has been shown.
After the github action is finished, you might need to enter setting of the project, click Page then select deploy from branch gh-pages.
Wait for a little time, you should be able to visit your webpage at https://your-github-username.github.io/your-fork-name now!
A static website, static assets as is, html from org markups, hassle-free generating and hosting…wow, I could not think of a simpler way!
However, guess what, I myself do not use that project to write blogs!
Not because my work is actually bad, if someday I need to make a static website for free, I would love to go the org-focus way.
The real reason is I just don't want to put everything on GitHub, as managing my own VPS is kinda fun,
which of course does not have service like Github Page available.
My goal of that project is making blogging like blogging, with descent default settings,
bloggers should never be asked to care about stuff other than blogging itself!
Which means the following:
- I don't have VPS nor home server
for starters, just GitHub Page is fine - html syntax is so exhausting to type
no longer required as we can write in org - emacs org export/publish to html? what complexity to setup
for org-focus users, there is no need to worry since the building process is hidden in two other repositories.
However, css stylesheet and config.el are totally customizable, full freedom provided. - no verdor lock
while GitHub might someday shutdown (which means the project would gone foever as the main logic is specified to Github Action)
your content remains safe as they are just a git repo with org files and some static assets.
As long as your repo is cloned locally, you can easily combine it with vorgum,
the local version of this which is intended to be executed on a real machine with emacs.
With some tweaks to build.el, especially the org-html-head variable,
exactly the same static website could be generated as the Github Action one in public folder, servable with any static hosting solution. - free and open source
org-focus is unliscenced as it is just a small template repo for GitHub users, just use it as freely as you can.
vorgum is a fork of systemcrafters' project, so under MIT liscence as the original one.
2. Local Service
For local website hosting, you need a web server, and easily as it heards, python3 -m http.server or python -m http.server from terminal
would spawn such stuff in the current folder.
visiting http://localhost:8000/ would show the index.html content or the folder content if index.html absent.
3. Next or End
If you don't have ambitious to dig deeper in the terminal world, you can safely stop here.
The content coming later would not be useful or even required unless you are interested in NAS, selfhosting SIP or so on.
Yes, in case you read till here just to use linux for surfing internet, watching videos and play some games, time to say goodbie now.
Wish those a happy time using linux daily!
Later on, I would like to share some tips or common ways of interacting with servers, at home or remotely rented.
Including more detailed and powerful selfhosting, and some security guideline to lower your possibility of being hacked.
That would mark another tutorial, so see you later, good luck.