It came out a few days ago XAMPP 1.8.0 yesterday after upgrading from version 1.7.7 I had a pretty interesting problem. Phpmyadmin-а не ми се отваряше и изгърмяваше със 403

Access forbidden!


New XAMPP security concept:

Access to the requested object is only available from the local network.

This setting can be configured in the filehttpd-xampp.conf”.

Веднага отворих httpd-xampp.conf който при мен се намира в /opt/lampp/etc/extra/, на пръв поглед всичко изглеждаше наред. The LAN rules were fine. Apart from opening from localhost. WTF ??? I looked at the log and saw that my access was cut off from the configuration. Тука вече нещата ме ахнаха и честно казано донякъде малко на късмет открих проблема. След като преглеждах httpd.conf-а видях в Allow/Deny клаузите един последен ред Require all granted. О да еврика. This is the new control mechanism that has entered apache 2.4.x. It gives access or denies access to all required, it generally mimics the Allow / Deny functionality :). To fix the problem add Require all granted in the / opt / lampp / phpmyadmin folder directives. After the changes, it looks like this to me

<Directory “/opt / lampp / phpmyadmin”>
AllowOverride AuthConfig Limit
Order allow,deny
Allow from all
Require all granted
</Directory>

 

Viangi can try other savages, for example to rename the phpmyadmin folder to something else and make an alias to no. But it's uglier and not very meaningful 🙂

p.s I was asked why I use XAMPP and not a clean installation of all components as my Debian gave birth to them – the answer is very very simple – LAZINESS. I'm too lazy to write a few commands and then touch my conf and so on. It is much easier to download the whole package, unzip and burn 😉

Enhanced by Zemanta

A shell script wants your job

Today while I was working I saw that one of the machines was lying very badly. I go into it watching a cron bump into a hell of a lot of zombie processes (roughly around 50-60). There was no way I could kill them all with killall so I had to make a little more competent solution to the problem – to draw an elementary bash a script to find and kill processes. 50-PIDs are not easy to write by hand :D. I scratched the script for a minute and it is very simple, but it still deserves attention 🙂

At its base is the conveyor

ps ax | grep -v grep | grep process_name | awk '{print $1}')

Here we get a sheet with all the PIDs of the process that we have to kill by excluding grep from this list. Now that we have the list, things become easy, everything turns into one for. Here is the end result

#!/bin/bash

PR=$(ps ax | grep -v grep | grep process_name | awk '{print $1}')

for PID in $PR
do
echo "$PID will be killed"
kill -9 $PID
done

Can be “tuning” as the name is taken as an argument after the name of the script and thus is called as executable binary. However, it is not a very good practice to have such frequent cases 😀 But it never prevents us from being protected from any

Enhanced by Zemanta