How does github pages serve files? - html

My understanding on how Web hosting works is that you require some sort of technology to serve content, even if it's just an HTML file. I thought that simply putting an html file on a server running nothing at all (no Apache, etc), and going to {server_ip}/path/to/.html will not serve it over http.
So I've Googled and to no avail, I cannot find out what technology github pages is using to serve static pages

A server by definition is a program, not a computer. You put an HTML file on a computer, not a server.
Github use pretty sophisticated technology, not a single server. You can read about that here.

Related

Updating my website/ web hosting?

I'm new to web design and website deployment. I had some general questions that I tried to research but failed. I know how to use Html/CSS/Javascript and I managed to design my own website and upload it and host it using Amazon s3 / Route 53. It's a website built from scratch with HTML, CSS.
The thing that I have failed to understand is managing the website after deployment. Do I simply add HTML pages to my amazon bucket whenever I want to update? is this the way to do it? I came across jekyll in my research and from what I understood, it's a static website generator. But does it help with organizing the website and facilitating adding more content after deployment?
in other words, how do developers go about managing their websites generally after deployment?
I don't know about the Amazon s3 or jekyll etc. How I manage my sites is I use a hosting provider that provides Plesk. With Plesk I manage all my files for my sites in the file manager and I can even edit the code in the online code editor provided. It also has built in apps like Joomla and Wordpress.
I can set up email addresses for each site and also subdomains. Security etc.
When I want to update or edit my site I will either do it in the online code editor if it is something small like changing a color or just a few lines of code. Otherwise for bigger edits I will do it all on my desktop using notepad and then upload all the new files and replace the existing ones.
Each domain has it's own folder in the directory so it is easy to maintain and things don't get messy.
I hope this helps. You said you want to know how developers manage their sites. Although I am not a professional developer, I do have a few sites and that is how I manage them.
It only costs £40 per year too so is quite cheap.
Do I simply add HTML pages to my amazon bucket whenever I want to update? is this the way to do it?
Yes. The simplest way is to make changes to your files in your local workspace and then upload/overwrite the changed files to the S3 storage.
But does [jekyll] help with organizing the website and facilitating adding more content after deployment?
Yes! Jekyll is a great way to organise and generate your static site and I highly recommend it if you are planning to continue creating and deploying content to your site.
Start here, but note that it's a little more difficult if you're on Windows OS.
https://jekyllrb.com/docs/installation/#requirements

Easiest way to deploy an html page on a web server

I have an html file that I use to extract a locally stored sqlite database file's informtaion, using some easy javascript.
Now I want to access this web page through http protocol (not file:/// scheme).
What configuration do you recommend to easily realize this manoeuvre ?
Thank you in advance.
Your question is lacking, but in general you want a webhost or setup your own computer for external connections.
I recommend finding a simple hosting site and learning the procedure from there.
From the command line, navigate into your project folder, and run:
python -m SimpleHTTPServer
You can then open http://localhost:8000 in your browser, to view your page using the http:// protocol.
(I don't think this will work if your HTML file is actually PHP, which given that your description includes databases, it sounds like it might be. In that case, I would download something like MAMP.)
This answer assumes you're just trying to use the http:// protocol to test your page locally - like the other solution says, if you want to deploy your page so other people can see it, you'll need to find web hosting.

What is a static site generator?

After ditching Wordpress, I've been experimenting with Jekyll to create a blog. I chose it (over Ghost) to help learn the basics of web development while I blogged. Also, the free hosting on GitHub Pages is neat and free.
What exactly is a static site generator (like Jekyll), and why do they exist?
From Build a Blog with Jekyll and GitHub Pages course on Treehouse:
A static-site generator takes a set of templates and raw text files, runs it through a converter and renderer, then generates a plain HTML website that's ready to publish on any web server.
Advantages:
Sites load fast since we're serving regular pages to the browser and don't need to talk to a database on each request.
Sites are more secure because there's no database or dynamic content that can be hacked.
Less maintenance involved. No database means no need to configure and maintain a database or content management system (CMS).
Free hosting on GitHub Pages
Use your own domain name
Course Link: https://teamtreehouse.com/library/build-a-blog-with-jekyll-and-github-pages
A static site has 3 components:
HTML files (or other content to serve via the web, like .txt files)
referenced assets (js, images, css)
a web server
There is no database from which data is retrieved, compared to something like wordpress where all of your posts and pages live in a database. There is no server-side scripting engine with which to process information and render content.
Static site generators exist to provide you with tools like templating, shared data, and custom tags to assist in the creation of the static HTML pages that your web server will be serving.
The benefits of a static site are:
Security. The web server is the only moving part.
Portability. The HTML files will render the same when served from your local machine as they will on the web.
Speed. When almost everything is cacheable, compressed, and doesn't require any data crunching, things load very fast.

Spring web development advice

At the moment I'm learning spring and have the basic website running now on tomcat. Can I ask, how do you load images onto the website now and where do you store the images, css, javascript etc in your project folder?
The answer depends a lot on your development/deployment environment. If you are using Maven for example, which has a specific directory layout, you would put the files in src/main/webapp/.
If you are using Eclipse as your IDE and use Ant to build your project, you would normally use WebContent/.
In any case, I would advise to use specific folders for each type of file. You can still use Tomcat Filters, if you want to influence the headers that are sent with the files. (Important for caching, ...)

Creating HTML according to files existence in the file system

I am writing a web application (I am a newbie), where the markup is created by XSL and XML transformations and the style is declared by css files and also some use of JavaScript. I need to create a web page that part of its content is the information on files in a specific directory in the file system.
Any ideas?
Are you talking about the client's file system, or the server's?
If the client's, what you are asking is basically impossible for security reasons without some specific browser plugins/extensions (like a java applet with the right access) - you probably don't want to get into that.
If you are talking about the server file system, you will need some sort of server side language to read the file(s) and return them to browser requests. The sort of things that do that are PHP, ASP.NET, Ruby on Rails, etc...also look into Server Side Includes - that may be sufficient for your needs.
Do you mean the client's filesystem or the server's filesystem? If it's the client's, these tools are inadequate (as access to the client's OS is severely restricted for security purposes). I think most people go with a Java applet for stuff like that.