How to , and other stuff about linux, photo, php … A linux, photography blog. To remember some linux situation, and fix them quickly.

May 9, 2013

Virtualbox same UUID as an existing virtual machine

Filed under: Linux — Tags: , — admin @ 11:49 am

Long time no post.
Well because I want to test a lot of things, well I work with virtual box. Well but because I need more then one server on my virtual network I have to use same image more time to create more instances. However if you want to add another instance with same vdi/vbox file you will have the error.
“Trying to open virtual machine located in … vbox
“Trying to open a VM config ‘…vbox’ witch has the same UUID as an existing virtual machine.”

Well unfortunately there is no short fix with some dialog box to hit it. So to fix this you have to go on folder where is your virtbualbox installed if is not in default directory as

C:\Program Files\Oracle\VirtualBox\

And run this
VBoxManage.exe internalcommands sethduuid “c:\path\MyVM.vdi”

Now you can hit new button chose what you want and on third section just pick up “use an existing virtual hard drive file” and pick this c:\path\MyVM.vdi

Hope will help someone.

March 14, 2013

Varnish Error 503 Service unavailable… Guru Meditation

Filed under: Linux — Tags: , , — admin @ 2:07 pm

Today I have face a big problem while using varnish with nginxcp + cpanel on a vps server .
Well the main site was working that was using a wordpress, however admin area because have a lot of plugins crashed with that stupid error.
So after a long search in ngnix log I find this error
upstream prematurely closed connection while reading response header from upstream
and this
an upstream response is buffered to a temporary file

However this seem’s that are not the problem for unavailable problem. However a fix for those error is to disable log in proxy.inc just add
proxy_buffering off;

However the fix is this in the varnish configuration default.vcl
backend default {
.host = “127.0.0.1”;
.port = “81”;
}

So after I modify this with

backend default {
.host = “127.0.0.1”;
.port = “81”;
.connect_timeout = 120s;
.first_byte_timeout = 120s;
.between_bytes_timeout = 120s;
}

The problem suddenly disappear . So basically the timeout should be increased for admin area if you have a lot of plugins there in wordpress and you are on a small vps.

January 28, 2013

Centos 6 pecl install memcached error

Filed under: Linux — Tags: , , , — admin @ 5:50 pm

Today I try to install memcached on a server with centos 6. So basically when I hit
pecl install memcached
I get a lot of errors
checking for libmemcached location... configure: error: memcached support requires libmemcached 1.0.x. Use --with-libmemcached-dir= < DIR> to specify the prefix where libmemcached headers and library are located
ERROR: `/var/tmp/memcached/configure' failed

So if I try to install libmemcached by using
yum install libmemcached libmemcached-devel
I see that version of libmemcached will be smaller then 1.0.x

So to install it
cd /usr/local/src
wget https://launchpad.net/libmemcached/1.0/1.0.15/+download/libmemcached-1.0.15.tar.gz
tar -zxvf libmemcached-1.0.15.tar.gz
cd libmemcached-1.0.15
./configure
make
make install

After this try
pecl install memcached

For me this was the working version.

January 4, 2013

how to modify nginxcp vhost templates

Filed under: Linux — admin @ 1:52 pm

Hmm
Today I face a little problem. I install on a server nginxcp, and because I wanted varnish also, I have to modify nginx to run on other port then 80. So basically I modify zones every time after I have add them, but how to automate this.

After a little search and no answer I found the file that is responsibly for this.

So basically in /scripts/ you will find a new file called createvhosts.py

You have to modify here what you want to be keep into your zone automatically.
So to change the port from 80 to 81, I just have to modify this line
listen %s:80;
into
listen %s:81;

Please notice that are 2 modification that you have to do on that file.

If this help you please make a social bookmark for our site / page

Regards

December 16, 2012

How to update DomainKeys on a cpanel server with existing accounts

Filed under: Linux — Tags: , , , — admin @ 2:30 pm

Hello ,
Well, I have a main server with cpanel , because is easy to make e-mail account’s there , and other server for other big sites. So basically I create account on cpanel server and after that I move ip to point to other server.
However if you server crash and you restore the cpanel account it appear that cpanel rebuild the dns zone, and you have to work twice, to redo the ip to old server .
If is one domain is easy but if you have a few , then a solution is to, restore /var/named files from backup that you made, and /etc/named.conf. After this what I do was to chattr +i /var/named/*.db . In this way cpanel will keep my old configuration. However your cpanel serve will create new dkim files for you, and you will have old values on your *.db files.
So, how we fix that ?
Firs of all when the restore is done make then movable again chattr -i /var/named/*.db
After this just run :
for user in `ls -A /var/cpanel/users` ; do /usr/local/cpanel/bin/dkim_keys_uninstall $user ; done
This will erase old dkim configuration for you, when is done run :
for user in `ls -A /var/cpanel/users` ; do /usr/local/cpanel/bin/dkim_keys_uninstall $user ; done

Now you have all information updated . Off course you should use those generated files from /var/cpanel/domain_keys on other server if you send mail from there also .

Best regards

« Newer PostsOlder Posts »

Powered by WordPress