Recent Posts by youresolutions

Subscribe to Recent Posts by youresolutions 12 post(s) found

14 Oct, 2010 10:45 AM
Avatar youresolutions 12 posts

Topic: Brightbox Help / ActionMailer, postfix and TLS

Thanks for the tip Chris, I’ll give it a go!

 
06 Oct, 2010 08:46 PM
Avatar youresolutions 12 posts

Topic: Brightbox Help / ActionMailer, postfix and TLS

Hi,

I’ve recently
1) updated to Rails 2.3.8
2) updated to Ruby EE 1.8.7
3) had a few other bits updated automatically during apt-get upgrade

This stopped ActionMailer sending out emails

Rails log says:
OpenSSL::SSL::SSLError (hostname was not match with the server certificate):

mail.log says:
Oct 6 20:15:48 myhostname postfix/smtpd25289: lost connection after STARTTLS from localhost[127.0.0.1]
Oct 6 20:15:48 myhostname postfix/smtpd25289: disconnect from localhost[127.0.0.1]

After Googling, I’ve put
smtpd_use_tls=no
into my postfix main.cf as a workaround (mail is sending again) but I don’t know what the consequences might be.

Any advice?

Cheers,
Ian

 
20 Nov, 2009 11:16 AM
Avatar youresolutions 12 posts

Topic: Brightbox Help / Creating a 2nd application

Hi Mike,

In the config/deploy.rb of your new application, on about line 8 set the name of your application to be unique (this also determines the directory it’ll be uploaded to) and it’ll run alongside the other one on the same Brightbox. Also set the domain name, etc, while you’re there.

Cheers,
Ian

 
12 Nov, 2009 09:19 PM
Avatar youresolutions 12 posts

Topic: Brightbox Help / Odd MySQL results with ORDER BY and indexes

Hi John,

Thanks for looking into it and for the extra info. The underlying issue isn’t resolved though. I have gotten around it by putting in a superfluous condition (cemetery_id < 1000, also indexed) that I know always evaluates to true but MySQL needs to check so app is working (the main thing).

I have run the query direct from the mysql client on my brightbox and still get odd results (showing the first row of 30):

SELECT * FROM burials WHERE (surname LIKE ‘fred%’ or first_name LIKE ‘fred%’) ORDER BY surname ASC LIMIT 0,30;
-————————--——————————-—————--———————-————--—————-———-—————————————————————————--———————————————————--————-
| id | cemetery_id | filename | surname | first_name | section | row | number | age | address | created_at | updated_at | interred |
-————————--——————————-—————--———————-————--—————-———-—————————————————————————--———————————————————--————-
| 89131 | 2 | Barnsley INDEX N-Z.csv | NADIN | William | H | | 417 | 53 | Station Lane, Summer Lane | 2009-07-15 16:47:28 | 2009-07-15 16:47:28 | 1870-04-19 |

Thanks,
Ian

 
30 Oct, 2009 07:16 PM
Avatar youresolutions 12 posts

Topic: Brightbox Help / Odd MySQL results with ORDER BY and indexes

I had a slow query to sort out so added missing indexes to surname and first_names to improve. I think this is when the behaviour changed.

The following query now incorrectly returns all rows, ie, including people who aren’t fred (187,000):

SELECT * FROM `burials` WHERE (surname like ‘fred%’ or first_name like ‘fred%’) ORDER BY surname ASC

This query, without the ORDER BY, returns 3,002 rows (about the right number):

SELECT * FROM `burials` WHERE (surname like ‘fred%’ or first_name like ‘fred%’)

Not sure what to do here as my app’s broken but I don’t think it’s a logic problem. My local dev database (on older MySQL 5.0.67) does not have this behaviour.

Any ideas?

(Fortunately the live query has a LIMIT.)

Thanks,
Ian

 
25 Sep, 2009 04:12 PM
Avatar youresolutions 12 posts

Topic: Brightbox Help / Changed service rootfs?

Ah, hoping it’s this: http://status.brightbox.co.uk/2009/09/san3-crash/
(Relief!)

Edit: Thanks Rahoul

 
25 Sep, 2009 04:01 PM
Avatar youresolutions 12 posts

Topic: Brightbox Help / Changed service rootfs?

I got this message from my Brightbox

Changed Service rootfs

Date: Fri, 25 Sep 2009 15:20:59 +0000
Action: alert
Host: youresol-001.vm.brightbox.net
Description: ‘rootfs’ filesytem flags changed to 0×1c01

Your faithful employee,
monit

What does it mean?
All sites are down except the default one (Welcome to Brightbox), but with CSS and images missing.

SSH is inaccessible.

I have tried a soft reboot and hard reboot and ten minutes later, nothing. The Brightbox is completely inaccessible.

I haven’t done anything with it personally — just a handful of sites running as usual and a backup and edited a few web documents this morning.

Any ideas?

Thanks,
Ian

 
25 Sep, 2009 03:55 PM
Avatar youresolutions 12 posts

Topic: Brightbox Help / www subdomain doesn't work

Hi Michael,

From
http://wiki.brightbox.co.uk/docs:gemv2:domains

I think you’re missing
cap deploy:setup
before
cap deploy:web:reload

Cheers,
Ian

 
01 Aug, 2009 09:34 AM
Avatar youresolutions 12 posts

Topic: Brightbox Help / Unplanned reboots

Hi John,

Thanks for your reply. Yes, it looks very well like it’s down to memory use but hung before logging. An upgrade is needed.

I’m looking forward to your Passenger tweaking guide, especially if you can add some comments/wisdom that goes beyond the documentation.

Cheers,
Ian

 
31 Jul, 2009 09:19 AM
Avatar youresolutions 12 posts

Topic: Brightbox Help / Unplanned reboots

Occasionally my Brightbox reboots without my requesting it. (Between 7 and 30 days or so.) It did it most recently 08.46 UTC today. Is this due to the physical server being rebooted, and to be expected, or is it something I should look into? Is there a way to check, a log file to look at?

 
25 Jun, 2009 11:34 AM
Avatar youresolutions 12 posts

Topic: Brightbox Help / Backing up MySQL databases to a remote FTP server

Ouch. I can see there’s a problem leaving login details to backup systems on the server. I’ve taken your advice on board and gone with modifying the backup script and setting up rsync+ssh to get most of /home/rails (plus Time Machine for accidental/malicious deletes being synced).
Cheers, Ian

 
19 Jun, 2009 04:41 PM
Avatar youresolutions 12 posts

Topic: Brightbox Help / Backing up MySQL databases to a remote FTP server

Hi all,

Today I wrote a script to do daily backups of our databases on our Brightbox and then FTP the compressed files off to another server. I’m no sysadmin so I have no idea whether I’ve reinvented the wheel. Anyway, hope somebody finds it useful too or can offer a better solution.

If you spot anything wrong, please let me know.

Cheers,
Ian

First put the host and credentials into MySQL options file:

/home/rails/.my.cnf
[client]
host=sqlreadwrite.brightbox.net
username=myusername
password=mysecretpassword

$ chmod 600 /home/rails/.my.cnf

Set up the cron task. Here I’ve chosen 4.20pm each day.
I got help from this article http://wiki.brightbox.co.uk/docs:cron

$ crontab -e
20 16 * * * /home/rails/backup/mysqlbackup.rb

(Quick vim: press ‘i’, edit file, press Esc, type :wq [return])

Write Ruby script — change your database names, prefix and FTP info

(I saved mine as /home/rails/backup/mysqlbackup.rb)

Make script executable
$ chmod +x /home/rails/backup/mysqlbackup.rb

The Ruby script:

#!/usr/bin/ruby

require ‘net/ftp’

prefix = ‘myusername_’
dbs = [‘app1_production’, ‘app2_production’, ‘app3_production’]

backups = []

ftp_host = ‘ftp.example.com’
ftp_user = ‘username’
ftp_pass = ‘secret’
ftp_dir = ‘path/to/brightbox_sql_backups’ # create this first!

dbs.each do |db|
file = “#{Time.now.strftime(”%Y%m%d-%H%M")}-#{db}"
sql_file = file + ‘.sql’
bz_file = file + ‘.tar.bz2’
system(“mysqldump #{prefix}#{db} > #{sql_file}”)
system(“tar cjf #{bz_file} #{sql_file}”)
system(“rm #{sql_file}”)
backups << bz_file
end

ftp = Net::FTP.open(ftp_host) do |ftp|
ftp.login ftp_user, ftp_pass
ftp.passive = true
ftp.chdir ftp_dir
backups.each do |backup|
ftp.put backup
system(“rm #{backup}”)
end
end