a pure Raspi web server with Raspbian Debian

Raspberry pi server

 Setups and configurations

 Raspberry pi - Rpi

 Apache / LAMP server

Windward

 The game not the island group

anchor life saver

 Regarding unity3d

🙂 In-game char icons

 Public game server settings

🛠 Hafenzoll @raspberry
🛠 Windward defaults

 Social news aggregation

Community @steam
🌍 Windward #reddit

 Official Windward wiki

🛠 Wiki @gamepedia
Duckduckgo pirate flag
Something else

 This is in German language

💻 Linux - ubuntusers.de

 Get a handy weather widget

🌤 Weather code snippet

 Hotchpotch of weblinks

📖 Yellow pages

 We got some boring movies

🎥 Cinematique
Archives
Search cloud
Front desk clerk

No ads, no trackers and
no web beacons. Promised.

Suppress unnecessary entries in Apache's access.log


The SetEnvIf and SetEnvIfNoCase directives can be used in the following contexts in your global Apache (2.4) configuration file. E.g. if you get lots of visits from search engine spiders or from certain IP addresses.


root@raspberry:# nano /etc/apache2/apache2.conf


Examples what to set at the end of file:

          
          # Omit internal dummy connection
          SetEnvIf Remote_Host "^localhost$" dontlog
          
          # Suppress spider bots
          SetEnvIf Remote_Host "search.msn.com$" dontlog
          SetEnvIf Remote_Host "googlebot.com$" dontlog
          SetEnvIf Remote_Host "yandex.com$" dontlog
          SetEnvIfNoCase User-Agent "^baiduspider" dontlog
          
          # Omit graphics and scripts
          SetEnvIfNoCase Request_URI "\.(jpg)|(png)|(gif)|(css)|(js)$" dontlog
          
          # Do not log certain IPs
          SetEnvIf Remote_Addr "192\.168\.0\.154" dontlog
          SetEnvIf Remote_Addr "192\.168\.0\." dontlog
          
          # Next lines have against referrer spamming to Webalizer
          SetEnvIf Remote_Host "kyivstar.net$" dontlog
          SetEnvIf Remote_Host "sunline.ua$" dontlog
          SetEnvIf Remote_Host "latnet.ru$" dontlog
          SetEnvIf Remote_Host "hidehost.net$" dontlog
          SetEnvIfNoCase Referer "\.ru" dontlog
          SetEnvIfNoCase Referer "\.ua" dontlog
          SetEnvIfNoCase Referer "\.xyz" dontlog
          
          # ! This line has essential at the end of file !
          CustomLog /var/log/apache2/access.log combined env=!dontlog
          

Keep in mind that SetEnvIf and SetEnvIfNoCase accepts only regular expressions, not CIDR notations.
So you can not deploy anything like 192\.168\.0\.0/24    ⇦ This does no man's business.


root@raspberry:# service apache2 restart


Aspects of the request are
Remote_Host - the hostname (if available) of the client making the request
Remote_Addr - IP address of the client making the request
Server_Addr - IP address of the server on which the request was received
Request_Method - name of the method being used (GET, POST, PUT, CONNECT)
Request_Protocol - protocol name & version with which the request was made (e.g. "http/1.1")
Request_URI - the resource requested on the http request line


To not log requests from any client whose hostname ends in example.com, use:

          
          SetEnvIf Remote_Host "example.com$" dontlog
          

To not log requests from any client whose hostname begins with example, use:

          
          SetEnvIf Remote_Host "^example" dontlog
          

To not log certain referrals (e.g. your own domain or avoid / reduce spamming), use:

          
          SetEnvIfNoCase Referer "westio\.ru" dontlog
          

13-Feb 2018


Live log monitoring with the tail command

tail is a program on Unix and Unix-like systems used to display the tail end of a text file or piped data.


tail (Unix) at Wikipedia


user@raspberry:~ $ tail -f -n +1 /var/log/apache2/access.log
user@raspberry:~ $ tail -f -n +1 /var/log/apache2/error.log


-f   This option will cause tail will loop forever, checking for new data at the end of the file. When new data appears, it will be printed. By default, tail will output the last 10 lines of its input to the standard output.


-n +1   If you put a plus sign before num, tail will output all lines beginning with that line.
For example, -n +1 will print every line.


Terminate by Crtl C




Output without line breaks.


user@raspberry:~ $ tail -f -n +1 /var/log/apache2/access.log | cut -c -$COLUMNS


18-Feb 2018


Get rid of bots, spybots and suchlike without user-agent identification

Apache 2.4.10 and newer


Set in .htaccess file (root)


        RewriteEngine on
        RewriteCond "%{HTTP_USER_AGENT}" "^$" [NC,OR]
        RewriteCond "%{HTTP_USER_AGENT}" "^ $" [NC,OR]
        RewriteCond "%{HTTP_USER_AGENT}" "^-$" [NC]
        RewriteRule (.*) - [F]
        

By the way, a few of them experience a 408 Timeout message.

403 Access denied and client forwarding to the Far East.


        ErrorDocument 403 https://google.cn
        


Optional if you don't want entries in your logfile set in apache2.conf


root@raspberry:# nano /etc/apache2/apache2.conf


        SetEnvIfNoCase User-Agent "^$" dontlog
        SetEnvIfNoCase User-Agent "^ $" dontlog
        SetEnvIfNoCase User-Agent "^-$" dontlog
        
        CustomLog /var/log/apache2/access.log combined env=!dontlog
        

root@raspberry:# service apache2 restart


11-Jun 2018

Hafenzoll 2019