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.

70 lines
2.2 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. # Locales configuration
  2. The time and language settings are allways checked for several tools, thus check and reconfigure them:
  3. ```
  4. sudo dpkg-reconfigure locales
  5. ```
  6. # Apache Web Server
  7. First check that the apache package is already or not isntalled in your device
  8. ```
  9. dpkg --get-selection | grep apache
  10. ```
  11. If the package is not isntalled, please procced to install Apache:
  12. ```
  13. sudo apt update
  14. sudo apt install apache2
  15. ```
  16. ## status and configuration
  17. To print out the services running on the device and their specific ports use:
  18. ```
  19. sudo netstat -tlpn
  20. ```
  21. Check that the port 80 is not used, otherwise, you will receive errors during the Apache installation or initialization.
  22. If this occurs, modify one of the next files at `/etc/apache2/`
  23. - `apache2.conf` main configuration file for the server
  24. - `ports.conf` configuring virtual server port numbers (80) as default
  25. Then, restart the `apache2` service:
  26. ```
  27. sudo service apache2
  28. sudo service apache2 restart
  29. service --status-all
  30. ```
  31. # Web pages and scripts
  32. ## HTML
  33. The index file for creating a web page is located on `/var/www/html/`.
  34. ## CGI
  35. The *Common Gateway Interface* (CGI) uses the next path for executing CGI scripts `/usr/lib/cgi-bin/`
  36. ```
  37. ls
  38. Readme.md index.html test.cgi
  39. ┌─[debian][beaglebone][~/md/web-server]
  40. └─▪ vim test.cgi
  41. ┌─[debian][beaglebone][~/md/web-server]
  42. └─▪ sudo cp test.cgi /usr/lib/cgi-bin/test.cgi
  43. ┌─[debian][beaglebone][~/md/web-server]
  44. └─▪ sudo chmod ugo+x /usr/lib/cgi-bin/test.cgi
  45. ┌─[debian][beaglebone][~/md/web-server]
  46. └─▪ cd /etc/apache2/mods-enabled/
  47. ┌─[debian][beaglebone][.../apache2/mods-enabled]
  48. └─▪ sudo ln -s ../mods-available/cgi.load
  49. ln: failed to create symbolic link './cgi.load': File exists
  50. ┌─[debian][beaglebone][.../apache2/mods-enabled]
  51. └─▪ ls -l cgi.load
  52. lrwxrwxrwx 1 root root 26 Oct 3 03:29 cgi.load -> ../mods-available/cgi.load
  53. ┌─[debian][beaglebone][.../apache2/mods-enabled]
  54. └─▪ curl localhost:8888/cgi-bin/test.cgi
  55. <html><head><meta charset="UTF-8"><title> BB</title></head><body><h1>Hello</h1><para>beaglebone
  56. up for 03:35:43 up 2:51, 4 users, load average: 0.00, 0.00, 0.00
  57. </para></html>┌─[debian][beaglebone][.../apache2/mods-enabled]
  58. ```