Saturday, October 31, 2009

Speeding up Firefox

If you use Firefox and have found it slow starting up or laggy typing into the address bar, install the oddly named 'Vacuum Places Improved' add-on from https://addons.mozilla.org/en-US/firefox/addon/13878.

It adds a little icon to the status bar allowing you to defragment Firefox's places.sqlite database file with a single click- that's the file that holds all the information about your browsing history etc.

I've installed it in FF on all the computers I use and noticed a considerable improvement. On my laptop the places.sqlite file was initially 25Mb and after 'vacuuming' its 15Mb. On my desktop, Firefox had almost ground to a halt, often taking over a minute to start up, and when you clicked into the address bar it took around 10 seconds before you could actually type anything! After 'vacuuming', FF starts up in 10 seconds and typing into the address bar is fine.

I highly recommend this if you use Firefox and notice any performance issues. Obviously its not going to solve memory leak (FF's other big problem) but it's a big help nonetheless.

Just to explain - the extension doesn't delete anything, it just optimises the file that holds all the data so that that data can be found more quickly.

You can set the statusbar icon to be hidden and only reappear a certain number of days from the last 'vacuum' to remind you to run it, or it can set to automatically run every x number of days.

Thursday, October 8, 2009

Changing the document root in XAMPP

I know this has been covered many times before but I've found myself Googling for this info a number of times now and thought if I wrote it here then at least I'd know where to look next time!

After installing XAMPP on Windows, the document root, by default, is set to C:/xampp/htdocs (that is, if you installed xampp into the root of the C: drive).

In this particular case I wanted to change the root directory to the sites directory in my Dropbox (C:/Documents and Settings/[username]/My Documents/My Dropbox/sites/)

To do this, open xampp/apache/conf/httpd.conf and edit the 'DocumentRoot' setting (line 188 in the version I have) to the required path (as above). Several lines below where it says "This should be changed to whatever you set DocumentRoot to" (line 215) change the Directory path to the same thing.

Open xampp/php/php.ini and edit the 'doc_root' setting (line 804) to be the same path as above.

Save both files and restart apache. This should do the trick.

UPDATE: As pointed out in the comments, I'd forgotten about my MySQL data. To move the MySQL data into Dropbox:

Open xampp/mysql/bin/my.ini and:
- under [mysqld]:
- change datadir (line 30) to the full path to the mysql data directory on Dropbox.
- change log_error (line 45) to the same path as above PLUS '/mysql.err'.
- change general_log_file (line 48) to the same path as above PLUS '/mysql.log'.
- change slow_query_log_file (line 50) to the same path as above PLUS '/mysql-slow.log'.
- below where it says "Uncomment the following if you are using InnoDB tables"
- change innodb_data_home_dir (line 137) to the same path as above.
- change innodb_log_group_home_dir (line 139) to the same path as above.

Move contents of xampp/mysql/data into the new mysql data directory in Dropbox.