Posts Tagged ‘small article’

The beheading of Saint John the Baptist feats in Eastern Orthodox Church – A short history of saint John Forerunners Holy Relics

Saturday, September 14th, 2019

Beheading_of_St_John_the_Baptist_Icon_IX-century

Saint John the Baptist (The Forerunner of Christ) is all known for being the baptizer of the Lord Jesus Christ in Jordan's river in Israel.

However as nowadays most people are away from the Church and from traditions, that many generations of our ancestors used to follow, little know the details of his beheading and the meaning of why he is venerated so much by so many generations in the last 2000 years.

Thus In this small article, I'll try to shed some light on the Saint John Beheading feast known in Church Slavonic world as Oseknovenie (Осекновение) = beheading and is considered a day of sorrow for the Church for the reason the biggest Old Testamental prophet, a hermit and a man of Gigantic spiritual significance Saint John the Baptist has been beheaded unfairly for having no fault at all but this happened so his righteousness raise up even more and be clear for the generations to come.

The feast of Saint John the Baptist is celebrated on 29 of August in Eastern Orthodox Church, where old Calendar Churches celebrate the feast (13 days) later on 11 of September – I'll not get into details about calendars as this is a long discussion for a separate article.

It should be said in the Church saint John the Baptist is considered the highest saint among all“the first among martyrs in grace”, venerated next in glory to Virgin Mary.

The Martyrdom of Saint John happened in the 32 years after the Nativity (The Birth) of Christ as this is said in the Gospel of Mathew 14:1-12 and Gospel of Mark (6:14-29) in New Testament.

Saint-John-The-Baptist-Orthodox-Bulgarian-icon

Many of the small details, we know about saint John and his earthly living are not given in the Gospel however, but are instead given in the Chuch Tradition (that is kept in the main books and the Living of the Saints, as well as all the books written by the officially canonized saints over the years that used for Eastern Orthodox Church services Singing for many centuries).

From there we know the beheading of Saint John happened short time before the Crucifixion of Christ. After the death of Herode the Great, Romans divided the territory of Province of Palestine in 4 parts and on top of each placed his governor.

Herodos Antipa received by Emperor Augustus Galilea as a territory of Governance. He had a law binded marriage, who was a daughter of king Arepha. Herod left her and cohabited (unlawfully) with Herodias who was his mistress and brother's wife.

As Herodos was a governer and recpetively example for all his subordinate in his Kingdom and was living unlawfully with that woman saint John who knew him personally rebuked him multiple times publicly advising him to leave that woman and live with his lawfully marriaged one as it was written in God's law – that such people are worthy for death just like moreover this was the unwritten law followed by all kind of peoples of his time from noble to smallest and poorest.

Herodoes did not listened and wanted to get rid of saint Johns somehow but he was scared to accuse him for some kind of kingdom lawlessness as the knew saint John was a true prophet of God and feared the people who recognized him as a true prophet  as well as feared he might be put off throne for his evil deed if he finds an excuse to kill the prophet of God.

As the critics on Herodoes living with a concubine while being in marriage, eventually not finding any other way to shut Saint John's mouth, king Herodoes put saint John in Prison with the excuse Saint John was a rebel and preaching things against established authority (About this event is said in Bible Gospel of Luke 3, 19-20).

For his birthday Herodoes prepared enormous banquet in which in front of the many invited guests danced (Salome / Salomia) – the daughter of Herod II and Herodias and her dancing was so much pleasing for the already drunk Herod and in his drunkenness he promised to give her anything she desired up to half of his kingdom.
Salome was still young woman and as it was the tradition then not knowing what would be the best to ask for, she asked her Mother and the Mother being in unlawful relations with Herod in her hatred for the rebuking prophet saint John asked, the head of Saint John the Baptist on a platter.

The-Beheading-of-Saint-John-The-Baptist-Salomnia-dance-in-front-of-Herodos-Sv.-Ioan-Krastitel

The dance of Salome with Saint John's head on a Platter Orthodox icon

Even though Herod was appaled by this strange request, he had to reluctanly agree to keep his word as he was a ruler of a great power and for that time, not keeping a word publicly given would make him though weak, a fraudulant and eventually this will be reason for a rumors for his unseriousness to circulate the kingdom, thus unwillingly he agreed sent soldier to the prison to behead Saint John and the Head of the saint was brought to the perverted Solome and the harlot mother of hers Herodias.

Due to Church tradition when the Head of the 'Biggest in Spiritual Power' of Man born after Christ, as the Gospel speaks was brought to the lecherous feast, the Head even in the platter continued to rebuke, the unwalfullness of Herod.
 

The Jewish famous Historian Flavius Josiphus in his historical book Antiques of the Jews wrote, the reason for beheading of Saint John was:

"lest the great influence John had over the people might put it into his [John’s] power and inclination to raise a rebellion, (for they seemed ready to do any thing he should advise), [so Herod] thought it best [to put] him to death."

Flavius also states that many of the Jews believed that the military disaster that fell upon Herod as his throne fall a by the hands of Aretas his (father-in-law) was God's immediate punishment for unrighteous behaviour.
There is no exact date when behading of Saint John occured but the historians place it somewhere in year 28 or 29 A. D. (Anno Dommini).

Execution_of_John_the_Baptist_orthodox-icon


The body of saint John was buried immediately (separately from the body) as Herodias for her hatred for the prophet ordered the body to be buried separately from the head, it was buried in the small Palestinian Village (Sebaste), while Herodias took his holy head and buried it in a dung heep. 
Later Joanna (canonized later by saint known as Saint Joanna) – a wife of Herods steward, secretly went to place took the head and buried in the Mount of Olives, where it remained hidden for many centuries.

But the wrath of God is never late soon after Salome was passing a frozen river and while walking on it the ice collapsed and her body up to the head fall hanging in the water, while her head was sitting still over the water.
Just as she used to kick her feet on the ground, she was now, like dancing, making helpless movements in icy water.
 

So Salome hung until the sharp ice cut through her neck. Her head, cut off with a sharp ice, then her head was brought to Herod and Herodias, as John the Baptist's head had once been brought to them, and her body had never been found. The king of Arif of Arabia, in revenge for the dishonor of his daughter – the wife of Herod the four-owner – moved his troops against the wicked king and defeated him. The Roman emperor Guy Julius Caesar Caligula (37-41) in anger sent Herod, together with Herodias, into captivity to Gaul, and then to  . There they were consumed by the sprawling earth.


By a divine revelation the head of Saint John has been found in the 4th century (Celebrated in the Church with a special feast known as The First Finding of Saint John's the Baptist head by a governing official of Eastern Roman empire district who eventually choose to become a monk (monk Inokentij / Innocent). The head of saint John has been found by both divine revelation and the testimony of an Old Jew who confirmed the Jewish oral tradition for the burial of John the Baptist head on that exact place .
Innocent decided to build a Church and a monastic Cell in glory of Saint John the Baptist as the place was holy and sanctified by the graceous head of St. John.
Fearful that holy relics of such a high importance, might be soon stolen and sold, mocked over by unbelievers or destroyed, he immediately hide (burid) the St. John on the very same place, where he found it in the same vessel it was orginally.
Unfortunately on monk Innocent dead the Church fell into ruin was abandoned due to its desert location and eventually as it always happened in that times with old buildings, people used its construction stones for fortifying their own near village houses.

The Second Finding of the Head of Saint John the Baptist, happened some years later in 452 A.D. , during the days of Constantine the Great by two Christian monks who went for a Jerusalem for pilgrimage.who had God given revelation (Saint John himself appeared in a kind of a Vision to the two) and hsa indicated for the same hidden location where Innocent found it (laying under the Church ruins altar).
After digging on the place, the holy relic was found placed in a sack and brought with them to heir home land. On the way back they've met a potter not telling him what was inside the bag and asked him the bag to carry being lazy to do. Saint John the Baptist appeared the potter and told him to take his head and bring it away from this careless lazy monks immediately. The potter took Saint John's head home, and kept it there praying fervently to saint John the Baptist daily, soon before his death he put the head in a container and gave it to his sister.
The 1st and 2nd finding of saint Johns head is established as a feast celebrated yearly in Eastern Orthodox Church on 24 of February.

beheading-of-saint-John-icon

The feast of Beheading of Saint John in the Church is always observed in the Eastern Orthodox Churches Bulgarian, Russian, Serbian, Greek, Romanian, Georgian etc. with a strict fasting as a sign for the great sorrow we Christians have for the beheading of the Greatest of Prophets and Highest in sight of God born of man.

In some cultures, the pious will not eat food from a flat plate, use a knife, or eat round or red food (such as tomatoes, watermelon, red peppers etc.) on this day.

A short time after a Hieromonk Eustathius (considered by Church historians) to be part of the Arian heretical division happen to have th chance to possess the holy head and he used it frequently to attract followers to the Heretical teachings of Arius (a Lybian heretic presbyter who was condemned in 325 A.D. on the First Council of Nicea convened by Saint Emperor Constantine The Great. Being in a hardships Eustathius buried the head in a cave near Emesa (circa 810 – 820) and soon after a monastery was built on that place by God's providence.

In the year 452, St. John the Baptist appeared to Archimandrite Marcellus of this monastery and indicated where his head was hidden in a water jar buried in the earth. The relic was brought into the city of Emesa and was later transferred to Constantinople.

Saint_John_Head_Holy-relics-Caput-Sti-Joannis-Baptistae-Praecurssoris-Domini-1

The current pressumable relics of head of Saint John the Baptist kept in San Silvestro in Capite Rome

The head of John Baptist disappeared once again after it was transferred from Comana of Cappadocia during a period of Muslim raids (about 820) and was again hidden in the ground during a period of iconoclastic persecusion.
After the veneration of icons was restored in year 850, A vision was revelead by God to patriarch Ignatius of Constantinople (ruling on patriarchial throne in 847 – 857) saw a vision revealing the place where the head of saint John was hidden around y. 850. The patriarch as the order was then communicated about his vision to emperor Michael III, who sent a delegation to Comana, where the head was found. Soon after the head was transferred to city of Nyc and here on 25 of May it was placed in a church in emperor court in Constantinople. The Church feast of the Third Finding of Saint John Baptist head is established for celebration in the Eastern Orthodox Church on 25 of May.

Third-finding-of-Saint-John-the-Baptist-head-holy-relics-orthodox-icon

Currently many small particles of Saint John Head are available for generation among many Eastern Orthodox and Roman Catholic Churches.

The-Face-of-saint-John-the-Baptist-in-Cathedral-of-Our_Lady-in-Amiens-Cathedral

The head  is claimed to be in San Silvestro (Saint Silvester) in Capite in Rome or in Amiens Cathedral, said to have been brought from Constantinople by Wallon de Sarton as he was returning from the Fourth Crusade.
There are also some sources claiming that the real head of John the Baptist is buried in Turkish Antioch or Southern France.

Amiens_-_Cathedrale_Notre-Dame_France

Amiens Cathedrale Notre Dame France – one of most magnificent Gothic edifice in Europe.

During the French Revolution the kept Head in Amiens has been secretly hidden by the Amiens city Mayor in his own home to protect this sacred relic from the destruction (as many holy relics saints disappeared or have been destroyed) by the rebellious enraged crowds fighting for the rights of "Liberty, Equality, Fraternity" being the goals of the Masonic bortherhoods and many secret societies in France in that time.

Also a reliquary at the Residenz in Munich, Germany, is labeled as containing the skull of John the Baptist by Catholics. In history some sources claim the St. John used to be owned by Knight Templars
А piece of Saint John Baptist skull is held at the Eastern Orthodox Romanian skete Prodromos on Mount Athos.

Further on according to Church tradition saint Luke the Evangelist went to the city of Sebaste bringing with him the right hand of Saint John the Forerunner which was conducting numerous of miracles.

Some of the Relics of John the Baptist are said to be in the possession of the Coptic Orthodox Monastery of Saint Macarius the Great in Scetes, Egypt.
It is said John the Baptist's arm and a piece of his skull can be found at the Topkapı Palace in Istanbul, Turkey.

the_Holy-head-of-saint-John-the-Baptist-relics

It is said John the Baptist's arm and a piece of his skull can be found at the Topkapı Palace in Istanbul, Turkey.
At the time of Mehmed the Conqueror, the skull was held in Topkapı, while after his death, his stepmother Mara Branković, a Serbian princess, brought it to Serbia. It was then kept a while at the Dionisios monastery at Mount Athos, then the skull fragment was sent to a nearby island in order to prevent the outbreak of a plague; however, the Ottoman fleet seized it and delivered it to Hasan Pasha of Algeria, who held it in his home until his death. It was then returned to Topkapı. The skull is kept on a golden plate decorated with gold bands with gems and Old Serbian inscriptions. The plate itself is stored in a 16th-century rock crystal box.

The-Face-of-saint-John-the-Baptist-in-Cathedral-of-Our_Lady-in-Amiens-Holy-Relics

The face of St. John the Baptist, in the Cathedral of Our Lady in Amiens.

St. John's arm was brought from Antioch to Constantinople at the time of Constantine VII. It was kept in the Emperor's chapel in the 12th century, then in the Church of the Virgin of the Pharos, then in the Church of Peribleptos in the first half of the 15th century. Spanish envoy Clavijo reported that he saw two different arms in two different monasteries while on a visit to Constantinople in 1404. With the Fall of Constantinople, the Ottomans seized possession of it. In 1484, Bayezid II sent it the knights of Rhodes, while they held his brother Cem captive in return. In 1585, Murad III had the arms brought from Lefkosia castle to Constantinople (henceforth known as Istanbul). The arm is kept in a gold-embellished silver reliquary. There are several inscriptions on the arm: "The beloved of God" on the forefinger, "This is the hand of the Baptist" on the wrist, and "belongs to (monk) Dolin Monahu" on the band above the elbow.

In July 2010, a small reliquary was discovered under the ruins of a 5th-century monastery on St. Ivan Island, Bulgaria. Local archaeologists opened the reliquary in August and found bone fragments of a skull, a hand and a tooth, which they believe belong to st. John the Baptist, based on their interpretation of a Greek inscription on the reliquary.The remains have been carbon-dated to the 1st century. Currently The found relics are being placed for veneration in the sea resort town  of Sozopol, Bulgaria in the Church of saint saint Cyril and Methodius.

The_Holy_Relics-of-Saint-John-The-Baptist-kept-in-Saint-Cyril-Church-Sozopol

Saint John the Baptist Holy Relics in Sozopol Bulgaria

 

Sozopol-Lithia-Lity-with-the-holy-relics-of-saint-John-the-Baptist
 A Lity (Orthodox Vespers) in front of Saint Cyril and Methodius Church in Sozopol resort Bulgaria

There is much to be said in Saint Johns beheading and many great Theology books have been written on the topic however I hope the goal of this article to give a very brief overview for the ordinary people to know our human history over the last 2000 which is highly entangled with Christian faith  succeeded to give a very brief overview on the history of the beheading of saint John the Baptist and the deep history across his holy relics veneration over the centuries.

As a closure for the Article I find worthly to share the sung troparion in the Church services glorifying of saint John the Forerunner in Old Bulgarian / Church Slavonic, Greek and English

TROPARION IN CHURCH SLAVONIC

Па́мять пра́веднаго с похвала́ми, тебе́ же довле́ет свиде́тельство Госпо́дне, Предте́че: показа́л бо ся еси́ вои́стинну и проро́ков честне́йший, я́ко и в струя́х крести́ти сподо́бился еси́ Пропове́даннаго. Те́мже за и́стину пострада́в, ра́дуяся, благовести́л еси́ и су́щим во а́де Бо́га, я́вльшагося пло́тию, взе́млющаго грех ми́ра и подаю́щаго нам ве́лию ми́лость.

TROPARION IN GREEK

Μνήμη Δικαίου μέτ' ἐγκωμίων, σοὶ δὲ ἀρκέσει ἡ μαρτυρία τοῦ Κυρίου Πρόδρομε· ἀνεδείχθης γὰρ ὄντως καὶ Προφητῶν σεβασμιώτερος, ὅτι καὶ ἐν ῥείθροις βαπτίσαι κατηξιώθης τὸν κηρυττόμενον. Ὅθεν τῆς ἀληθείας ὑπεραθλήσας, χαίρων εὐηγγελίσω καὶ τοῖς ἐν ᾍδῃ, Θεὸν φανερωθέντα ἐν σαρκί, τὸν αἴροντα τὴν ἁμαρτίαν τοῦ κόσμου, καὶ παρέχοντα ἡμῖν τὸ μέγα ἔλεος.

TROPARION (TONE 4)
O Prophet and Forerunner of the coming of Christ, in spite of our eagerness to render you due honor, we fall short when singing your praise. Your glorious birth saved your mother from the shame of barrenness, returned to your father the power of speech, and proclaimed to the world the Incarnation of the Son of God.

KONTAKION (TONE 3)
The woman who had been barren becomes fertile and gives birth today to the Forerunner of Christ. He is the greatest and last of the prophets, for standing in the waters of the Jordon River, he placed his hands on Christ whom all the prophets had announced, and in so doing he became a prophet himself, a preacher and a forerunner of the Word of God.

How to configure Nautilus (Linux application like Windows Explorer) to work with standard Windows button + E On Linux GNOME en Mate

Monday, October 9th, 2017

how-to-configure-nautilus-linux-applicatoin-to-act-like-windows-explorer-make-windows-button-work-in-GNOME-and-Mate
As an ex-Windows user I'm still addicted to Windows User brainwashing as an ex-victim of Windows 95 / 98 and XP:), so I tend to love very much and its still hard for me to forget some major Key Binding (Windows Key Combinations).

On every new Desktop Linux I install, I have the habit to configure few great key combination shortcuts that makes my digital life much easier.
I use usually as a graphical environment GNOME and recently switched to MATE (GNOME 2 fork, cause GNOME 3 is totally messed up and unworthy to me), that's why this article is targetting this two Linux GUI envs, I'll be glad to hear in article comments for any other useful key bindings and how to configure similar key bindings for other Major Linux graphical environments (Cinnamon, KDE Plasma, XFCE, LXDE).

 

1. Configuring Lock Screen (Win button + L), Open Explorer(Win button + E), View Desktop (Win + D) in MATE graphic env

 

 

———  WINDOWS BUTTON, OFTEN USED KEY SHORTCUTS ———

Windows + E – Open new Windows File Explorer 

Windows + L – Lock Computer

Windows + M – To minimize All Windows

Windows + D – Show Desktop (similar to Windows +M though it doesn't switch to Desktop)

Win – + / – To Maginfy Text and Windows

Shift + Win + Left/Right Arrow – (In Windows if you have multiple monitors connected to the same computer lets say Right Monitor and Left, that combination switches between left monitor and right monitor)


——————————————————————–

 

The list goes on but I'm not used to all of them, I'll stop here and continue on with how to remake some of my favourite Windows keybindings in Gnu / Linux

Either run it from Menus:
 

System -> Settings -> Hardware -> Keyboard Shortcuts


Or run command

 

$ mate-keybinding-properties

 

howto-gnome-mate-remap-shortcut-keybinding-keys-mate-keybinding-properties


After rebinding the Windows: 
– Lock Screen and Open New Nautilus Explorer Window (Home folder) variable to be invoked with Windows button, the result
is as that:

howto-gnome-mate-remap-shortcut-keybinding-keys-mate-keybinding-properties
 
 

Scroll down Mate Keyboard shortcuts and you'll find

also how to configure Windows Button and D Key Combination, following 2 more screenshots showing how to do it note that MOD Key appears once you press Windows Keyboard Key + something (e.g. MATE recognizes MOD Key as Win Key):

Before the change to bind Win Key + D to work:

mate-how-to-make-desktop-view-open-with-standard-windows-button_and_d-combination-linux-debian

When configured Win Button + D looks like so:

mate-how-to-make-desktop-view-open-with-standard-windows-button_and_d-combination-linux-debian-1

2. Configuring Lock Screen (Win button + L), Open Explorer(Win button + E), View Desktop (Win + D) in GNOME

Usually in GNOME until > version 3.X.X (in older GNOME graphic environment access to KeyBinding Properties was done via:

 

System -> Preferences -> Keybord Shortcuts -> Add ->


In fallback gnome with Metacity (if installed along with GNOME Desktop 3.2.X environment to access Key Bindings):

d

System->Apps->Metacity->global_keybindings  

 

Also it is possible to remap keys via dconf-editor, I've written a small article earlier explaining how to remap Screenshotting buttons with dconf-editor but the example could be easily adapted, so you can edit almost everything.

Besides that you can use a command to run the keyboard configuration (in older GNOMEs) via:

 

linux:~$ gnome-keybinding-properties

 

Just for information for those who might know, many Key Binding interesting options are available via gnome-tweak-tool, so if you don't have it yet install it and give it a try:

 

linux:~# apt-get install –yes gnome-tweak-tool


As you can see, there are plenty of options to make Win (key) to act like Alt (key):

linux:~# gnome-tweak-tool
 

gnome-tweak-tool-make-win-key-to-behave-like-alt-key-howto 


After configuring the changes enjoy your WINDOWS Button + L, WINDOWS + E and WINDOWS + D WORKING AGAIN HOORAY !!! 🙂 
 

 

3. Most used shortcuts in Gnome and Nautilus 
 

Below are most used shortcuts thanks to LinuxQuestions Forum for providing them

Howdy! I thought that it would be useful to post a practical selection of shortcut keys for GNOME (the Desktop Environment) and Nautilus (the File Manager) and some information about customizing shortcut keys in Ubuntu. I wrote it especially for Ubuntu beginners, but I hope it will prove useful for all. 

 

2.1 GNOME/Nautilus shortcut keys – Very useful for the keyboard maniax like me :):
 

Ctrl-H: show hidden files

Ctrl-N: new window

Ctrl-Shift-N: create new folder

Alt-Home : jump to home folder

Alt-Enter : file / folder properties

F9 : toggle side-pane

Alt-F1 : launch applications menu

Alt-F2 : launch "run application" dialogue

Ctrl-Alt – Right/Left arrow : move to the next virtual desktop

Ctrl-Alt-Shift – Right/Left arrow : take current window to the next virtual desktop

Ctrl-Alt-D: minimize all windows, and gives focus to the desktop. 

Alt-Tab: switch between windows. When you use these shortcut keys, a list of windows that you can select is displayed. Release the keys to select a window. 

Ctrl-Alt-Tab: switch the focus between the panels and the desktop. When you use these shortcut keys, a list of items that you can select is displayed. Release the keys to select an item. 

Ctrl-Alt-L: lock the screen (tested only in Ubuntu) 

Ctrl-L: shortcut for opening locations-by default the path is the home folder*
/ : same as Ctrl-L but has the root (/) as default path* (shortcut found on here)
* both shortcuts can be used while you are on the desktop (no window active)

Ctrl-T : move to trash (in Nautilus)
Quite dangerous key combination because many of us are used to press these keys in order to open a new tab. Because we all delete items using the Delete key, I recommend to deactivate this shortcut key. To do that, go to System » Preferences » Appearance » Interface. Select Editable menu shortcut keys and close the dialog box. Click on the Edit menu in the File Browser. Click the Empty Trash item (it has Ctrl-T as the keyboard shortcut) Press the Delete key to get rid of the shortcut.
You can find all GNOME shortcut keys here

 

2.2 How to create a custom hotkey to launch whatever application you want in GNOME
 

As an example, we will set a lock-screen shortcut.


Open "gconf-editor" as the user as you're logged in in GNOME (typing gconf-editor in the terminal or "Run Application").
 

Go to apps > metacity > keybinding_commands


Here we have a list of twelve slots for commands.

 

Double click on e.g. "run_command_1" 

In Key Value Type in the name of the application or command you want to launch (e.g. gnome-screensaver-command –lock).

 

Go to apps -> Metacity -> global_keybindings 

Double click on e.g. "run_command_1" 
Change the key value to whatever key combination you like (e.g. <Ctrl><Alt>L).Press "Ok".

 

2.3.How to create/change GNOME shortcuts
 

 

Click on System -> Preferences -> Keyboard Shortcuts


Click the action in the list and press Enter. 
Press the new key or key combination you want to assign to the action. (To clear a shortcut, press the Backspace key)

 

Hope it helps, Enjoy Life .;)

Secure Apache webserver against basic Denial of Service attacks with mod_evasive on Debian Linux

Wednesday, September 7th, 2011

Secure Apache against basic Denial of Service attacks with mod evasive, how webserver DDoS works

One good module that helps in mitigating, very basic Denial of Service attacks against Apache 1.3.x 2.0.x and 2.2.x webserver is mod_evasive

I’ve noticed however many Apache administrators out there does forget to install it on new Apache installations or even some of them haven’t heard about of it.
Therefore I wrote this small article to create some more awareness of the existence of the anti DoS module and hopefully thorugh it help some of my readers to strengthen their server security.

Here is a description on what exactly mod-evasive module does:

debian:~# apt-cache show libapache2-mod-evasive | grep -i description -A 7

Description: evasive module to minimize HTTP DoS or brute force attacks
mod_evasive is an evasive maneuvers module for Apache to provide some
protection in the event of an HTTP DoS or DDoS attack or brute force attack.
.
It is also designed to be a detection tool, and can be easily configured to
talk to ipchains, firewalls, routers, and etcetera.
.
This module only works on Apache 2.x servers

How does mod-evasive anti DoS module works?

Detection is performed by creating an internal dynamic hash table of IP Addresses and URIs, and denying any single IP address which matches the criterias:

  • Requesting the same page more than number of times per second
  • Making more than N (number) of concurrent requests on the same child per second
  • Making requests to Apache during the IP is temporarily blacklisted (in a blocking list – IP blacklist is removed after a time period))

These anti DDoS and DoS attack protection decreases the possibility that Apache gets DoSed by ana amateur DoS attack, however it still opens doors for attacks who has a large bot-nets of zoombie hosts (let’s say 10000) which will simultaneously request a page from the Apache server. The result in a scenario with a infected botnet running a DoS tool in most of the cases will be a quick exhaustion of system resources available (bandwidth, server memory and processor consumption).
Thus mod-evasive just grants a DoS and DDoS security only on a basic, level where someone tries to DoS a webserver with only possessing access to few hosts.
mod-evasive however in many cases mesaure to protect against DoS and does a great job if combined with Apache mod-security module discussed in one of my previous blog posts – Tightening PHP Security on Debian with Apache 2.2 with ModSecurity2
1. Install mod-evasive

Installing mod-evasive on Debian Lenny, Squeeze and even Wheezy is done in identical way straight using apt-get:

deiban:~# apt-get install libapache2-mod-evasive
...

2. Enable mod-evasive in Apache

debian:~# ln -sf /etc/apache2/mods-available/mod-evasive.load /etc/apache2/mods-enabled/mod-evasive.load

3. Configure the way mod-evasive deals with potential DoS attacks

Open /etc/apache2/apache2.conf, go down to the end of the file and paste inside, below three mod-evasive configuration directives:

<IfModule mod_evasive20.c>
DOSHashTableSize 3097DOS
PageCount 30
DOSSiteCount 40
DOSPageInterval 2
DOSSiteInterval 1
DOSBlockingPeriod 120
#DOSEmailNotify hipo@mymailserver.com
</IfModule>

In case of the above configuration criterias are matched, mod-evasive instructs Apache to return a 403 (Forbidden by default) error page which will conserve bandwidth and system resources in case of DoS attack attempt, especially if the DoS attack targets multiple requests to let’s say a large downloadable file or a PHP,Perl,Python script which does a lot of computation and thus consumes large portion of server CPU time.

The meaning of the above three mod-evasive config vars are as follows:

DOSHashTableSize 3097 – Increasing the DoSHashTableSize will increase performance of mod-evasive but will consume more server memory, on a busy webserver this value however should be increased
DOSPageCount 30 – Add IP in evasive temporary blacklist if a request for any IP that hits the same page 30 consequential times.
DOSSiteCount 40 – Add IP to be be blacklisted if 40 requests are made to a one and the same URL location in 1 second time
DOSBlockingPeriod 120 – Instructs the time in seconds for which an IP will get blacklisted (e.g. will get returned the 403 foribden page), this settings instructs mod-evasive to block every intruder which matches DOSPageCount 30 or DOSSiteCount 40 for 2 minutes time.
DOSPageInterval 2 – Interval of 2 seconds for which DOSPageCount can be reached.
DOSSiteInterval 1 – Interval of 1 second in which if DOSSiteCount of 40 is matched the matched IP will be blacklisted for configured period of time.

mod-evasive also supports IP whitelisting with its option DOSWhitelist , handy in cases if for example, you should allow access to a single webpage from office env consisting of hundred computers behind a NAT.
Another handy configuration option is the module capability to notify, if a DoS is originating from a number of IP addresses using the option DOSEmailNotify
Using the DOSSystemCommand in relation with iptables, could be configured to filter out any IP addresses which are found to be matching the configured mod-evasive rules.
The module also supports custom logging, if you want to keep track on IPs which are found to be trying a DoS attack against the server place in above shown configuration DOSLogDir “/var/log/apache2/evasive” and create the /var/log/apache2/evasive directory, with:
debian:~# mkdir /var/log/apache2/evasive

I decided not to log mod-evasive DoS IP matches as this will just add some extra load on the server, however in debugging some mistakenly blacklisted IPs logging is sure a must.

4. Restart Apache to load up mod-evasive debian:~# /etc/init.d/apache2 restart
...

Finally a very good reading which sheds more light on how exactly mod-evasive works and some extra module configuration options are located in the documentation bundled with the deb package to read it, issue:

debian:~# zless /usr/share/doc/libapache2-mod-evasive/README.gz

How to tune MySQL Server to increase MySQL performance using mysqltuner.pl and Tuning-primer.sh

Tuesday, August 9th, 2011

MySQL Easy performance tuning with mysqltuner.pl and Tuning-primer.sh scripts

Improving MySQL performance is crucial for improving a website responce times, reduce server load and improve overall work efficiency of a mysql database server.

I’ve seen however many Linux System administrators who does belittle or completely miss the significance of tuning a newly installed MySQL server installation.
The reason behind that is probably caused by fact that many people think MySQL config variables, would not significantly improve performance and does not pay back for optimization efforts. Moreover there are a bunch of system admins who has to take care for numerous services so they don’t have time to get good knowledge to optimize MySQL servers.
Thus many admins and webmasters nowdays, think optimizations depend mostly on the side of the website programmers.
It’s also sometimes falsely believed that optimizing a MySQL server could reduce the overall server stability.

With the boom of Internet website building and internet marketing, many webmasters emerged and almost anybody with almost no knowledge on GNU/Linux or minimal or no knowledge on PHP can start his Online store, open a blog or create a website powered by some CMS like joomla.
Thus nowdays many servers even doesn’t have a hired system administrators but are managed by people whose knowledge on *Nix is almost next to zero, this is another reason why dozens of MySQL installations online are a default ones and are not taking a good advantage of the server hardware.

The incrase of website visitors leads people servers expectations for hardware also to grow, thus many companies simply buy a new hardware instead of taking the few time to investigate on how current server hardware can be utilized better.
In that manner of thought I though it will be a good idea to write this small article on Tuning mysql servers with two scripts Tuning-primer.sh and mysqltuner.pl.
The scripts are ultra easy to use and does not require only a minimal knowledge on MySQL, Linux or (*BSD *nix if sql is running on BSD).
Tuning-primer.sh and mysqltuner.pl are therefore suitable for a quick MySQL server optimizations to even people who are no computer experts.

I use this two scripts for MySQL server optimizations on almost every new configured GNU/Linux with a MySQL backend.
Use of the script comes to simply download with wget, lynx, curl or some other web client and execute it on the server host which is already running the MySQL server.

Here is an example of how simple it is to run the scripts to Optimize MySQL:

debian:~# perl mysqltuner.pl
>> MySQLTuner 1.2.0 - Major Hayden >major@mhtx.net<
>> Bug reports, feature requests, and downloads at http://mysqltuner.com/
>> Run with '--help' for additional options and output filtering

——– General Statistics ————————————————–
[–] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.1.49-3
[OK] Operating on 64-bit architecture

——– Storage Engine Statistics ——————————————-
[–] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[–] Data in MyISAM tables: 6G (Tables: 952)
[!!] InnoDB is enabled but isn’t being used
[!!] Total fragmented tables: 12

——– Security Recommendations ——————————————-
[OK] All database users have passwords assigned

——– Performance Metrics ————————————————-
[–] Up for: 1d 2h 3m 35s (68M q [732.193 qps], 610K conn, TX: 49B, RX: 11B)
[–] Reads / Writes: 76% / 24%
[–] Total buffers: 512.0M global + 2.8M per thread (2000 max threads)
[OK] Maximum possible memory usage: 6.0G (25% of installed RAM)
[OK] Slow queries: 0% (3K/68M)
[OK] Highest usage of available connections: 7% (159/2000)
[OK] Key buffer size / total MyISAM indexes: 230.0M/1.7G
[OK] Key buffer hit rate: 97.8% (11B cached / 257M reads)
[OK] Query cache efficiency: 76.6% (46M cached / 61M selects)
[!!] Query cache prunes per day: 1822075
[OK] Sorts requiring temporary tables: 0% (1K temp sorts / 2M sorts)
[!!] Joins performed without indexes: 63635
[OK] Temporary tables created on disk: 1% (26K on disk / 2M total)
[OK] Thread cache hit rate: 99% (159 created / 610K connections)
[!!] Table cache hit rate: 4% (1K open / 43K opened)
[OK] Open file limit used: 17% (2K/16K)
[OK] Table locks acquired immediately: 99% (36M immediate / 36M locks)

——– Recommendations —————————————————–
General recommendations:
Add skip-innodb to MySQL configuration to disable InnoDB
Run OPTIMIZE TABLE to defragment tables for better performance
Enable the slow query log to troubleshoot bad queries
Increasing the query_cache size over 128M may reduce performance
Adjust your join queries to always utilize indexes
Increase table_cache gradually to avoid file descriptor limits
Variables to adjust:
query_cache_size (> 256M) [see warning above] join_buffer_size (> 256.0K, or always use indexes with joins) table_cache (> 7200)

You see there are plenty of things, the script reports, for the unexperienced most of the information can be happily skipped without need to know the cryptic output, the section of importance here is Recommendations for some clarity, I’ve made this section to show up bold.

The most imporant things from the Recommendations script output is actually the lines who give suggestions for incrase of certain variables for MySQL.In this example case this are the last three variables:
query_cache_size,
join_buffer_size and
table_cache

All of these variables are tuned from /etc/mysql/my.cnf (on Debian) and derivatives distros and from /etc/my.cnf on RHEL, CentOS, Fedora and the other RPM based Linux distributions.

On some custom server installs my.cnf is also located in /usr/local/mysql/etc/ or some other a bit more unstandard location 😉

Anyways now having the Recommendation from the script, it’s necessery to edit my.cnf and try to double the values for the suggested variables.

First, I check if all the suggested variables are existent in my config with grep , if they’re not then I’ll simply add the variable with doubled size of the suggested values.
P.S: One note here is sometimes some values which are configured, are the default value for the MySQL server and does not have a record in my.cnf

debian:~# grep -E 'query_cache_size|join_buffer_size|table_cache' /etc/mysql/my.cnf table_cache = 7200
query_cache_size = 256M
join_buffer_size = 262144

All of my variables are in the config so, now edit my.cnf and set values to:
table_cache = 14400
query_cache_size = 512M
join_buffer_size = 524288

I always, however preserve the old variable’s value, because sometimes raising the value might create problem and the MySql server might be unable to restart properly.
Thus before going with adding the new values make sure the old ones are commented with # , e.g.:
#table_cache = 7200
#query_cache_size = 256M
#join_buffer_size = 262144

I would recommend vim as editor of choice while editing my.cnf as vim completely rox 😉 If you’re not acquainted to vim use nano or mcedit or your editor of choice 😉 :

debian:~# vim /etc/mysql/my.cnf
...

Assuming that the changes are made, it’s time to restart MySQL to make sure the new values are read by the SQL server.

debian:~# /etc/init.d/mysql restart
* Stopping MySQL database server mysqld [ OK ]
* Starting MySQL database server mysqld [ OK ]
Checking for tables which need an upgrade, are corrupt or were not closed cleanly.

If mysql server fails, however to restart, make sure immediately you reverse back the changed variables to the commented values and restart once again via mysql init script to make server load.

Afterwards start adding the values one by one until find out which one is causing the mysqld to fail.

Now the second script (Tuning-primer.sh) is also really nice for MySQL performance optimizations are necessery. However it’s less portable (as it’s written in bash scripting language).
Consider running this script among different GNU/Linux distributious (especially the newer ones) might produce errors.
Tuning-primer.sh requires some minor code changes to be able to run on FreeBSD, NetBSD and OpenBSD *nices.

The way Tuning-primer.sh works is precisely like mysqltuner.pl , one runs it it gives some info about current running MySQL server and based on certain factors gives suggestions on how increasing or decresing certain my.cnf variables could reduce sql query bottlenecks, solve table locking issues as well as generally improve INSERT, UPDATE query times.

Here is an example output from tuning-primer.sh run on another server:

server:~# wget https://www.pc-freak.net/files/Tuning-primer.sh
...
server:~# sh Tuning-primer.sh
-- MYSQL PERFORMANCE TUNING PRIMER --
- By: Matthew Montgomery -

MySQL Version 5.0.51a-24+lenny5 x86_64

Uptime = 8 days 10 hrs 19 min 8 sec
Avg. qps = 179
Total Questions = 130851322
Threads Connected = 1

Server has been running for over 48hrs.
It should be safe to follow these recommendations

To find out more information on how each of these
runtime variables effects performance visit:
http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html

SLOW QUERIES
Current long_query_time = 1 sec.
You have 16498 out of 130851322 that take longer than 1 sec. to complete
The slow query log is NOT enabled.
Your long_query_time seems to be fine

MAX CONNECTIONS
Current max_connections = 2000
Current threads_connected = 1
Historic max_used_connections = 85
The number of used connections is 4% of the configured maximum.
Your max_connections variable seems to be fine.

WORKER THREADS
Current thread_cache_size = 128
Current threads_cached = 84
Current threads_per_sec = 0
Historic threads_per_sec = 0
Your thread_cache_size is fine

MEMORY USAGE
Tuning-primer.sh: line 994: let: expression expected
Max Memory Ever Allocated : 741 M
Configured Max Memory Limit : 5049 M
Total System Memory : 23640 M

KEY BUFFER
Current MyISAM index space = 1646 M
Current key_buffer_size = 476 M
Key cache miss rate is 1 / 56
Key buffer fill ratio = 90.00 %
You could increase key_buffer_size
It is safe to raise this up to 1/4 of total system memory;
assuming this is a dedicated database server.

QUERY CACHE
Query cache is enabled
Current query_cache_size = 64 M
Current query_cache_used = 38 M
Current Query cache fill ratio = 59.90 %

SORT OPERATIONS
Current sort_buffer_size = 2 M
Current record/read_rnd_buffer_size = 256.00 K
Sort buffer seems to be fine

JOINS
Current join_buffer_size = 128.00 K
You have had 111560 queries where a join could not use an index properly
You have had 91 joins without keys that check for key usage after each row
You should enable “log-queries-not-using-indexes”
Then look for non indexed joins in the slow query log.
If you are unable to optimize your queries you may want to increase your
join_buffer_size to accommodate larger joins in one pass.

TABLE CACHE
Current table_cache value = 3600 tables
You have a total of 798 tables
You have 1904 open tables.
The table_cache value seems to be fine

TEMP TABLES
Current tmp_table_size = 128 M
1% of tmp tables created were disk based
Created disk tmp tables ratio seems fine

TABLE SCANS
Current read_buffer_size = 128.00 K
Current table scan ratio = 797 : 1
read_buffer_size seems to be fine

TABLE LOCKING
Current Lock Wait ratio = 1 : 1782
You may benefit from selective use of InnoDB.

As seen from script output, there are certain variables which might be increased a bit for better SQL performance, one such variable as suggested is key_buffer_size(You could increase key_buffer_size)

Now the steps to make the tunings to my.cnf are precisely the same as with mysqltuner.pl, e.g.:
1. Preserve old config variables which will be changed by commenting them
2. Double value of current variables in my.cnf suggested by script
3. Restart Mysql server via /etc/init.d/mysql restart cmd.
4. If mysql runs fine monitor mysql performance with mtop or mytop for at least 15 mins / half an hour.

if all is fine run once again the tuning scripts to see if there are no further improvement suggestions, if there are more follow the 4 steps described procedure once again.

It’s also a good idea that these scripts are periodically re-run on the server like once per few months as changes in SQL queries amounts and types will require changes in MySQL operational variables.
The authors of these nice scripts has done great job and have saved us a tons of nerves time, downtimes and money spend on meaningless hardware. So big thanks for the awesome scripts guys 😉
Finally after hopefully succesful deployment of changes, enjoy the incresed SQL server performance 😉

How to debug mod_rewrite .htaccess problems with RewriteLog / Solve mod_rewrite broken redirects

Friday, September 30th, 2011

Its common thing that CMS systems and many developers custom .htaccess cause issues where websites depending on mod_rewrite fails to work properly. Most common issues are broken redirects or mod_rewrite rules, which behave differently among the different mod_rewrite versions which comes with different versions of Apache.

Everytime there are such problems its necessery that mod_rewrite’s RewriteLog functionality is used.
Even though the RewriteLog mod_rewrite config variable is well described on httpd.apache.org , I decided to drop a little post here as I’m pretty sure many novice admins might not know about RewriteLog config var and might benefit of this small article.
Enabling mod_rewrite requests logging of requests to the webserver and process via mod_rewrite rules is being done either via the specific website .htaccess (located in the site’s root directory) or via httpd.conf, apache2.conf etc. depending on the Linux / BSD linux distribution Apache config file naming is used.

To enable RewriteLog near the end of the Apache configuration file its necessery to place the variables in apache conf:

1. Edit RewriteLog and place following variables:

RewriteLogLevel 9
RewriteLog /var/log/rewrite.log

RewriteLogLevel does define the level of logging that should get logged in /var/log/rewrite.log
The higher the RewriteLogLevel number defined the more debugging related to mod_rewrite requests processing gets logged.
RewriteLogLevel 9 is actually the highest loglevel that can be. Setting the RewriteLogLevel to 0 will instruct mod_rewrite to stop logging. In many cases a RewriteLogLevel of 3 is also enough to debug most of the redirect issues, however I prefer to see more, so almost always I use RewriteLogLevel of 9.

2. Create /var/log/rewrite.log and set writtable permissions

a. Create /var/log/rewrite.log

freebsd# touch /var/log/rewrite.log

b. Set writtable permissons

Either chown the file to the user with which the Apache server is running, or chmod it to permissions of 777.

On FreeBSD, chown permissions to allow webserver to write in file, should be:

freebsd# chown www:www /var/log/rewrite.log

On Debian and alike distros:

debian:~# chown www-data:www-data /var/log/rewrite.log

On CentOS, Fedora etc.:

[root@centos ~]# chown httpd:httpd /var/log/rewrite.log

On any other distribution, you don’t want to bother to check the uid:gid, the permissions can be set with chmod 777, e.g.:

linux# chmod 777 /var/log/rewrite.log

Next after RewriteLog is in conf to make configs active the usual webserver restart is required.

To restart Apache On FreeBSD:

freebsd# /usr/local/etc/rc.d/apache2 restart
...

To restart Apache on Debian and derivatives:

debian:~# /etc/init.d/apache2 restart
...

On Fedora and derivive distros:

[root@fedora ~]# /etc/init.d/httpd restart
...

Its common error to forget to set proper permissions to /var/log/rewrite.log this has puzzled me many times, when enabling RewriteLog’s logging.

Another important note is when debugging for mod_rewrite is enabled, one forgets to disable logging and after a while if the /var/log partition is placed on a small partition or is on an old server with less space often the RewriteLog fills in the disk quickly and might create website downtimes. Hence always make sure RewriteLog is disabled after work rewrite debugging is no longer needed.

The way I use to disable it is by commenting it in conf like so:

#RewriteLogLevel 9
#RewriteLog /var/log/rewrite.log

Finally to check, what the mod_rewrite processor is doing on the fly its handy to use the well known tail -f

linux# tail -f /var/log/rewrite.log

A bunch of time in watching the requests, should be enough to point to the exact problem causing broken redirects or general website malfunction.
Cheers 😉

PixBros a nice Arcade Game remake of Bubble Bobble for GNU/Linux

Monday, September 26th, 2011

PixBros Linux Bubble Bobble like Game Screenshot

While checking my sister’s notebook running Ubuntu GNU/Linux. I decided to check the gui package installer for some new Linux games that entered Ubuntu 11.04. A quick view over the games and I come across awesome game called PixBros

The game is combining three great arcade games from my young years Bubble Bobble, Snow Bros and Tumple Pop . The game really brought some joy to my boring lifeand here it comes I’ve written a small article to share my little joy.

In the game you can select one of three characters and play a remake version of Bubble Bobble on your Linux Desktop. Besides that the music is absolutely awesome like it is with most of the classic arcade games 😉
The game characters graphics is also trendy, like you can see in the screen below:

PixBros Bubble Bobble Linux game like entry Screen characters

The game history is also intriuging and in the old-school arcade games spirit.
PixBros Start New Game screen, game gangsta characters

The game is published under GPL v2, so its one more great game in the family of free software games 😉
PixBros has also port (binary installer) for Windows, Nintendo Wii and few other platforms. As a multi-platform game its very suitable for little Children to develop their reflexes and intellect. Therefore for parents who wants to use free software to grow up their kids mind, PixBros will fit well with other games likeTux Math, Tux Paint, Tux Typing which are stimulating the kid to learn
The game is also great for big kids like me and other arcade maniacs as well 😉
I have only one small note about the game just like with many other Linux games, by default the game starts in minimized screen and trying to play it in fullscreen is only possible by using the menus available from within the game itself.
This kind of behaviour reduces some of the initial game enjoyment and maybe in the future releases of the game let’s say when it reaches stable version 1.0 it will be nice the game to start in fullscreen by default.

The creator team of PixBrosPix Juegos has 4 other games created, all of which are primary developed for GNU/Linux and downloadable from PixJuegos game dev crew official website . Unfortunately the crew official website does not English translation.

The other games from PixJuegos one can enjoy are; A Remake of the classic Atari frog game again for Linux (available for install via a deb package on latest Ubuntu 11.04):

PixFrogger - Atari modern Frog game remake for Linux

A Super Pang modern remake – Pix Pang , below is a screenshot for all those that can’t remember Pang 😉

Super Pang arcade classic screenshot
Super Pang

Here is also a screenshot of PixJuegos’s PixPang running on Linux:

PixPang Super Pang Linux Remake

PixGuegos game development team has also two other games in their site portfolio; this are Garnatron and PixDash . Here are screenshots:

Garnatron Linux Spaceship arcade game screenshot

PixDash Linux arcade game screenshot
Congrats to the guys of PixJuegos for their great Linux games! I wish them a lot of success and a lot of productive years in Linux game development 😉