OK I found this one, small enough, but where does it install to? can’t find the app, of any files of anything.
Being a total novice to Linux stuff….where is this file located and why don’t they prompt you for a folder location of the program? And why such a stupid name? Dozens to choose from and most over 300MB, not what I want - I just want Apache to run the index.html webpage or the index.php webpage. I do not need Javascript or Java programming editors….
@off_grid_living@twtxt.net Normally you would so something like this on Ubuntu:
sudo apt install apache2
In fact I highly recommend you follow this guide:
@off_grid_living@twtxt.net There are probably many extensions for Apache2. Nearly all of which you don’t need. Maybe libapache2-mod-php*
if you want to make use of PHP.
Typically, systemd will automatically start your webserver during system startup. Your package manager (apt
) does not prompt you, because the package maintainer has chosen some defaults for you which works with the rest of the system. So there is simply no need. Why would you want to change the installation directory anyways?
Also, right after installation, I’d assume that Apache2 is automatically started. If you want to start Apache2 by hand, you can sudo systemctl start apache2
, there are also the stop
and restart
verbs.
The tutorial linked by @prologic@twtxt.net seems a bit outdated to me (old Ubuntu version and SysVInit), you might be better off with: https://ubuntu.com/server/docs/how-to-install-apache2 Even though, that’s probably also not so beginner-friendly.
@off_grid_living@twtxt.net Normally, in the days when I used to run Linux on the Desktop and used Apache once upon a time, the default configuration would mean files served out of your public_html
directory in your home directory was the place where the web server looked for to serve files from. This would make something like http://localhost/~your_username work. But it’s been a while since I’ve done any of this myself…”
I mean if you didn’t really need PHP (I suspect you do?) you could run any ‘ol web server in the current directory where you have your site and just serve that straight up locally.
@off_grid_living@twtxt.net If you’d like to try something new (I know I know!); I just modified your site’s file a teeny weeny bit and got it working with FrankenPHP a nice little portable web server written in Go that “just works”™ that is able to handle and execute PHP for you and your site basically “just works”™ out of the box locally, run from any directory.
In fact I recommend this really, it’s just less “mucking around” and what we call “zero configuration”.
@prologic@twtxt.net +1 for FrankenPHP. And built into caddy is also swell.
@xuu Yeah it seems to be quite easy to operate actually 👌 Love the zero configuration!
@off_grid_living@twtxt.net Despite I don’t really understand why you want the web server and website contents on a USB stick that travels around with you, do you even need a web server at all? I might be totally wrong, but I get the impression that it’s only you who uses the “website” on whatever machine the USB drive is plugged in. It’s not served over the internet, is it? It’s just for yourself, so that you can look up stuff on the “website” or something like that. But you don’t actually serve the website to the entire world?
Again, I could completely misunderstand the use case here. But assuming it’s not connected to the internet, since you just have HTML and plain text files on the USB stick, no PHP or other stuff that needs to be interpreted first, you could just view these files locally in any browser (via local file://
protocol) without the web server (via http(s)://
) in between. Much simpler.
Lyse you are completely correct. I run the local host website as a thin webpage right next to the NotePad 2 text editor, and I edit the webpage as I go along, while the web server shows you how it looks like on the Local Internet. That way I save dozens of editing mistakes when it finally become hosted on the grand Internet, plus I have an exact copy the my website at all times, should I lose something from the hosted Internet.
So how do any of you who have created webpages before do this sort of thing? How do you know what your experience is like? Since the host changes features, this changes the web hosting experience, which is a terrible pain. Think of the thousands of editing I have to do?
I will post you some examples…
Notice these never existed when the local host ran, but now they do because not all servers are the same
@off_grid_living@twtxt.net I see. When I build static websites by hand, I usually do not need a real web server to serve it locally for testing purposes. I use relative links in all the documents and basically never resort to web server features, such as authentication, URL rewrites etc.
I consequently make use of the UTF-8 encoding and state that in each end every one of the HTML files. This keeps me from surprises later on. The web server in the end is configured to automatically include the Content-Type
header with the right character encoding (super easy as it is always UTF-8) in the response, so this is very bullet-proof in my mind.
My editor simply does not auto-“correct” anything. This almost never works in my experience. Especially when dealing with computer languages.
@off_grid_living@twtxt.net I use absolute paths for my links so I use a local Web server. I use darkhttpd, which is much simpler than Apache and has just enough features for me. I don’t think I’ve ever run into encoding issues because I make sure everything is UTF-8 like @lyse@lyse.isobeef.org.