You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.7 KiB

2 years ago
  1. # Locales
  2. ```
  3. sudo dpkg-reconfigure locales
  4. ```
  5. # Web server
  6. ```
  7. dpkg --get-selection | grep apache
  8. sudo apt update
  9. sudo apt install apache2
  10. ```
  11. ## status and configuration
  12. ```
  13. sudo netstat -tlpn
  14. systemctl -all list-sockets
  15. ```
  16. ```
  17. service --status-all
  18. apachectl configtest
  19. sudo service apache2
  20. ```
  21. The configuration files are:
  22. - `apache2.conf` main configuration file for the server
  23. - `ports.conf` configuring virtual server port numbers (80) as default
  24. # Web pages and scripts
  25. The index file for creating a web page is located on `/var/www/html/`.
  26. The *Common Gateway Interface*(CGI) uses the next path for executing CGI scripts `/usr/lib/cgi-bin/`
  27. ```
  28. ls
  29. Readme.md index.html test.cgi
  30. ┌─[debian][beaglebone][~/md/web-server]
  31. └─▪ vim test.cgi
  32. ┌─[debian][beaglebone][~/md/web-server]
  33. └─▪ sudo cp test.cgi /usr/lib/cgi-bin/test.cgi
  34. ┌─[debian][beaglebone][~/md/web-server]
  35. └─▪ sudo chmod ugo+x /usr/lib/cgi-bin/test.cgi
  36. ┌─[debian][beaglebone][~/md/web-server]
  37. └─▪ cd /etc/apache2/mods-enabled/
  38. ┌─[debian][beaglebone][.../apache2/mods-enabled]
  39. └─▪ sudo ln -s ../mods-available/cgi.load
  40. ln: failed to create symbolic link './cgi.load': File exists
  41. ┌─[debian][beaglebone][.../apache2/mods-enabled]
  42. └─▪ ls -l cgi.load
  43. lrwxrwxrwx 1 root root 26 Oct 3 03:29 cgi.load -> ../mods-available/cgi.load
  44. ┌─[debian][beaglebone][.../apache2/mods-enabled]
  45. └─▪ curl localhost:8888/cgi-bin/test.cgi
  46. <html><head><meta charset="UTF-8"><title> BB</title></head><body><h1>Hello</h1><para>beaglebone
  47. up for 03:35:43 up 2:51, 4 users, load average: 0.00, 0.00, 0.00
  48. </para></html>┌─[debian][beaglebone][.../apache2/mods-enabled]
  49. ```