| 
						
						
						
					 | 
				
				 | 
				
					@ -0,0 +1,59 @@ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					# Locales | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					``` | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					sudo dpkg-reconfigure locales | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					``` | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					# Web server | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					``` | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					dpkg --get-selection | grep apache | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					sudo apt update | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					sudo apt install apache2 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					``` | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					## status and configuration | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					``` | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					sudo netstat -tlpn | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					systemctl -all list-sockets | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					``` | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					``` | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					service --status-all | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					apachectl configtest | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					sudo service apache2  | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					``` | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					The configuration files are: | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					- `apache2.conf` main configuration file for the server | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					- `ports.conf` configuring virtual server port numbers (80) as default | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					# Web pages and scripts | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					The index file for creating a web page is located on `/var/www/html/`. | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					The *Common Gateway Interface*(CGI) uses the next path for executing CGI scripts `/usr/lib/cgi-bin/` | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					``` | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					ls | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					Readme.md  index.html  test.cgi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					┌─[debian][beaglebone][~/md/web-server] | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					└─▪ vim test.cgi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					┌─[debian][beaglebone][~/md/web-server] | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					└─▪ sudo cp test.cgi /usr/lib/cgi-bin/test.cgi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					┌─[debian][beaglebone][~/md/web-server] | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					└─▪ sudo chmod ugo+x /usr/lib/cgi-bin/test.cgi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					┌─[debian][beaglebone][~/md/web-server] | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					└─▪ cd /etc/apache2/mods-enabled/ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					┌─[debian][beaglebone][.../apache2/mods-enabled] | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					└─▪ sudo ln -s ../mods-available/cgi.load | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					ln: failed to create symbolic link './cgi.load': File exists | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					┌─[debian][beaglebone][.../apache2/mods-enabled] | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					└─▪ ls -l cgi.load | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					lrwxrwxrwx 1 root root 26 Oct  3 03:29 cgi.load -> ../mods-available/cgi.load | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					┌─[debian][beaglebone][.../apache2/mods-enabled] | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					└─▪ curl localhost:8888/cgi-bin/test.cgi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					<html><head><meta charset="UTF-8"><title> BB</title></head><body><h1>Hello</h1><para>beaglebone | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					up for 03:35:43 up  2:51,  4 users,  load average: 0.00, 0.00, 0.00 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					</para></html>┌─[debian][beaglebone][.../apache2/mods-enabled] | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					``` | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 |