web stats OS X Client Server



Monitor and Keep Postfix Running on OS X

December 20th, 2007

For some reason my postfix mail server kept crashing and would not stay up longer then one day. This got really annoying and made it impossible to use my server for any sites that had any email aspect to them. This week I found a really good way to monitor and keep postfix up and running at all times.

To do this you will need Webmin installed so if you dont already go install it now. Here are the instructions: Install Webmin on OS X

To set up a Postfix monitoring system:

1. Open Webmin

Webmin

2. Click the “others” tab

Webmin Others tab

Read the rest of this entry »

Help, Where did all my drive space go?

August 11th, 2007

I noticed this week a big problem with my OS X Server. The finder was telling me that I only had 3 gb available. I counted the size of all the folders in my drive and it looked like I only had used about 15 gb so I should have 45 gb of free space. Some how I was losing 45 gb of space I no mater what tools I used I could not find was was stealing my hard drive space. On top of this my drive was filling up fast. Each day I lost more and more of the drive space. Soon this drive would be full.

I tried calling apple and their only suggestion was to format the drive. Since this was my server I dreaded this option. Luckily before I reported the brutality of a reformat I did a little creative googling. I found a few different forum posts that when used together saved my sanity..

The first command which found where the problem files were is:

In the terminal type (this command takes a long time to complete):

sudo /usr/bin/find -x / -size +40000000c -exec /bin/ls -lh “{}” \;

That command will find and list all the large files on your hard drive.

In my case the problem was a bunch of MYSQL Replication bin log files that were over 1 gig each.

To delete the old mysql_binary_log files I ran this command in mysql:

Login to mysql: mysql -u username -p

Then type

PURGE MASTER LOGS BEFORE DATE_SUB( NOW(), INTERVAL 5 DAY);

That command will remove any bin that are older then 5 days.

Running that one line command save me countless hours of work.

I has a similar problem with my relay logs on one of my slave servers.
running the command:
sudo /usr/bin/find -x / -size +40000000c -exec /bin/ls -lh “{}” \;

showed me that my problem was with my relay logs.

Im not sure that this is the right way to fix the relay log problem but it worked in my situation:

type in mysql:

change master to master_host='’”;

This changes the master host and deletes the old logs. This may not be how you want to do this because you might need restart replication.

Gzip Error: ob_gzhandler conflicts with zlib output compression

July 4th, 2007

PHP Notice reporting
I started getting this error when I enabled gzip compression for my server:

[Wed Jul 4 23:17:05 2007] [error] PHP Warning: ob_start() [ref.outcontrol]: output handler ‘ob_gzhandler’ conflicts with ‘zlib output compression’ in /script.php on line 419

I fixed it by adding this to my .htaccess file:

php_flag zlib.output_compression Off

I think the reason it was happing was that one of my scripts was trying to turn on compression when it was already on..

Another option would be to open the script causing the problem and edit out the lines that call compression.

Errors on The iPhone site

June 11th, 2007

I was just checking out apples new layout and drooling over the iPhone
when I noticed a mistake on the maps screen shots.
If you go to http://www.apple.com/iphone/technology/wireless.html
you will see that the maps program is just poorly pasted over the main menu.

iPhone screenshot error

It should look like:

iPhone screenshot Fixed

Apple Feel free to use the fixed image, all I will charge you is a free iPhone ;->

So what does this mean?
Nothing really but maybe just maybe it means the maps program was not finished and the final will have GPS… Well at least I can dream….

Installing programs with the shell in OS X

May 6th, 2007

Luckily on OS X most programs come with a nice installer program that allows you to click enter 3 or 4 times and magically the program is installed. Once and a while you may need to install and configure the script thru OS X’s Unix Shell via the Terminal. When ever I have to do this a small chill goes down my back. Most of the time it ends up being fairly straight forward but I am always away of the dangers of using the terminal. One wrong command can do a whole lot of damage. Typical steps for installing with the terminal are:

OS X Terminal

1 - Open a Terminal window (Applications -> Utilities - > Terminal)

Navigate to the folder of the script you are trying to install.

Type:
Read the rest of this entry »

Enable PHP Includes on OS X

April 23rd, 2007

PHP

Im in the process of switching to a new server. Tonight I noticed in my error log:

/var/log/httpd/error_log

This error:

[Mon Apr 23 02:27:30 2007] [error] PHP Warning: include(/script.php) [function.include]: failed to open stream: no suitable wrapper could be found in /script.php on line 26

I search around a bit and found the problem. The default instalation turns Has includes set to off for sucrity reasons. If you want to enable includes open:
Read the rest of this entry »

Lost in transfer: Files going to wrong desktop.

April 15th, 2007

Today I was backing up my servers mysql database remotely using:

/usr/local/mysql/bin/mysqldump -u username -ppassword –skip-lock-tables –add-drop-table –all-databases > remotebackup.sql

I was using the Command Shell in Webmin

Webmin
Read the rest of this entry »

Install Webmin server tools on OS X

April 15th, 2007

Webmin is the best tool I have ever used for OS X server. Webmin allows you to configure and monitor all of your servers parameters remotely.

Webmin
Here is a list of some of Webmins features:

-Configure almost all Apache directives and features.
-Create and edit domains and DNS records.
-Perform manual or scheduled backups and restores of configuration files managed by Webmin modules.
-View reports on bandwidth usage by host, port, protocol and time on a Linux system
Read the rest of this entry »

Optimize and Repair MYSQL Database on OS X

February 11th, 2007

MYSQL comes with a very powerful tool to optimize and repair your database called mysqlcheck.

MYSQL

To have mysqlcheck check and repair all of your databases:

Open a Terminal window (Applications -> Utilities - > Terminal)

OS X Terminal
Read the rest of this entry »

Can’t connect to local MySQL server through socket /tmp/mysql.sock os x- ERROR 2002 (HY000) os x

December 4th, 2006

MYSQL

The other day suddenly MYSQL on my OS X web server stopped working.
I was getting this error:
ERROR 2002 (HY000) Can’t connect to local MySQL server through socket /tmp/mysql.sock

Read the rest of this entry »