2 cool (web) things to do in Linux // Linux for Hackers // EP 8

About this video

In Linux for Hackers episode 8, the creator teaches two web skills in a free Hack The Box Academy Linux lab in the browser. First, spinning up a website with one command: python -m http.server serves the current directory on port 8000 by default, which he visits as localhost:8000. Because there is no index.html, it lists files, which he shows is useful for transferring files when SSH, FTP, or Netcat are not available. He restarts it on a custom port, creates a website folder with a nano-edited index.html so a page is served instead of a listing, and stresses the server serves whatever directory you launch it from. He then runs alternatives side by side: PHP with php -S 127.0.0.1 on another port, explaining 127.0.0.1 as the loopback address equivalent to localhost; Node via npx http-server; and Apache2 via systemctl start apache2 after editing /etc/apache2/ports.conf to change its Listen port from 80 to 8080 because port 80 was already in use, ending with four web servers running at once. Second, talking to websites from the command line instead of a browser: curl (client URL) fetches a page’s HTML, curl -o saves it to a file he views with cat, curl -I shows the response header including the server and a 200 OK status, and curl -v shows both request and response headers, with a GET request explained versus POST and other methods. He finishes with wget, which downloads the page file directly, and notes 404 as the not-found code to avoid.

Key takeaways

  • python -m http.server instantly serves the current directory, default port 8000
  • Without an index.html the Python server lists files, enabling quick file transfer
  • PHP, npx http-server, and Apache2 are alternative one-machine web servers on custom ports
  • curl fetches pages, curl -o saves them, curl -I shows response headers, and curl -v shows both headers
  • wget downloads a page file directly; 200 OK is success and 404 means not found

Episode details: published February 9, 2022 · 20:19 long. Summary written by Self Growth Videos from the episode itself. Business results and any income figures mentioned are NetworkChuck’s own claims, shared for education — they are not typical or guaranteed.


← Previous: If Else Statements in Python // Python RIGHT NOW!! // EP 4 · Next: i HACKED my wife’s web browser (it’s SCARY easy!!) →

All NetworkChuck videos · NetworkChuck profile · NetworkChuck on YouTube

Sister brand · Vacation Club Promo

All-inclusive resort stays from $435

Qualified couples: promotional Mexico and Caribbean packages at real resorts. Short presentation during your stay — enjoy the rest of the trip.

Qualifications apply · presentation during stay · no purchase required

Subscribe YouTube Suggest