Category Archives: Linux

WordPress drama – wp-login.php

We experiece alot of occasions lately that ppl are trying to crack a wordpress “admin”  login. to post spam or something on a wordpress blog. Change the standard username / password if u wanna be safe and dont wanna have a hosting company complain at u. We have been experiencing a higher load then useual on our shared servers lately.

If someone wont respond then we take action and use one of the following samples:

Create a .htaccess file or edit it, and put in the following:

<Files wp-login.php>
AuthUserFile /home/vhosts/
AuthName “Private access”
AuthType Basic
require valid-user

Generate a .passwd file on the desired location:
htpasswd -c /home/vhosts/ username

I know, i havent done anything like that yet, i dont care till i will be spammed till a load of 10, and then ill see if i use this or use any of the following options on the WordPress FAQ

gr gr Thomas ;)

Xenserver stuck VM / VDI is not available / Master switch

Xenserver stuck VM / VDI is not available / Master switch


Please only execute these commands if ur comfy with ssh and xenserver, if u dont know what ur doing u can get urself in alot of trouble by killing the wrong vm’s etc. Dont blame me if u seriously break something :).

Stuck VM:

  1. Try it first the normal way if a powerstate is stuck…
    xe vm-reset-powerstate force=true vm= “windows2″
    If this does not work, try the the next method.
  2. List the domains on the server and grep the UUID of the hung vm. U can find this info under the general tab in xencenter or under # xe vm-list on the host where its running.
    list_domains | grep 84e7e227-63b3-c518-4904-5d8b9cba7091
    The number it finds under the uuid is the domain of the hung vm.

    cd /opt/xensource/debug/xenops destroy_domain -domid 27

VDI is not available:
If u have an犀利士
y snapshots, remove those.. it will confuse u.. there might be a way to do it without removing them, but i do that most of the times.. or i just convert them to a new vm.

On the xenserver where the vm was last active and running:
xe vdi-list | grep -B1 [vmname] | grep uuid
Use that uuid to paste in the following command:
xe vdi-forget uuid=4dfb5f8c-0df7-4b4a-b5b0-c484c2f7247a
This will make your vm loose from the disk, and u need to reattach it.
Do a rescan on your storage repository, and click the vm u just deattached the disk of and reattach it.

Xenserver master change/switch:
First disable the High availibilty on the pool of servers:
xe pool-ha-disable
Check what server is the poolmaster(99% its the server in the top):
xe host-list
Copy the UUID from the new master host, paste/execute the next command with the new uuid (just a example):
xe pool-designate-new-master host-uuid=116ceeb1-c923-40ec-8ac6-243c89512908
Your xencenter will disconnect for a abit till its fully back again, and no servers are in mainance, activate HA again:
xe pool-ha-enable

Grgr Thomas!

ProFTPd create a directory with another user.

Make sure the server type is standalone
ServerType Standalone

Next load the module in the proftpd.conf

<IfModule mod_cap.c>
CapabilitiesEngine on
CapabilitiesSet +CAP_CHOWN
Set the directory permissions for the right user/homedir, make sure this path is the same as the DefaultRoot
<Directory /var/www>
UserOwner apache
GroupOwner apache
Umask 002 003
It could be that the user needs rights to the apache group.
adduser ftpusername
usermod -g apache ftpusername
This solved it for me atleast…
Gr gr