Installing mysqld on Dreamhost VPS

Filed in dreamhost | mysql | software | unix | web 8 Comments

If you do not already know, PS MySQL is useless! It’s basically a MySQL installation on a VPS where you have control over nothing! The only thing you have is assured memory allocation, which is pretty much useless.

So how? Why not create another VPS and install mysqld on it! Seriously, it’s that simple, with that you get full control of your MySQL server, in a real VPS environment.

Simple steps!

ssh into your VPS

ssh my_vps_admin_username@psXXXXX.dreamhostps.com

where psXXXXX is your VPS server name, like PS23535 etc.

type the following commands to install mysql server and client

sudo apt-get install mysql-server
sudo apt-get install mysql-client
Note
All this point, your installation may fail, with errors like:

Can’t exec “/tmp/mysql-server-5.1.config.181101”: Permission denied at /usr/share/perl/5.10/IPC/Open3.pm line 168.
open2: exec of /tmp/mysql-server-5.1.config.181101 configure failed at /usr/share/perl5/Debconf/ConfModule.pm line 59

when you run:

sudo mount

you will see:

/dev/hdv1 on / type ufs (defaults)
none on /proc type proc (defaults)
none on /tmp type tmpfs (size=128m,mode=1777,nosuid,noexec,nodev)
none on /dev/pts type devpts (gid=5,mode=620)

you need

/dev/hdv1 on / type ufs (defaults)
none on /proc type proc (defaults)
none on /tmp type tmpfs (size=128m,mode=1777)
none on /dev/pts type devpts (gid=5,mode=620)

for your installation to run completely, without error.

Please submit a ticket to DH support, to request for the admin to mount /tmp folder without noexec. However, do note of the potential security issues, you may encounter.

Updates: from dlo in the comment, the default apt-get with DH will install only version 5.0, to get 5.1 while maintaining future update compatibility, simply:

sudo apt-get -t lenny-backports install mysql-server-5.1

Along with the pins in /etc/apt/preferences, this should allow you to keep it updated into the future. lenny-backports is already configured by DH in /etc/apt/sources.list by default.

Add Note
Verified: If you are on a new VPS, it is quite possible that your /etc/apt/preferences and /etc/apt/sources.list are not update or correctly configured for lenny-backports.

In /etc/apt/sources.list you will need to comment out the following line by adding a “#” in the beginning of the line

COMMENT OUT:

#deb http://www.backports.org/debian/ lenny-backports main

then ADD:

deb http://mirror.newdream.net/debian-backports/ lenny-backports main contrib non-free

In /etc/apt/preferences

APPEND:

Package: *
Pin: release a=lenny
Pin-Priority: 500

Package: *
Pin: release a=lenny-backports
Pin-Priority: 200

Package: emacs23
Pin: release a=lenny-backports
Pin-Priority: 900

Package: emacs23-common
Pin: release a=lenny-backports
Pin-Priority: 900

Package: debian-backports-keyring
Pin: release a=lenny-backports
Pin-Priority: 900

if you want to setup for remote access, do the follow:

sudo vi /etc/mysql/my.conf

look for bind-address and change to:

bind-address = psXXXXX.dreamhostps.com

again where psXXXXX is your VPS server name.

mysql -u root -p

then enter your password,

mysql> CREATE DATABASE your_new_database_name;
mysql> CREATE USER ‘newusr’@’psXXXXX.dreamhostps.com’ IDENTIFIED┬áBY ‘your_password’;
mysql> GRANT ALL PRIVILEGES ON *.* TO ‘newusr’@’psXXXXX.dreamhostps.com’ WITH GRANT OPTION;
mysql> CREATE USER ‘newusr’@’%’ IDENTIFIED BY ‘your_password’;
mysql> GRANT ALL PRIVILEGES ON *.* TO ‘newusr’@’%’ WITH GRANT OPTION;

your mysql database user with username ‘newusr’ can now connect from any remote host, since using wildcard “%”.
just change “%” to a specified hostname if you are having a web application connecting to this database from say dreamhost shared hosting, with “%.dreamhost.com” or “%.dreamhostps.com”

alright! written in a bit of a rush cause i wasted many hours trying to install with much complicated methods! gosh*

CS3: Could not use the move tool because the target channel is hidden

Filed in Photoshop | software 17 Comments

ok, so i was in CS3 half way, when i get this error message while trying to move a layer.

Could not use the move tool because the target channel is hidden.

I must have pressed something or clicked somewhere accidentally.
A quick google search, and i found a reference site, which solve the problem.

Solution: Hit key “Q”. This will toogle to edit in either “Quick Mask Mode” or “Standard Mode”.
I guess most of us work in the “Standard Mode”.

Here’s the difference in your “Tools” palette when in different mode. note the rectangular icon with a circle inside.

Editing in Standard ModeEditing in Quick Mask Mode

Reference:
HELP: Cannot Use Move Tool Because…

, , , ,

Mac: Measuring Wireless Signal Strengths

Filed in mac | software | wireless Leave a comment

Very interesting article i found here, about Optimising wireless reception from a distance, using the following command in Terminal:

while x=1; do /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | grep CtlRSSI; sleep 0.5; done

it returns a value in dBm, the wireless radio signal strength.

Quick Look: Mac OS X Mail

Filed in mac | software Leave a comment

It is pretty tiring to have to wait for Microsoft Office to open just to have a quicklook at attachments in Mail. Equally tiring to have to drag the cursor to the attachment, highlight the icon and hit spacebar to quicklook the attachment.

Here’s the shortcut key: Cmd+Y

Shall have knew about this sooner!

Snow Leopard: SpotLight

Filed in mac | software Leave a comment

a while back, i disabled spotlight cause the process mds was totally consuming too much ram.
with improved spotlight in snow leopard, i decided to give it a chance, but totally forget how to enable it back!
so here’s for the reference:

To turn Spotlight Indexing OFF in MAC OS X 10.6 Snow Leopard

sudo mdutil -a -i off

To turn Spotlight Indexing ON in MAC OS X 10.6 Snow Leopard

sudo mdutil -a -i on

Just type the respective command in terminal.
If this don’t help you may follow the instruction on the link in reference.

Reference: Spotlight won’t work?

, , , ,

Vacuuming iPhoto database

Filed in mac | software Leave a comment

with lots of photos events and album in iphoto, really need optimisation! vacuuming do helps quite a bit.

Inside the iPhoto Library Package, there are four SQLite databases (face_blob.db, face.db, iPhotoAux.db and iPhotoMain.db). I found that by vacuuming all four of these databases, I restored iPhoto ’09’s performance back to something on par with its predecessor.

Open Terminal and cd into your iPhoto Library (by default, cd “~/Pictures/iPhoto Library”). Once there, execute the following command:

for dbase in *.db; do sqlite3 $dbase “vacuum;”; done

Source: macosxhints : Speed up iPhoto ’09 by vacuuming its databases

emptying large log files

Filed in mac | software | unix Leave a comment

my apache error_log file was like getting over 400mb! and go googling to figure how to empty these error messages and found this!

# cat /dev/null > /private/var/log/apache2/error_log

that simple! and the error_log file is emptied.
simplest method, fast and easy way to empty any file

,

Mac: Lynx Text Web Browser and SEO-Browser

Filed in mac | software Leave a comment

Being trying out some seo stuff, well, have yet to optimise this site, but was workin on a wordpress site for a client, many interesting reads. one pretty good one will be this:
WordPress SEO by Joost de Valk
well if u googled, he will probably be among the top few in the PR for that search term.

Being using Lynx through SSH on my unix server, so now that i got a mac, Lynx on mac!
a very easy install

may want to check out this cool page SEO Browser
what i find so interesting is that it show you how your site is redirected like those permanently moved 301 and stuff. very good, in fact, i am trying to do something like this now. but more for searching for orphans links, missing images etc.

, , ,

Mac: Installing mySQL in Leopard

Filed in php | software Leave a comment

phew! mySQL is finally working on my Mac OS X 10.5

Leopard comes with Apache and PHP installed but you will need to start Apache
by opening terminal and run:
apachectl -k start

to enable php
refer to Foundation PHP

to auto start apache, go to “System Preference” and under “Sharing”, check on “Web Sharing” this will auto start Apache on bootup

to install mySQL, the pretty challenging part here.
if not done correctly, u probably will get permission error on data, failure to start automatically etc.
jus follow the instruction here:
Installing MySQL on Leopard – Red91.com
will archieve the tutorial here when i can find more time.

, ,

How To: Install mssql extension for php on unix

Filed in php | software | unix 72 Comments

woh! okie.. this installation is gng to be long a tough.. took me a few days of google crawling and testing before i finally get it to work.

okie, why will u need to install mssql extension on php? possibly becos u need to connect to a ms sql server of ur vendor or something like that. for integration i hope. cos unix works best w php and mysql, ie, installation, it is almost already thr. correct me if i m wrong.

so wad you need?
if your server is jus fresh out of the box or say u had installed whm/cpanel there will be quite a far bit of stuff u will need.

1. Txt2man
2. unixODBC
3. freeTDS
4. PHP mssql.so

if this point if you are wondering if i m using any rpm for installation?
sorry,i m not, cos my server centos installed w whm/cpanel seems to be poorly equipped or configured for rpm installation, too many dependencies required. so jus download all the binary and upload them onto ur server.

Setup 1: Install unixODBC package

Install unixODBC first. Download the software in your home directory or anywhere you like and uncompress and untar the software.

You can do this by using following command

# tar -xvzf unixODBC-2.2.12.tar.gz

Once it is done, go to the unixODBCxxxx dir and run the configure command.

# ./configure -prefix=/usr/local -enable-gui=no

Note: If you dont use enable-gui option and dont have Qt package, you will get the error. So make sure you use it if no Qt is installed.

After configure is successfully completed, run the make and then make install commands.

# make

Install it

# make install

Step 1.1: Installing Txt2man
this step is optional if your server already have txt2man installed.
txt2man is required by freeTDS to man it documentation, i do find this portion pretty useless though.
else jus download the package, and run the make

# make

Install it

# make install

Step 2: Install freeTDS package

Download the freeTDS package and untar and uncompress it.

# tar -xvzf freetds-stable.tgz

Run the configure.

# ./configure -with-tdsver=8.0 -with-unixODBC=/usr/local

Run the make

# make

Install it

# make install

Step 3: Configuration freeTDS
Start configuration with freeTDS. Look for the freetds.conf file and add the entry for the MS SQL server.

[MSHOSTNAME]
host = MSHOSTNAME
port = 1433
tds version = 8.0

Sql server standard port is the 1433. The tds version for MS SQL server 2000 is 8. You can try 8.0 with new version as well.
Important: the host need to be the same as the declaration. ie
if you have [mssql.hostname.com], ur host will be = mssql.hostname.com

Step 4: Configuration – unixODBC

The unixODBC need two main configuration files called odbcinst.ini and odbc.ini. These files should be in the /etc/ dir.

I. The first file odbcinst.ini contain the definition of ODBC driver.

[TDS]
Description = FreeTDS driver
Driver = /usr/local/lib/libtdsodbc.so
Setup = /usr/local/lib/libtdsodbc.so
Trace = Yes
TraceFile = /tmp/freetds.log
FileUsage = 1

Note: Before making above entries, make sure libtdsodbc.so exists in the /usr/local/lib dir.
In the above configuration, we have define TDS as driver.

II. The second file is odbc.ini. This file has information about your MS SQL database.

[MSHOSTNAME]
Driver = TDS
Description = MS SQL Test
Trace = Yes
TraceFile = /tmp/mstest.log
Servername = 192.168.1.100
Database = testdb
Port = 1433

You can notice above that the freeTDS driver is the name defined in odbcinst.ini while servername is the one defined in freetds.conf.

Step 5: Test MS SQL connectivity from Linux box
Check if you can connect to MS SQL database using unixODBC tool called isql.

# isql -v mstest satest satest
+—————————————+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+—————————————+
SQL> select * from “sysObjects”;

If you see the results, you are connected.

Step 6: Getting your mssql.so file
Update: I came back to follow this to create an .so file and realise, mmm, this instruction wasn’t too clear. So here it goes. From PHP.net Download page, download the source code, then if you unzip, you will find a folder “ext” and “mssql” in the “ext” folder. tat’s the folder i m referring to, ‘cd’ to this folder and then run phpize as below mentioned.

Add: for the benefits of those who just need the .so file, you can download the mssql.so from here. however, i don’t assure, compatibility with you php version. is built with php 5.2.10 binaries.

php.net is not distrubuting the binary version of php package for *nix server, so you will have to create the .so extension file yourself. download the source file for php and upload the folder /ext/mssql/ into your server
then

# cd /uploaded_path/mssql/
# phpize
# ./configure
# make
# make install

this commands will automatically create a copy of mssql.so in the installed extension folder.
you can check your extension folder from

<?php
phpinfo();
?>

Step 7: Enabling the extension

# echo “extension=mssql.so” > /usr/local/lib/php.ini

or you can use a texteditor and add that value manually into php.ini

Step 8: Restarting Apache Server!
dependin on version installed and location

# /etc/init.d/httpd restart

and you are done!
do drop me an email should you face any problem at any step!
i know the pain in gettin this extension installed on unix. and considering rpm fails to work in the first place.
i will say, this is the best way to get it installed, cos u have full control over it. and didn’t fail me, of cos, after hell lots of googling around.

Source:
dpacool.com
unixodbc.org
Scott’s Blog
PHP PECL

, , , , , , , , , , ,

TOP