Skip to content

Posts tagged ‘Lion’

29
Oct

Mac, Lion and the Lost Installer

Imagine you have an older Mac (like my Mac Book Pro 15” from 2005), you have Lion installed (last OS that it takes) and then you want to give this one to someone else.
Now the first thing that you for sure want to do is to erase the entire content of your hard disk and then re-install Lion from scratch to be sure that the new owner does not have access to your data.
If you have a Lion Installer Thumb Drive you can now reboot your Mac while holding the Option key. Then you select the ER Built (USB Icon) drive.
After the Installer comes up you can go to the Tools menu section, select the Disk Utility and format your boot drive. After this is done restart, hold the Option key and select again the Installer Thumb Drive.

Problem

If you were unlucky like I was then you will see a dialog that says:

There was a problem installing Mac OS X. Try reinstalling

What the ….?

First I thought the thumb drive is bad, then I doubled checked that both the Thumb Drive and the Mac’s boot drive are OK. Finally, just before giving up, I googled the problem and found an Apple Discussion that discussed the problem and had a solution.

Solution

It turns out that I had to reset the PRAM in order to be able to Install Lion again. As much as I love the ease of use of OS X sometimes it comes with a huge price tag. I would never have thought of this and I was spending a considerable amount of time to try to resolve it before I searched the Internet. It would have been nice if the Mac could give a hint of what is the problem and not just displays this somewhat useless Dialog.
Especially considering that this is rare but still possible scenario for a regular Mac user.

At least I got passed that issue and could installed Lion again.

Cheers – Andy

29
Aug

Busy Weekend Fixing Stuff

On Friday something very strange happened – when I read an email from my company mail server all mails from the INBOX just disappeared. My wife still had hers and so when I checked out the OS X Lion Server I saw that Dovecot’s cur directory was empty but emails were inside a new directory called extra-cur. Because I could not figure out how to transfer back and my mail server setup was screwed anyhow I re-installed and setup the server from scratch again and now mail is working fine again with all bells and whistles.

On a side thing I discovered how to setup a web site with WordPress and how to use a Markup plugin (BlogText) so that I can also have my wiki on WordPress as well. This means it would be dead easy to manage my site having only to deal with WordPress. But then I thought that I might want to stop dealing with my own Site and hand this over to a hosting company. Beside the emails there is nothing confidential on our site and emails are not secure at all so handing over the hosting of the site to another company is not only freeing myself from having to deal with setting up my own server but also saves a ton of money.

Because we are moving in 2 or 3 weeks I want to make the switch beforehand. This means that I have to convert / adjust our website which needed an overhaul for quite some time, move over the XWiki content which is harder to do because of the number of pages and images and finally to setup the site so that the old links are still working (at least for all the content that wasn’t retired).

– Andy

21
Aug

Which Version of BBedit

Today I decided it was time to finally buy BBedit because I have a lot of HTML documents to edit and so this seemed to be the perfect time to do so. But then I had to decide if I buy the regular version or the Mac App Store version. Normally I would prefer the App Store version but then I checked out the most critical reviews and saw that BBedit is sandboxed and so I cannot edit files that need superuser rights. This is the same reason why SuperDuper will never be sold on the App Store and a few other applications. So I decided to go with the regular version and I works great so far.

For now I have a little bit of a problem with MarsEdit where I can only edit the 1st document with BBedit as external editor (Edit with BBedit) because in any subsequent edit MarsEdit will not recognize the end of the editing session and so I’ll lose any changes. I reported that to Red-Sweater and hope that I can fix that soon because that would be a great combination.

– Andy

20
Aug

OS X Lion, MySQL and WordPress

Today I wanted to create a local copy of a remote WordPress blog / site and stumbled over some nasty business with PHP and MySQL. I am not sure how is at fault (probably Apple) but I am not 100% sure.

After exporting the site, installing MySQL and creating the wordpress user and DB schema I was ready to install WordPress. So I extracted wordpress, copied into /Library/Web/Data/Site/Default and opened http://localhost/wordpress on my Safari browser. After telling wordpress to create the configuration file I entered the necessary data (schema name, user name, password etc) and hit submit. But I got an error page that it could not connect to the DB. After triple checking the settings I started to google around. After some time I eventually hit this site: http://bustoutsolutions.com/blog/2011/07/29/wordpress-error-establishing-a-database-connection-after-upgrading-to-os-x-lion which told me to look into the /etc/php.ini file and make sure that the mysql.default_socket setting was correct. It was set to /var/mysql/mysql.sock but it turned out that wasn’t the case. So I checked again and found (as said in the blog entry) it under /tmp/mysql.sock. Changing that and creating the wp-config.php file by hand I was able to pass by the setup.

After installing the wordpress-importer plugin I was told it could not create the uploads directory under wp-content and after creating it and set the permission to 777 I was able to import the site.

Not sure what happened because I could install the blog you are reading now without any issues and without changing the php.ini file. Really strange.

– Andy

10
Aug

Wrong Mac OS X Lion’s App Store Purchase List

During my migration to Lion using multiple installation on my Mac Pro using different hard disks. This had some wired side effects on the App Store because Lion is using Spotlight to find installed Apps and is not limited to the boot disk but rather takes all attached disks. This let to a wrong Purchase list in the App Store. For example I had Daisy Disk installed on my first Lion installation but on my current installation I did not. Now the App Store would report the App as installed and so I could not install anymore. The bad thing was that I could not just copy over the App from the other Lion installation because DaisyDisk needed some additional libraries which are only installed during the installation process (I guess).

The trick to fix it is to the following:

  1. Open System Preferences
  2. Select Spotlight
  3. Click on the Privacy tab
  4. Add all partition that have App Store Apps installed on it to this list

This is how it could look like:

As far as I can tell you can remove the partition from this list again as soon as you installed the Apps but your milage might vary.

System Preferences Spotlight Privacy

BTW, I also noticed that any partition with Apps from the App Store will interfere with your purchase list even if that partition is a Snow Leopard installation.

– Andy

6
Aug

Using Embedded Lion Server PostgreSQL Database

One of the new features of Mac OS X Lion Server is that Apple replaced MySQL with PostgreSQL as internal database server. The drawback is that it is not easy accessible by default. Here I want to show you what to do and how you can manage it.

Attention: if you want to use the PostgreSQL server from EnterpriseDB then I would strongly recommend to make a backup of your server because if it fails the uninstallation might corrupt your embedded PostgreSQL server. Yesterday, August 4th 2011, I installed Enterprise DB’s server and because it did not start I uninstall it but then my embedded server was corrupted as well. Now this might be just an issue with the startup script but nevertheless I lost the DB. It seems that the installation from Enterprise DB is not compatible with Lion and so I wouldn’t use until they provide one that is. Their own recommendation is to use the embedded server instead.

When you installed the Lion Server then you can use ps -ef in order to see if PostgreSQL is running:

bash-3.2# ps -ef | grep post
216   468     1   0  8:33AM ??         0:00.13 /usr/bin/postgres -D /var/pgsql -c listen_addresses= -c log_connections=on -c log_directory=/Library/Logs -c log_filename=PostgreSQL.log -c log_lock_waits=on -c log_statement=ddl -c log_line_prefix=%t  -c logging_collector=on -c unix_socket_directory=/var/pgsql_socket -c unix_socket_group=_postgres -c unix_socket_permissions=0770

You can get some more information about the service with that:

sudo serveradmin list
...
pcastlibrary
postgres
radius
...

and some more details:

sudo serveradmin fullstatus postgres
postgres:dataDirHasBeenInitialized = yes
postgres:PG_VERSION = "9.0.4"
postgres:dataDir = "/var/pgsql"
postgres:postgresIsResponding = yes
postgres:dataDirIsDirectory = yes
postgres:PGserverVersion = 90004
postgres:dataDirExists = yes
postgres:setStateVersion = 1
postgres:state = "RUNNING"

So far so good. Now if we try to connect to the DB using telnet:

telnet localhost 5432

we see that there is no socket listening which means that PGAdmin cannot be used to administer the server nor can it be used by a JDBC driver. If you look above in the process description you will see an option called listen_addresses which is empty. Maybe if we could set our server address there we might be able to connect.

Initially I found the original PostgreSQL server configuration file under /var/pgsql/postgresql.conf but that did not do the trick. Knowing a little bit about Mac internals I started to look for a file inside /System/Library with the name postgres in it. So I found the file: /System/Library/LaunchDaemons/org.postgresql.postgres.plist. This file has an array of properties including the listen addresses:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Disabled</key>
	<true/>
	<key>GroupName</key>
	<string>_postgres</string>
	<key>Label</key>
	<string>org.postgresql.postgres</string>
	<key>OnDemand</key>
	<false/>
	<key>ProgramArguments</key>
	<array>
		<string>/usr/bin/postgres</string>
		<string>-D</string>
		<string>/var/pgsql</string>
		<string>-c</string>
		<string>listen_addresses=</string>
		<string>-c</string>
		<string>log_connections=on</string>
		<string>-c</string>
		<string>log_directory=/Library/Logs</string>
		<string>-c</string>
		<string>log_filename=PostgreSQL.log</string>
		<string>-c</string>
		<string>log_lock_waits=on</string>
		<string>-c</string>
		<string>log_statement=ddl</string>
		<string>-c</string>
		<string>log_line_prefix=%t </string>
		<string>-c</string>
		<string>logging_collector=on</string>
		<string>-c</string>
		<string>unix_socket_directory=/var/pgsql_socket</string>
		<string>-c</string>
		<string>unix_socket_group=_postgres</string>
		<string>-c</string>
		<string>unix_socket_permissions=0770</string>
	</array>
	<key>UserName</key>
	<string>_postgres</string>
</dict>
</plist>

Adding our IP address there:

listen_addresses=127.0.0.1

saving the file and restarting the server:

sudo serveradmin stop postgres
sudo serveradmin start postgres

did the trick. Now I could download and install PGAdmin and connect to the server using the user _postgres and my password (the original administrator):

PGAdmin with Local PostgreSQL.png

Cheers – Andy Schaefer

5
Aug

Missing Spaces in Mac OS X Lion

Since Lion came out I slowly moving over to it and for now my Laptop and my Development box (Mac Pro) are slowly migrating over. I like the full screen mode which I currently use with MarsEdit to write this blog entry. But I definitely miss Spaces. I know they weren’t perfect and sometimes one could loose a pop-up dialog between spaces but it helped a lot to work efficiently. Unfortunately not all Apps are support full screen mode and even the ones that do I cannot directly jump to the desired App. For example I use IntelliJ to develop Java application but that does not support full screen mode. Yes, I could move that to another desktop and blow it up to the maximum size which is similar to what I had before but that still does not solve the issue of the direct jump to my App.

So let’s have a look how this worked in Snow Leopard. I had all my developers on Space 4, my terminal on 5 and email on 6. With a simple ctrl-4 I was on the Space with my developer tools, with ctrl-5 I saw the terminals and when an email arrived ctrl-6 just moved me there. Now these shortcuts are gone. For mouse oriented users that might now be a big deal but for me this is annoying. I want to take my fingers of the keyboard as little as possible. Gestures are great but slow when typing is involved.

Don’t get me wrong, I don’t want Mission Control to go but I want to have a way to define a shortcut that automatically brings me to the full screen view or the desktop where the App is.

But there are other issues with it. For example MarsEdit supports full screen mode (with an annoying different shortcut) but it doesn’t do it well. Now MarsEdit has a Main Window where it displays the registered Blogs and the current posts. This main window does not go in full screen mode. Only the post editor can go in full screen mode. This means that when I select the MarsEdit in the context switch (Command-Tab) it either goes to the post editor or if I am in the desktop that has the main window it brings up the main window. Now I cannot use Command-Esc to go to the post editor but have to use the mouse instead or jump away from the desktop.

– Andy

30
Jul

Upgrade my Mac OS X Server to Lion

Attention: this blog entry is in reverse order meaning the task started at the bottom and I’ll add updates on top of it

Fri Aug 12: Today wa the day where I pulled the plug from our Snow Leopard server taking it from the Internet. I did that to make sure that any new mails sent will not be received until the migration is done otherwise I might loose some of the emails. Then I also wanted to make sure that I don’t loose any changes to the web sites like comments etc.

So after the Server was taken from the Internet I exported the Mail DBs, the MySQl (WordPress) and PostgreSQL (XWiki) DBs and copied them onto another drive. The last step of the preparation was to make a SuperDuper copy and test the copy by booting from it. This way I was sure that I could recover the server in case of big problems and or if I needed to export more data. After I rebooted into the SuperDuper copy I also used it to reformat the original server disk by earsing it with the Disk Utility and then start the Lion installation. It turned out that I still needed an Internet connection but because I have a strange double router setup for the server I was able to connect the server to the Verizon router which prevented the Mac Mini to be identified as server. So I could install Lion and after that was finished the Lion Server and Lion Server Administration tools. After I installed some necessary programs like Dropbox, 1Password, pgAdmin3, MySQL and MySQL Workbench as some others and added the localhost as interface to the embedded PostgreSQL I restarted the box the first time.

The first problems I encountered was some issues with the SSL certificates but eventually I could generated a self-signed certificate and import it to the server. Then I ran into issues with Mail and DNS. Eventually I had to setup DNS step by step. First the local server definition, then the machine, than the aliases etc. And between each step using nslookup to verify everything fine. After all was setup I went ahead and setup the Mail server. Copy over the original Mail DB was that difficult after I figured out that I had to take about all the “.” directories by copying with “cp .*” because a “cp *” would not find and copy the “.” directories. Then I also had to make sure that all files had the ownership “_dovecot:mail” otherwise mail would ignore them. Eventually I got Mail up and running and the old mailboxes copied over. Still there is one thing that doesn’t work. I cannot use SSL with the Mail server and so I can only use Mail inside our home to prevent people from snooping on our mails.

Copying, installing and configuring the web sites was a breeze including the import of the MySQL and PostgreSQL DBs. This was done in less than 2 hours.

There are few things to do like installing Subversion and Subersion server, Gitolite server, Time Machine drive and some file shares but that is purely internal stuff and can be done when needed. Good thing there is that I have a life copy of the server on the SuperDuper backup and so I can check how it was done then and copy necessary files over.

I guess that concludes this post except I ran into some important issues or when I could figure out why Mail doesn’t support SSL for now

.

Tues Aug 9: Yesterday I manage to migrate over my Snow Leopard Mail DBes. It seems that the data structure is compatible and the only thing that I had to adjust is the user (moved to ‘_dovecot’). The rest was just sending one email to myself to create the user DB, then shutdown the mail service and copy over the data. After a restart the mail was available. There was one little thing where sub mail boxes where not handled properly but a many copy of these directories did fix the issue.

Today then I was able to install MySQL (just use 5.5.1 for Snow Leopard) and export / import the PostgreSQL and MySQL databases without any problems. Finally the website were easy as pie. Just tar up the directories in question (Jetty and wordpress), install on Lion Server and restart.

Next step is to actually do the migration. So first take it from the Net (not to loose any mails etc), then backup with SuperDuper, export the Mail DBs and regular Databases and export them onto an external drive. After reformatting the server’s drive I can install Lion, Lion Server, Lion Server Admin tools and the additional programs like Dropbox, 1Password, PathFinder, SuperDuper, MySQL, MySQL Workbench, PgAdmin3 and Java (triggering with ‘java -version’ on command line). After that I need to setup DNS, Mail and Web Sites, import the data and test it. I expect that DNS / Mail to give me some grief (as it always did) but on a late evening / nite shift that should be done. So see you on there other side.

 

Sun Aug 7: I came up with a plan to test the migration and to make sure that I can export / import the DB and Mail data before doing the actual upgrade. So I am taking my laptop, install OS X Lion Server on it and start the migration process. This includes the setup of the server so that it works the same way as my current Snow Leopard server. The only thing that I am going to drop is to use managed clients feature because that wasn’t worth the time I invested into.

I did figure out how to use the embedded PostgreSQL server of the Lion Server and it turned out that I cannot use the installation from Enterprise DB because it doesn’t work and the uninstallation does corrupt the internal PostgreSQL DB. Not good.

This will be a post in progress because the upgrade of the server will take a week or two. As soon as I learned how the OS X Lion Server was distributed I bought the Server App from the App Store. Compared to the original $1,000 (for Leopard) and $500 (for Snow Leopard) this time the server was cheap around $50. So I was ready to test it on one of my developer partion.

The first thing that I saw when I fired up the Sever is that the list of services where limited:OS X Lion Server Window

For me the most important thing was the missing DNS and Open Directory service and the limited functionality for the Web and Mail.  So I went on the Internet to see if I missed some settings or flags but it turned out that one can download the good old OS X Server Admin tools which provides the missing services and the Mail configuration. Still need to figure out how to setup Apache sites I did on Snow Leopard Server. Because I don’t want the server to be down for too long I probably go ahead and use my Laptop and an external drive to create a server clone. When this one is up and running as expected I know what to do. Then I will shutdown the server, install Lion OS and the Server, copy over the necessary data (PostgreSQl DBs, Mail, Web Applications etc) and finally bring the server back to life.

– Andy