Simple web server options¶
Estimated time to read: 5 minutes
- Originally Written: February, 2026
Overview¶
Sometimes I need a place to host files (e.g. iso files or switch/router .bin images) and have access to them in my lab. So I'm writing this to keep track of install instructions for a few HTTP servers.
Python¶
This is great if you need a temporary solution for quick file sharing or testing. I've found that some clients might not be able to access these files and in those cases I've used one of the next two options. I'll try and remember to document the clients in the future if it happens again.
The setup is pretty easy; just change directory to where the files are that you want to serve. Then use the Python http.server module to run a server on a specific port (8000 in this example)
More details: https://docs.python.org/3/library/http.server.html
Apache¶
I find either of the next two options work fine for a permanent HTTP server and the installation is straightforward.
Working with Apache¶
- Location of files to serve:
/var/www/html- You can created whatever structure you need however I normally have a sub-directory such as
softwareto use as the root and then new sub-directories whenever needed mkdir /var/www/html/software
- You can created whatever structure you need however I normally have a sub-directory such as
- Config files:
/etc/apache2/- I haven't modified any config in these examples
- Log files (troubleshooting):
/var/log/apache2/
If you run into issues check the permissions and make sure you have the correct config. Apache on Ubuntu runs as the www-data user. You can give this user ownership of the software directory and everything in it.
The directories and files require different permissions
- Directories need 755 (so Apache can enter them).
- Files need 644 (so Apache can read but not modify them).
Nginx¶
You might run into 403 Forbidden errors. If this happens make sure you have the correct permissions and allow the location of the /software folder to show all files. See the section below for some screenshots and commands.
Working with Nginx¶
- Location of files to serve:
/var/www/html- You can created whatever structure you need however I normally have a sub-directory such as
softwareto use as the root and then new sub-directories whenever needed mkdir /var/www/html/software
- You can created whatever structure you need however I normally have a sub-directory such as
- Config files:
/etc/nginx/- I modified the sites config file (
/etc/nginx/sites-available/default) which you can see below
- I modified the sites config file (
- Log files (troubleshooting):
/var/log/nginx/
If you run into issues check the permissions and make sure you have the correct config. Nginx on Ubuntu runs as the www-data user. You can give this user ownership of the software directory and everything in it.
The directories and files require different permissions
- Directories need 755 (so Nginx can enter them).
- Files need 644 (so Apache can read but not modify them).
If you're using a sub-directory such as /software then you need to add a location block inside the sites config file.
server {
listen 80 default_server;
root /var/www/html;
index index.html index.htm;
server_name _;
# This is the existing default block
location / {
try_files $uri $uri/ =404;
}
# This is the new block
location /software {
autoindex on; # Enables directory listing
allow all; # Ensures access is allowed
}
}










