HiliteJs Demo: Servers Config and Logs


Access log (Apache / Nginx)

127.0.0.1 - - [11/May/2017:13:59:17 -0200] "GET /www/index.php HTTP/1.1" 200 11477 "-" "Mozilla/5.0 (X11; Linux amd64; rv:45.0) Gecko/20100101 Firefox/45.0"
127.0.0.1 - - [11/May/2017:13:59:19 -0200] "GET /www/index.php?page=one HTTP/1.1" 404 1002 "-" "Mozilla/5.0 (X11; Linux amd64; rv:45.0) Gecko/20100101 Firefox/45.0"
127.0.0.1 - - [11/May/2017:13:59:21 -0200] "GET /www/index.php?page=two HTTP/1.1" 403 1727 "-" "Mozilla/5.0 (X11; Linux amd64; rv:45.0) Gecko/20100101 Firefox/45.0"

Apache Config / .htaccess

# rewrite`s rules for wordpress pretty url
LoadModule rewrite_module  modules/mod_rewrite.so
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [NC,L]

ExpiresActive On
ExpiresByType application/x-javascript  "access plus 1 days"

Order Deny,Allow
Allow from All

<Location /maps/>
  RewriteMap map txt:map.txt
  RewriteMap lower int:tolower
  RewriteCond %{REQUEST_URI} ^/([^/.]+)\.html$ [NC]
  RewriteCond ${map:${lower:%1}|NOT_FOUND} !NOT_FOUND
  RewriteRule .? /index.php?q=${map:${lower:%1}} [NC,L]
</Location>

Nginx Config


#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#pid   /run/nginx.pid;

events {
    worker_connections  1024;
}

http {
      include /etc/nginx/mime.types;
      gzip  on;
      gzip_http_version 1.1;
      gzip_comp_level 2;
      gzip_types text/plain text/html text/css
                      application/x-javascript text/xml
                      application/xml application/xml+rss
                      text/javascript;

server {
                listen       80;
                server_name  localhost;
                access_log  logs/localhost.access.log  main;
                location / {
                    root   html;
                    index  index.html index.htm;
                }
        include /etc/nginx/sites-enabled/*;
        }
}

DNS Zone Config

$ORIGIN example.com.    ; designates the start of this zone file in the namespace
$TTL 1h                 ; default expiration time of all resource records without their own TTL value
example.com.  IN  SOA   ns.example.com. username.example.com. ( 2007120710 1d 2h 4w 1h )
example.com.  IN  NS    ns                    ; ns.example.com is a nameserver for example.com
example.com.  IN  NS    ns.somewhere.example. ; ns.somewhere.example is a backup nameserver for example.com
example.com.  IN  MX    10 mail.example.com.  ; mail.example.com is the mailserver for example.com
@             IN  MX    20 mail2.example.com. ; equivalent to above line, "@" represents zone origin
@             IN  MX    50 mail3              ; equivalent to above line, but using a relative host name
example.com.  IN  A     192.0.2.1             ; IPv4 address for example.com
              IN  AAAA  2001:db8:10::1        ; IPv6 address for example.com
ns            IN  A     192.0.2.2             ; IPv4 address for ns.example.com
              IN  AAAA  2001:db8:10::2        ; IPv6 address for ns.example.com
www           IN  CNAME example.com.          ; www.example.com is an alias for example.com
wwwtest       IN  CNAME www                   ; wwwtest.example.com is another alias for www.example.com
mail          IN  A     192.0.2.3             ; IPv4 address for mail.example.com
mail2         IN  A     192.0.2.4             ; IPv4 address for mail2.example.com
mail3         IN  A     192.0.2.5             ; IPv4 address for mail3.example.com