Webtjener

code aptitude install apache2 code
 * Apache med SSL cert:**

code sudo mkdir /etc/apache2/ssl code Lage SSL cert. code sudo openssl req -new -x509 -days 365 -nodes -out /etc/apache2/ssl/apache.pem -keyout /etc/apache2/ssl/apache.pem code

code sudo a2enmod ssl code

code sudo nano /etc/apache2/sites-available/default code Lag en kopi/paste av hele VirtualHost *:80, og endre til VirtualHost *: 443 code  ... ... 

 ... ...  code Legg til under begge VirtualHost code ServerName ditt.domene.dot code Under  code SSLEngine on SSLCertificateFile /etc/apache2/ssl/apache.pem code

code sudo /etc/init.d/apache2 force-reload code

code Restarting web server: apache2apache2: apr_sockaddr_info_get failed for apache2 apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName code Fix: code sudo hostname ditt.domene.dot code
 * Feilmelding**

code aptitide install squid
 * Squid:**

nano /etc/squid/squid.conf code

Legg til egne ACL settings under own rules code acl badUrl dstdomain www.vg.no http_access deny badUrl code Test for å sjekke at vg.no blir blokkert: code tail -f /var/log/squid/access.log
 * 1) INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
 * 1) acl tid time 15:00-17:00
 * 2) http_access deny tid

1265727711.672    67 158.38.56.68 TCP_MISS/301 951 GET http://vg.no/ - DIRECT/195.88.55.16 text/html 1265727711.676     0 158.38.56.68 TCP_DENIED/403 1569 GET http://www.vg.no/ - NONE/- text/html code Tips for å lese squid.conf uten comments: code cat /etc/squid/squid.conf | egrep -v "^\s*(#|$)" code


 * PHP**

code aptitude install php5 code Cookies: code cookie.php



 code


 * Vedvardende forbindelse:**

code /etc/apache2/apache2.conf KeepAlive off code
 * 1) KeepAlive: Whether or not to allow persistent connections (more than
 * 2) one request per connection). Set to "Off" to deactivate.

Sjekker med wireshark: code (tcp.port == 80) and ip.addr == 158.38.56.70 and ip.addr == 158.38.56.73 and http code Ser på connection i HTTP: Med KeepAlive On code Connection: Keep-Alive\r\n code Med KeepAlive Off code Connection: close\r\n code