Top Nav

Archive | Uncategorized

Install Scalr Command Line Utilities on CentOS 6.4

For managing cloud clusters we love Scalr both as a hosted service and using the open-source self-hosted version. One of the best features is the easy to install and use command line utilities.

Here are the docs:

http://wiki.scalr.com/display/docs/Scalr+Command+Line+Tools

Here’s the install steps for CentOS 6.4:

1. Install python setuptools package:

2. Install python scalr package:

3. Run scalr configure to setup access credentials. See the docs for details but something like this:

And now your ready to go.

 

 

 

 

 

 

0

Find Malware Hidden In Image Files

Hackers will often try to hide malicious code in files with image extensions like “.gif”. Here’s a command line that will help identify suspicious files:

Not every file returned in this scan is malware. Pay special attention to files of type text. It’s not unusual to see an image file where the file extension does not match the content – so a .png file might actually contain a JPEG file.

0

SVN – Show Changed Files Between Revisions

To get a list of files changed between two revisions in subversion use this command:

Replace [RNUM1] and [RNUM2] with the revision numbers. [RNUM2] can be HEAD for the most recent version.

0

RackSpace Cloud Server With Multiple SSL Certificates

A recent configuration issue that we encountered involved trying to host multiple SSL enabled websites on a RackSpace Cloud Server with RackConnect. Each cloud server get’s only a single IP address but SSL requires each site to have a separate IP address. The work around then is to use a RackSpace Cloud Load Balancer to route additional IP addresses to the the cloud server on alternate ports. So for example if we have a cloud server at 10.10.10.1:

a. https://www.acme.com points to 1.2.3.4:443 on the load balancer with the backend node configured to route to 10.10.10.1:8443

b. https://www.mace.com points to 1.2.3.5:443 on the load balancer with the backend node configured to route to 10.10.10.1:8444

b. https://www.case.com points to 1.2.3.6:443 on the load balancer with the backend node configured to route to 10.10.10.1:8445

Now this looks like it should work. On the cloud server we just have to configure each of the virtual hosts to listen on the appropriate port.

But there is a catch, the ServerName in each virtual host must be in the form “acme.com:8443” … including the port number. Then when the server get’s a request like this where “admin” is a directory:

https://www.acme.com/admin

It tries to redirect to:

https://www.acme.com:8443/admin

This is the “trailing slash redirect” provided by mod_dir. The problem is Apache can’t for a proper self referencing URL because the ServerName includes the port number.

The solution we found for this problem is to bind the virtual host to a private address on the loopback interface and then frontend the instance with a virtual host using mod_proxy.

Here’s how it works:

a. the real virtual hosts are bound to 127.0.0.x addresses

Site A-Real goes on 127.0.0.2:80/443
Site B-Real goes on 127.0.0.3:80/443
Site C-Real goes on 127.0.0.4:80/443

b. the proxy virtual hosts are bound to the actual network interface:

Site A-Proxy goes on 10.10.10.1:8082/8443
Site B-Proxy goes on 10.10.10.1:8083/8444
Site B-Proxy goes on 10.10.10.1:8084/8445

Here’s a template for the real site config:

And here’s the proxy config:

0

Plesk – Howto Clear Hung Database Copy

Recent versions of Plesk include a “Make a Copy” feature for databases. Unfortunately, on occasion the copy will fail but the copy task will not be removed. Then you’ll see a message like this every time you go to the affected database in Plesk.

You can view a list of the current tasks with the following command from a root ssh login:

You can clear the task by running the following command:

0