27.6.12

Keeping Mac OS and data on separate drives | Macworld

Keeping Mac OS and data on separate drives | Macworld

Reader Ben Connolly is interested in keeping some distance between his Mac's operating system and data. He writes:
I’m planning to get a new Mac and I’d like to keep my system on one drive (perhaps an SSD) and my data on another drive. How do I go about this? Is it possible to keep my Home directory on a drive other than the startup drive?
It is. In the past you’d copy your Home folder to the other drive and then point to it via symbolic links but that’s no longer necessary. When setting up your new Mac I’d do this.
Run through the usual setup process. Once you’ve completed that process connect the drive you’d like to save your data to. Copy your user folder from the Users folder at the root level of your hard drive to the external hard drive. (You’ll have to enter your username and password to authorize this.) Launch System Preferences and choose the Users & Groups preference (called Accounts in versions of Mac OS X prior to Lion). Click the Lock icon at the bottom of the window and enter your administrator’s name and password and click Unlock.

Hold down the Control key, click on your account name, and choose Advanced Options. In the sheet that appears, click on the Choose button next to the Home Directory field. Navigate to the home folder you moved to the external drive, select it, and click Open. You’ll see that the path to that folder now appears in the Home Directory field—/Volumes/DriveB/yourusername, for instance. This is your new home folder. Anything that’s normally saved in your home folder—pictures, movies, documents, music, and preference files—will be stored here.


Users & Groups' Advanced Options
 
Test the account to ensure that it’s working properly. For example, launch iTunes and make sure that an iTunes folder is created in the Music folder within this home folder. Once you’re satisfied that everything’s working correctly, you can delete the original home folder on your startup drive.

We’re not quite finished. Return to the Users & Groups system preference and create a new administrator’s account. Why? If your external hard drive goes kablooey and your internal hard drive lacks a user folder, you won’t be able to boot that drive into a fully functioning account. With that extra account, you can.

Moving your home folder in OS X | MacFixIt - CNET Reviews

Moving your home folder in OS X | MacFixIt - CNET Reviews

In OS X there are some benefits to moving your folder to another hard drive. Here is how to do this, along with some alternative options to consider.






The home folder in OS X is the default location where your account's settings and data are stored. By default your home folder is located in the Users directory at the root of the main boot drive, will be named the same as your account's short username, and will have a house icon when you are logged into your account.

Having the home directory located on the main boot volume is a convenient option for quick and easy setup; however, there may be instances where you would like to have it on a separate partition, or better yet on a secondary hard drive altogether.

  • Managing large files
    If you regularly generate large files that would quickly fill up your hard drive, you might benefit from storing these files on a large secondary drive. While you can keep them in a separate folder, programs using them might cache them, create other temporary files, or organize support files in other locations within your user account and take up space on your hard drive. In this scenario having your user account on its own separate drive might be beneficial.
  •  
  • Performance
    The advent of solid-state drive (SSD) devices has really opened up the data throughput bottlenecks that hard drives have imposed on computers; however, you can still increase your system's speed a bit by storing data separately from the drive containing the system software. When applications run, the system will be using the hard drive to store RAM contents as part of virtual memory, which will be using some of the drive's throughput. This use will decrease the performance of the drive when loading data or other items, so spreading this to other drives should make up for any performance hit.
  •  
  • Portability
    Storing user accounts on a separate hard drive makes them more portable, so you can preserve your data separately from the operating system installation. With this setup, you can easily format or even partition the boot drive while maintaining your user account, so you can quickly get your account settings back after a quick format if necessary. This by itself is perhaps not necessary given advanced backup tools like Time Machine, but might make sense when coupled with other reasons for managing the account on separate drives.
If you have decided you would like to migrate your home folder to a secondary hard drive, the process is actually quite simple. Your home folder is just a collection of files and folders owned by your user account, which you have complete control over, so to migrate it just follow these steps.
  1. Make sure you have a secondary admin account.
    When adjusting user settings there is always the potential for something to go wrong, so to ensure that you will at least be able to log in, you should create a new admin account, which will allow you to easily revert changes if needed. You can do this in the Users & Groups (or Accounts) system preferences.
  2.  
  3. Copy the home folder to the location of choice.
    You can place the home folder anywhere on the secondary drive, though I recommend creating a "Users" folder in which to place it. Once you have established where you would like it to go, open the Users directory on your boot drive and copy your home directory to its destination (it may take a long time to copy, depending on the number and size of files in the home folder).
  4. Account advanced options
    In the account's Advanced Options settings, you can click the Choose button to change the home folder to the new location.
  5. Open your user account settings.
    Go to the Users & Groups (or Accounts) system preferences, and select your username. You may have to authenticate first by clicking the lock at the bottom of the window.
  6. Go to the advanced settings.
    Right-click your username and choose "Advanced Options," which should bring up a window containing a number of details such as the user ID, group, account name, and log-in shell. The window will also contain a warning stating that changes to these settings might damage your account.
  7. Change your home folder directory.
    In this advanced options window, click the Choose button next to the Home Directory field, and then browse to the new location where you copied your home folder. Select the home folder and click Open, and the path to the new folder should now be in the "Home Directory" field.
After you have made these changes, click "OK" and then log out of your account. Then log back in and your account should load from its location on the secondary hard drive. If all goes well then you should see no difference in behavior. However, if something does go awry then you can log in to the secondary administrator account and edit your account in the same way to revert the home directory back to its original default location.

After logging in to your account successfully, you can then go back to the Users directory on your boot drive and remove the old home folder in there if you would like.

Aliases in home folder
Instead of moving your entire account folder, you can set up aliases within your home folder directories to point to the external drive, enabling you to quickly access the external drive from your home folder.
While moving your home folder is easy to do and has its benefits, do keep in mind that there are a few potential drawbacks. For one, secondary drives and volumes are not as protected as your main drive. They can easily be formatted and also set so permissions are ignored, which will allow your home folder to be easily browsed by other accounts on the system and thereby potentially compromise the security of your data on a multiuser setup; however, the impact of this would depend on who you allow access to your computer.

Alternative options

While moving your home folder to a new drive might seem like the only way to quickly access a larger secondary drive through your home directory, there are some alternative setups that will perform the same functions. One easy option is to just mirror the home folder directories (Music, Movies, Documents, and so on) to a directory on the secondary drive, and then create aliases to these folders within the respective folders in your account.

This setup will still use the account's library contents (application preferences and settings) from the main boot drive, while allowing you to easily access the external drive through the aliases so you can store your data and documents. The one drawback to this setup is that some programs will need to be configured to access the external drive instead of the original home folder. For instance, Safari's default downloads folder will need to be changed to point to the secondary drive, and you will need to set the location of your iTunes or iPhoto libraries to point to their locations on the external drive as well, but once these changes are done then everything should work properly.

Do you have a custom or unique home folder setup that has its benefits? If so, let us know about it below in the comments.

How to move your home folder in Mac OS X

How to move your home folder in Mac OS X

Mac Pro and 24" Display with Adobe Photoshop CS4

After buying my first Mac Pro (2009) I soon realized that I needed more than the standard 1TB hard drive installed in the Mac Pro. I went a head and upgraded with two additional 1TB hard drives and one 128GB Solid State Drive (SSD).

I installed Snow Leopard and my Applications on the 128GB SSD so I could use it as a boot drive. The three 1TB Hard drives were configured as a fast striped RAID setup using the disk utility. Then I simply moved my home folder (the documents, downloads, movies, music, pictures, desktop, etc.) to the RAID setup.

Disk setup in Mac Pro (2009)


Move your entire home folder:

So basically I wanted to move my home folder (the documents, downloads, movies, music, pictures, desktop, etc.) to the RAID setup. As most probably don’t know Apple has this feature built right in to Snow Leopard. There is a configuration pane in System Preferences to do right this with a few clicks with the mouse.

First of all you need to copy your home folder to the destination hard drive — in my case the striped RAID setup.

Second, open Accounts within System Preferences. Make sure the lock is unlocked (click on it and type password) so changes can be made. Right-click on the user name of the account for which you copied the home folder and choose ‘Advanced Options…’.

How to change location of user folder

This takes you to a pane where, amongst other things, you can change the location of your home folder.





How to change location of user folder

After choosing the new location, click OK and restart your Mac.

After restarting the changes take effect and the home folder location has changed and all the system icons (the documents, downloads, movies, music, pictures, desktop, etc.) are transferred to the new location.

Symbolic Links (Advanced):

Another way to do this is to use symbolic link which is another smart way of organizing your Documents, photos or video.

Before using the ‘ln’ command to create symbolic links you should get more information by typing ‘man ln’ or ‘ln’ in the Terminal.

First you will need to move the folder to the location you want to keep your files.
Simply drag and drop your Music folder located in ‘/Volumes/BOOT/Users/user/Music’ from the ‘BOOT’ volume to the ‘RAID’ volume.

Then to add a symbolic link from the Music folder on the ‘BOOT’ drive to the ‘RAID’ drive you will type:
‘ln -s /Volumes/RAID/Users/user/Music /Volumes/BOOT/Users/user/Music’

Finish safely:

To be sure everything went fine and your files are in good conditions open disk utility and repair permissions after wards, just to be safe!.

Good luck,
Martin Bay | Martin Bay .NET

25.6.12

How To Move Your Blogger Blog To Your Own Domain or Subdomain in GoDaddy

How To Move Your Blogger Blog To Your Own Domain or Subdomain in GoDaddy

Did you know that Blogger allows you to have your blog hosted on your own custom domain? Well, it's true. 

You can have your blog up in minutes without the headache of paying for web hosting. You basically continue to blog on Blogger, using the same login and having the same back-end interface (dashboard) but you get to have your own dot com domain. 

This allows you to build your online brand and it also makes your readers remember your web address easier. Don't forget to keep your blogging useful and entertaining!

Move your blogspot blog to your own subdomain

In order to do that, you must follow the fist three steps described in a previous post: How To Make a Subdomain in GoDaddy.

1. Once you are on Domain Details page, look for DNS Manager and click the Launch link.

DNS Manager in GoDaddy

2. You'll land on Zone File Editor where you have to click on Add New Record.

Zone File Editor

3. A popup window will appear - select CNAME (Alias) from the list of options.

Add CNAME Record in GoDaddy

4. If you want to host your blog on a subdomain you previously created then type your full subdomain in the first field and then type ghs.google.com in the Host Name field. Click OK and you're done!

Create CNAME Record - Host and Subdomain

Move your blog to your domain (not subdomain)

If you didn't create a subdomain for your blog and you want to host it on your main domain, then follow the steps below.
  • In the CNAMES section (File Zone Editor - step 2 above), click the Edit symbol (pencil) for the "www" record.
  • In the Points To host name field, type ghs.google.com.
  • Click Save File Zone button.
How to configure your Blogger account
  • Log in to your Blogger account.
  • Go to the Settings tab.
  • Click Publishing.
  • Click the Custom Domain hyperlink.
  • In the Buy a domain for your blog section, click the Switch to advanced settings hyperlink.
  • In the Your Domain field, enter your domain name. For example, enter www.coolexample.com.
  • To specify another location in which to look for files, in the Use a missing files host? section, select Yes and enter the path. If not, specify No. (Most of the time you may wanna specify No.)
  • In the Word Verification field, enter the characters as they display in the image above the field.
  • Click Save Settings.
You're done.

You can now blog your way to success on your own domain! Cheers!

Hack Attack: Set up and host a blog on your home computer

Hack Attack: Set up and host a blog on your home computer


Hack Attack: Set up and host a blog on your home computer

Hack Attack: Set up and host a blog on your home computer

by Adam Pash

Click to viewIf you want to host your own blog, you can purchase a plan at a web hosting provider for a few bucks a month - or you can set it up on your home computer for free.
Weblogs, as most people know them, are web sites made of individual entries of various length, by any number of authors, organized in reverse chronological order. Of course, you know what a blog is - you read Lifehacker, and if you don't already have a blog of your own, you know someone who does.

The cool thing about blogs (and many other web apps, like wikis) is that they don't actually have to live online. A blog can live on your personal computer or somewhere on your network; you can use it as a private journal or as the main conduit for intracompany communication. Or maybe you just want to keep all of your personal data, blog posts included, on your own computer and not on Google's servers. Whatever the reason may be, setting up and hosting a blog on your personal computer is a painless process. Today we'll set up a weblog on your Windows PC using the popular open source blogging software, WordPress.

Note: WordPress is a full-featured, excellent piece of open source blogging software. In order to run it on your computer, you'll need to install an Apache web server, the PHP scripting language, and a MySQL database server. Although setting all of this up is not difficult (the process is detailed below), you can easily avoid the whole shebang and get your own free hosted weblog somewhere like WordPress or Blogger if those sites fit your needs. If you're aware of the alternatives, but you're determined (for whatever reason) to run a blog on your own computer, read on.

How to install and host WordPress on your Windows PC: The slideshow


Hack Attack: Set up and host a blog on your home computer

I've put together a step-by-step guide (7 steps in all) for installing WordPress and all the tools necessary to host it locally, so if you're ready to get blogging, click here (or the image above) to get started.

Note (part the second): Our gallery tool is a bit - erm - quirky at the moment, so to advance from one step to the next, click the link at the end of each description. You can try clicking on the thumbnails to progress, but chances are that doing so will leave you confused.

Getting good with WordPress

Now that you've got WordPress installed on your local computer, you've got a lot of options. If you want to make your blog accessible to the outside world, see:
Keep in mind that you wouldn't be able to run a heavily trafficked blog from your home computer, but if it's just a personal blog for friends and family, hosting it yourself is definitely an option (your service provider may not be into the idea, so you may want to check your ToS).

To get familiar with and tweak your WordPress blog, check out our WordPress tag, specifically:
Got your own blog? Weigh in on how you use it. Got a WordPress blog? Let us hear your favorite plugins, templates, and tweaks. All this and more in the comments.

Adam Pash is an associate editor for Lifehacker with a thing for hosting web apps for personal use on his home computer. His special feature Hack Attack appears every Tuesday on Lifehacker. Subscribe to the Hack Attack RSS feed to get new installments in your newsreader.
Related Stories



@Pat/HeartBurnKid: Like I said, opening the blog to the outside world may violate your providers ToS. That said, unless you're garnering a significant amount of traffic, chances are you'll be safe. I run a personal-use home server all the time without issue.

That said, nothing says you have to open this up to the internet at large. As I said above, you can set up a blog for personal journaling, or just to use on an internal network (e.g., a company blog).

@BostonMark: Again, of course you could purchase a cheap hosting account, but it'll never be as cheap as free. Unless I haven't made it clear, you don't want to set up a blog on your home computer that you expect to get any significant amount of traffic.

24.6.12

PHP iCalendar

PHP iCalendar

Documentation  :  Forums  :  Download  :  Demo  :  Template tools
---------------------------------------------------------------------------------------

Rapidcal for Rapidweaver - Two Thumbs Down


On a positive note I found a free calendar php script that will work directly with your Mac iCal application. It has many more features, looks better and is easier to read! You can get it for FREE here:

http://phpicalendar.net/

It’s quite customizable and allows you to merge many calendars together. It even has the capability to display multiple calendars one at a time. The user simply selects from a menu which calendar they wish to view. It’s very well thought out and well executed.

This script comes with instructions which are easy to understand. You have to edit a php file and copy a few files to your server but its a piece of cake with any basic ftp program.

Who needs to throw away money when this awesome calendar script does an amazing job for free! It’s even RSS capable so your visitors can subscribe to your calendar!

23.6.12

How to Display Your Standalone Pages in Blogger

How to Display Your Standalone Pages in Blogger

Steps:

1. Navigate to Blogger Dashboard.

2. Click on your Blog Title.

3. Jump to Pages tab.

Note: On this page you will see list of your static pages if you got any. Else it will just show Home which links to your homepage.


4. Now click on drop down button next to Show pages as option and select an option to display your pages in that particular way.


Top Tabs - Your pages will display under your blog header as a horizontal navigation bar.

Side Links - Your pages will display as a list of links on your sidebar.

Don't Show - You can make use of this option if you don't wanna show any of your pages or if you wanna link them manually.


5. Click Save arrangement button on the top.

6. Yeah... you made it. But if you selected to show pages, it will list all your published pages on your blog. If you wanna manage them and get rid of some pages, jump to Layout tab.

7. Now find an element named as Pages.

8. Click Edit link correspond to that element.

9. Now select pages to display and arrange your pages in the configuration pop up window.

10. Click Save button.

11. Now save your blog layout.

Debate on merits - up Lion Server to host a small website? - MacRumors Forums

How to/Tutorial for setting up Lion Server to host a small website? - MacRumors Forums

samples......

AGAINST:

Don't do this. Go to a commercial web host. If you just want to fiddle, sure go ahead and set up a webserver on your Lion server and use it locally. If you want to fiddle, and want the result on the public Internet, get a cheap VPS.

If you really insist: it's going to suck for your users, because you almost certainly have limited outbound bandwidth from your ISP. They also likely prohibit this usage of their service, and you could get in trouble if they find out. It's also likely that they just block port 80 inbound.

If your ISP DOES allow it (unlikely) and they DON'T block port 80 (unlikely) you still have to deal with the fact that you probably have a dynamic IP address. You'll need to set-up forwarding with a service like dyndns.org. Not a big deal, and you can do it for free, but the result is still going to suck.

You will also have to set-up your router to do "port forwarding" of port 80 to your server.

Web hosts belong in a data center. Period. 


IN FAVOUR:

Oh god, these people. I'm going to be an Apple Certified System Administrator in a week and I would never use a data center unless I required huge amounts of bandwidth, cooling, etc. In other words, a service that supports many people downloading video simultaneously. I'm supporting all of my iOS apps, mail, MySQL databases, contacts, calendar, OD, websites, files, and VPN on a 27" iMac running Snow Leopard Server in my office. If you're ever looking to set money on fire for no reason... go data centers!!

If your ISP is blocking port 80, try hosting your site temporarily on another, higher up port (above 1000) and then try to access your IP address in a web browser (e.g. http://IPAddress:8080).

Additionally, try testing to see if your ISP allows inbound requests over port 80 by going to canyouseeme.org. Another popular port to block is port 25, used for mail.

----------


Quote:
Originally Posted by jtara View Post
I agree 100%.

I'm just explaining WHY ISPs have the restrictions that they do. It's NOT "fear of the unknown."

I provided the OP with a likely solution: run his personal website on a port other than port 80. I suspect that his ISP is blocking port 80 inbound, and there's nothing he can do about it.

He can set-up his site on a port other than port 80. Users will have to add the port number to the URL. Obviously, this would not be acceptable for a commercial site, and that's exactly why ISPs do that.

BTW, he did say "nothing big RIGHT NOW." Sounds like he hope to run a "real" website in the future. If he wants to fiddle and learn, I'd suggest that at some point he start doing that in the environment in which he will have to operate when/if he has something that will draw significant traffic.
What's the problem? If someone wants to figure out how to host something, I will do nothing but encourage them. Hosting your own website from your house (or wherever) is something really cool to try out. I knew nothing about IT a year ago (had no idea what DNS was, ports, "static" IP addresses) and it took me days to figure out how to put a website up. Next week I will be an Apple Certified System Administrator. Why not have more patience?

Setting Up a Web Server with Web Sharing | Henry Mercer

Setting Up a Web Server with Web Sharing | Henry Mercer

K

You don’t need to install Lion Server to set up a web server on Mac OS X. Lion (as does any version of Mac OS greater than 10.3) is equipped with Apache, the web server that is estimated to serve 63% of all websites1. Apache is included with Lion for Web Sharing, and can be started using the checkbox in Sharing Preferences. If you want a more advanced web server, it is also easy to start caching your web pages, and storing data with MySQL.

Apache

At first, your web root (http://localhost/) is set to /Library/WebServer/Documents, and your user folder accessible at http://localhost/{{YOUR USERNAME}}. However, this is easy to amend by changing Apache’s configuration file, which is located at /etc/apache2/httpd.conf. Replace line 238 with the below (substituting in your username):
DocumentRoot "/Users/{{YOUR USERNAME}}/Sites"
And, to allow access to this directory, replace line 265 with the following:
<Directory "/Users/{{YOUR USERNAME}}/Sites">
I chose to turn all the Options off by replacing line 278 with:
    Options None
I also allowed .htaccess files to change some aspects of the configuration for select folders using:
    AllowOverride All
This allows a lot of web applications to function properly — for example Wordpress permalinks. For Wordpress to work, PHP must also be enabled, so I uncommented line 111:
LoadModule php5_module libexec/apache2/libphp5.so
I also commented out line 403, and lines 418 to 423 to disable the default server scripting directory:
    #ScriptAliasMatch ^/cgi-bin/((?!(?i:webobjects)).*$) "/Library/WebServer/CGI-Executables/$1"
and
#<Directory "/Library/WebServer/CGI-Executables">
#    AllowOverride None
#    Options None
#    Order allow,deny
#    Allow from all
#</Directory>
Finally, I commented out line 617. This line allows access to users’ Sites directories. We have already allowed access to what we need, so we can and should comment out this line to stop any other users’ Sites directories being exposed:
#Include /private/etc/apache2/extra/httpd-userdir.conf
Your file should now end up looking like this one. Once you have made your changes, restart Apache. You can do this using the checkbox in Sharing Preferences, or typing the following into Terminal:
sudo /usr/sbin/apachectl restart

Varnish

Although Varnish, a caching engine, can be installed manually, it can be far easier installed using Homebrew. It’s as simple as:
brew install varnish
Once you have installed Varnish, it can be configured using the Varnish Configuration Language (VCL). But we must tell Apache to use a port other than port 80 if we wish to do our caching on the default HTTP port. To do this, open up your httpd.conf file again and modify line 52 to read:
Listen 8000
Now, restart Apache (sudo /usr/sbin/apachectl restart) and you should find it is running on port 8000 (serving your web directory at http://localhost:8000/). Now, open up your Varnish configuration file, which will be located at /usr/local/etc/varnish/default.vcl if you installed Varnish using Homebrew, and set up the default backend — what Varnish will cache:
backend default {
    .host = "127.0.0.1";
    .port = "8000";
    .probe = {
         .url = "/";
         .interval = 2s;
         .timeout = 2 s;
         .window = 5;
         .threshold = 3;
    }
}
The probing function loads the URL specified at the interval specified, and if the URL loads slower than the timeout value (or gives an error message), it marks the backend sick. This health value can be used in the configuration (.healthy), for example, to cache content longer if the server is misbehaving like so:
sub vcl_recv {
    if (req.backend.healthy) {
        set req.grace = 30s;
    } else {
        set req.grace = 1h;
    }
}

sub vcl_fetch {
    set beresp.grace = 1h;
}
You can also set HTTP headers in the configuration file. I send two custom headers, X-Varnish-Cached and X-Apache-Health. These headers describe whether the request was cached and whether Apache is healthy respectively.
sub vcl_deliver {
    if (obj.hits > 0) {
        set resp.http.X-Varnish-Cached = "HIT";
    } else {
        set resp.http.X-Varnish-Cached = "MISS";
    }

    if (req.grace == 30s) {
        set resp.http.X-Apache-Health = "Healthy";
    } else {
        set resp.http.X-Apache-Health = "Sick";
    }
}
To start Varnish automatically at boot, create a file named com.varnish.varnishd.plist and save it in the /Library/LaunchDaemons folder. Open it in a plain text editor, and give it the following contents:
<?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>
    <false/>
    <key>GroupName</key>
    <string>wheel</string>
    <key>UserName</key>
    <string>root</string>
    <key>Label</key>
    <string>com.varnish.varnishd</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/local/sbin/varnishd</string>
        <string>-f</string>
        <string>/usr/local/etc/varnish/default.vcl</string>
        <string>-s</string>
        <string>malloc,1G</string>
        <string>-T</string>
        <string>127.0.0.1:2000</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
</dict>
</plist>
The malloc,1G states that 1GB of RAM will be used for Varnish. Now open Terminal, and enter the following commands:
sudo chown root /Library/LaunchDaemons/com.varnish.varnishd.plist
sudo launchctl load /Library/LaunchDaemons/com.varnish.varnishd.plist
Varnish should now launch at boot.

MySQL

Currently, the MySQL formula for Homebrew is broken, so you will need to use the package installer. The preference pane and startup item are broken, so skip those. Once you have installed MySQL, you can start it using:
sudo /usr/local/mysql/bin/mysqld_safe
To change the root password, which is by default blank, enter the following command into Terminal, substituting your desired password:
mysqladmin -u root password {{NEWPASSWORD}}
To make MySQL start at boot, create a file named com.mysql.mysqld.plist and add it to the /Library/LaunchDaemons directory. Use a plain text editor to give it the following contents:
<?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>KeepAlive</key>
    <true/>
    <key>Label</key>
    <string>com.mysql.mysqld</string>
    <key>Program</key>
    <string>/usr/local/mysql/bin/mysqld_safe</string>
    <key>RunAtLoad</key>
    <true/>
</dict>
</plist>
Load it into launchd by typing the following commands into Terminal:
sudo chown root /Library/LaunchDaemons/com.mysql.mysqld.plist
sudo launchctl load /Library/LaunchDaemons/com.mysql.mysqld.plist
I recommend you use a program like Sequel Pro to administer MySQL. Sequel Pro is a fully-featured and open-source program that provides a graphical user interface for easy management of MySQL.
With Apache, Varnish, and MySQL setup, you have a powerful web server running on your Mac. Mac OS X includes Ruby, Python, and Perl, which you can also use for web development.

Local Web Server for Lion: Apple Support Communities

Local Web Server for Lion: Apple Support Communities

1 2 3 4 Previous Next
etresoft Level 6 Level 6 (18,165 points)
Jul 27, 2011 7:47 AM 
 
Since the User Tips aren't ready yet, I thought I would go ahead and post my definitive guide to getting a local web server running on Lion. This is meant to be a development platform so that you can build and test your sites locally, then deploy to an internet server. I have instructions for configuring the Apache, PHP, MySQL, and Perl. Now that Lion is released, I wanted to consolidate and update all of the random bits and pieces here on Apple Support Communities.

Requirements:
  1. Basic understanding of Terminal.app and how to run command-line programs.
  2. Basic understanding of web servers.
  3. Basic usage of vi. You can substitute nano if you want.

Optional:
  1. Xcode is required for the MySQL driver and for adding PHP modules.

Lines in bold are what you will have to type in at the Terminal.
Replace <your local host> with the name of your machine. Ideally, it should be a one-word name with no spaces or punctuation. It just makes life easier.
Replace <your short user name> with your short user name.

Here goes... Enjoy!

Lion no longer creates personal web sites by default. To create one manually, enter the following:
mkdir ~/Sites
echo "<html><body><h1>My site works</h1></body></html>" > ~/Sites/index.html.en

PHP is not enabled in Lion. To enable it, do:
sudo vi /etc/apache2/httpd.conf

Uncomment line 111 that reads:
#LoadModule php5_module libexec/apache2/libphp5.so
to
LoadModule php5_module libexec/apache2/libphp5.so

Edit the launchd config file for Apache:
sudo vi /System/Library/LaunchDaemons/org.apache.httpd.plist 

Restart Apache:
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist

To turn on Apache, go to System Preferences > Sharing and enable Web Sharing.

NOTE: There appears to be a bug in Lion for which I haven't found a workaround. If web sharing doesn't start, just keep trying.
This might help. Might not. Remove the following from /System/Library/LaunchDaemons/org.apache.httpd.plist:
         <string>-D</string>
         <string>WEBSHARING_ON</string>

In Safari, navigate to your web site with the following address:
http://<your local host>/

It should say:
It works!
Now try your user home directory:
http://<your local host>/~<your short user name>

It should say:
My site works
Now try PHP. Create a PHP info file with:
echo "<?php echo phpinfo(); ?>" > ~/Sites/info.php

And test it by entering the following into Safari's address bar:
http://<your local host>/~<your short user name>/info.php

You should see your PHP configuration information. This will be important for setting up MySQL later.

Download MySQL from a local mirror. You want the Mac OS X ver. 10.6 (x86, 64-bit), DMG Archive. Open the archive mysql-5.5.14-osx10.6-x86_64.dmg. Install only the mysql-5.5.14-osx10.6-x86_64.pkg package. Ignore everything else.

Create the launchd config file for MySQL:
sudo vi /Library/LaunchDaemons/com.mysql.mysql.plist 

Use the following content:
<?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>KeepAlive</key>
    <true/>
    <key>Label</key>
    <string>com.mysql.mysqld</string>
    <key>ProgramArguments</key>
    <array>
    <string>/usr/local/mysql/bin/mysqld_safe</string>
    <string>--user=mysql</string>
    </array>
  </dict>
</plist>

Create a config file for MySQL that matches the Apple PHP build:
sudo vi /etc/my.conf 

Use the following content:
[client]
socket=/var/mysql/mysql.sock
[mysqld]
socket=/var/mysql/mysql.sock

Start MySQL:
sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysql.plist

Extract the archive with:
tar zxvf DBD-mysql-4.019.tar.gz

Move into the directory:
cd DBD-mysql-4.019

First, fix the MySQL client library. (credit)

For Lion, type:
sudo install_name_tool -id /usr/local/mysql-5.5.14-osx10.6-x86_64/lib/libmysqlclient.18.dylib /usr/local/mysql-5.5.14-osx10.6-x86_64/lib/libmysqlclient.18.dylib

Next, build DBD::mysql with:
perl Makefile.PL --mysql_config=/usr/local/mysql/bin/mysql_config --testsocket=/var/mysql/mysql.sock --testuser=root
make
make test
sudo make install
Now that MySQL is tested and installed, don't forget to set a root password and configure your users.

If you want to add modules to PHP, I suggest the following site. I can't explain it any better. I had planned to update those instructions for Lion and just give him credit, but he beat me to it.
MacBook 2007 (white), Mac OS X (10.7), + iMac 27" + iPad + MacBook Pro

Multiple Website Hosting - Subdomains are the Answer!

Multiple Website Hosting - Subdomains are the Answer!

04-Jul-2007
John Michaels


Many business owners find themselves in a quandary over the ways to make the most of their company's web site. This is especially true of those who have the need to maintain more than one web site but do not wish to pay for multiple hosting accounts. If this is you, a subdomain may be the answer.

Subdomains are sort of a site within a site. They are not, however, simply additional pages of an existing web site. The subdomain can have a web site all its own, completely separate from the site located at the main domain name.

To understand the use and purpose of subdomains, it may be necessary to first understand the concept of an internet Domain Name. Every web site that is active on the internet (and there are literally billions of them now - it was estimated as long ago as 1996 that there were more web pages in existence than there were people on Earth) has a unique domain name. There can be only one Ebay dot com, for example, on the entire internet. The domain name, however, is really just a way for humans to relate to the site. Internet servers see web site names as unique I.P. addresses. It is the domain name server that translates those numbers into names and back again.

A subdomain is simply an offshoot of your web site's domain. In terms of the way it appears on the server, the subdomain is simply a folder or a sub directory located within your domain's root directory. Any sub directory can serve as a sub domain. For example, if your web site is "www.mycompany.com" and you store the images for your site in a directory called "images," then you could, if you wished, create a subdomain at "images.mycompany.com". As long as you put an "index.html" page in the folder you should be able to pull it up in a web browser that way. In most cases you will create a new sub directory to be associated with a subdomain and some web hosts do not support subdomains on their servers or put a limit on the number of subdomains you may associate with your site.

The benefits of using subdomains as opposed to opening multiple hosting accounts are twofold. First, you get the obvious benefit of only having to pay for one hosting account. You also benefit from being able to have a completely separate web site, but one that your customers will easily recognize as being associated in some way with your business. Some companies will set up subdomains for various divisions (xyz.com may also have sales.xyz.com or support.xyz.com) and some will use subdomains for various businesses that are all offshoots of the same parent company.

That association could be a downside to using subdomains as well. If you want to keep the relationship between your companies under wraps (like Disney tried so hard to do with Touchstone Pictures so many years ago), you may want to use multiple accounts rather than subdomains.

The web address clandestineproducts.megamall.com would clearly betray that there was some connection between Clandestine Products and Megamall, whether you wanted that information to be known or not.

John Michaels is a freelance author for WebHostPacks.com where he regularly publishes articles on how to find a cheap web host and reviews of low cost web hosting services.

Multiple Domains vs Subdomains vs Folders in SEO | Web SEO Analytics

Multiple Domains vs Subdomains vs Folders in SEO | Web SEO Analytics

subdomainsUsually the most important decisions in SEO are the ones that affect the structure of the website. A popular SEO debate is if one should use multiple domains, sub-domains or folders when he/she has multilanguage websites or various main categories/activities.
This decision can heavily affect the performance of the Website in the major search engines and if someone makes the wrong call, it is extremely difficult to make changes. The truth is that there is not a single best practice, since all of the aforementioned methods have several pros and cons. In this article, we’ll discuss when it is advisable to use different domains, subdomains and folders and we’ll analyze how each method affects the SEO campaign.
Below you will find one example URL for each method:
  • www.example.fr (multiple domains)
  • fr.example.com (subdomains)
  • www.example.com/fr/ (folders)
In order to get a holistic view of the issue we will examine the effects on many different factors. We’ll discuss how Geographical targeting (GEO Targeting) can be achieved in each case, whether any Authority/Trust/Domain Strength passes from the original Domain, how the SERPs (Search Engine Results Pages) are affected, whether Sitelinks are supported, what is the degree of Control over the website, what is the degree of freedom that we have in terms of Design & Web Structure and how Link building and Link structure are affected.

GEO Targeting

As we all know, the major Search engines usually serve different results for the same keywords in different countries. Several factors are taken into account such as the language of the page, the IP of the server, the country code (.gr, .fr, .de) of the domain (ccTLD), the language of the websites that link to our domain, the settings in the Google Webmaster Console, the META-geo tags (supported only by Bing and Yahoo) and more.
geotargeting
Usually the best solution from the geographical targeting point of view is to have multiple domains. This method allows you to create different websites with the country code TLD of your choice (when there are no law restrictions), to use the META-geo tags, to have different servers around the world and to use IP addresses from the targeted country. If a generic TLD is used (.com, .net etc), you are also able to set the Geo Targeting from Google Webmaster Console. The second best solution is to have multiple subdomains and use META-geo tags, have different IPs and set the Geo Targeting from Google Webmaster Console. Finally by having Folders you can only use META-geo tags and Geo Targeting from Google Webmaster Console.

Authority, Trust & Domain Strength

Search engines use several metrics to determine the authority, the trust and the strength of a domain. Those metrics are very important since they can heavily affect the search engine results. This is the reason why in some queries, less targeted and low PageRank pages that belong to high authority websites, appear on the top of the search engine results (for example Wikipedia).
backlink-analysis
So the question is which of the 3 methods keeps the Authority, the Trust and the strength of the main domain? From this point of view the best choice is to use Folders (ex: www.example.com/blog/). Since the folders are part of the main site, all of the domain metrics are maintained. When you use different domains (ex: www.example-blog.com) then none of those metrics pass to the new domain.
So the question is what happens when you use subdomains (ex: blog.example.com)? The SEO community has suggested several theories in the past on this topic. Experiments showed that in some cases, when the main domain has a relatively small amount of subdomains, part of the authority passes to the subdomain. According to other theories, the subdomains are handled like different domains and thus none of those metrics pass to them.
WebSEOAnalytics.com team has done extensive analysis in the past on the Data that we collect from the reports of our SEO tools. Based on those data there are strong indications that a part of Authority and Trust passes to the subdomains only when the domain has a small number of subdomains and when the link structure of the main website passes enough link juice to them. An additional factor can be whether the subdomain keeps the same website and link structure as the main website. On the contrary, when the number of subdomains is too great (ex: blogspot.com) and when there are no links pointing to them from the main domain, then no authority or trust is inherited.

Search Engine Results Pages (SERPs)

When for a particular query a website has more than 1 page appearing on the SERPs, there are increased probabilities of getting more traffic. Nevertheless usually search engines avoid showing more than 2 results from the same website in order to increase diversity and ensure the quality of the results.
So in this case, using different domains can lead to multiple appearances on the SERPs. Also it is clear that usually by using Folders you can’t get more than 2 pages on the SERPs. So the question is what happens when we use subdomains? As we saw above, one SEO theory suggests that Google is supposed to handle subdomains as totally different domains. But if this was always true, should not we see more often multiple subdomains in the SERPs? In order to answer this question we need to take a closer look on how search engines work.
Google uses anti-“host crowding” algorithms to ensure that the user receives results from different sources. Almost 3 years ago, Matt Cutts has provided information on this subject in his article “Subdomains and subdirectories” (Note that since the article is old, there might be significant changes in those algorithms). He suggested that in most cases their algorithms ensure that no more than 2 results appear on the SERPs from the same domain or subdomain. Nevertheless there are cases (for example when we search for “hp”) where the SERPs include results from different subdomains. By searching for similar terms that include the brand names of big companies, it becomes clear that in such cases sub-domains are favoured against pages from the same domain.
serp-hp
In order to be understand how subdomains are handled by the search engines, we need to know exactly how they work and thus we can’t give a define answer. Nevertheless as we said above extensive analysis on SERPs & SEO experiments showed that by using subdomains you can get more than 2 results on the same SERP for particular search queries.

Sitelinks support

The sitelinks are links to internal pages that appear in some SERPs in order to help the users navigate the website. They are generated algorithmically but webmasters can select the most relevant sitelinks from the Google Webmaster Console.
sitelinks-hp
Sitelinks are supported for both Folders and subdomains. Obviously since the addon domains are different websites, they can’t appear in the sitelinks of the main domain.

Website Control

The most straightforward and safe solution is to use Folders, because no special code is needed to handle the different parts of the website. This solution allows you to control easier your website, simply because all of its parts are integrated.
Creating multiple subdomains usually means that you have additional parts of the website that need to be handled separately. As we said earlier the sub domains can be hosted on the same or on different servers, they can execute the same code or have a completely different technology to support them. The same happens when you use multiple domains. Of course from one point of view this gives you the freedom to handle those parts differently from the main website (see below), but this certainly is going to create additional costs for you.

Design & Web Structure Freedom

Mainly for usability reasons, when we create a website, we tend to keep the same design and structure across all the pages. This helps users navigate easier and find faster what they are looking for. Additionally by keeping the same website structure we help search engines understand which are the basic components of our website (menus, footers, headers, etc). That is why when we use folders, which are considered to be parts of the same website, we usually tend to have a similar layout in all pages.
On the other hand, when we use subdomains, we can consider them as different websites and thus we can have a different layout and website structure. The same applies when we use different domains. Especially when we have multilanguage (or multicultural) websites, where the menu, the categories or even the philosophy of the website might be different, using separate domains or sub domains can be a great solution.

Link Building & Link Structure

When you use Folders the link building campaign of your website is not affected. Depending on your plan, you can add the links directly to your homepage, or place them on the internal pages to boost their rankings. Additionally in this case you can manipulate your link structure in order to flaw the link juice to the most important pages of your Website.
linkbuilding
When you use subdomains and especially when you have different domains, it is highly recommended to launch separate link building campaigns for them. You will need to ensure that those subdomains/domains receive enough links from external domains in order to speedup indexing and increase authority, trust and PageRank. Additionally in the case of subdomains make sure that you place links from the parent domain. Finally when you have multiple domains make sure you cross link them in a whitehat and transparent way (avoid hidden links and cloaking).

Should I use multiple Domains, Subdomains or Folders?

So this is the point were we covered almost every aspect and you have to make the decision. Obviously it’s up to you to decide which of the 3 methods suits you best. Below you will find the most common uses of each method.
domain-ppl

When you should use Multiple Domains

Multiple domains are used when we want to be very GEO targeted and when we have enough content and resources to support all these websites. This solution allows us to have different website layout, structure and categories and it helps us increase the number of results in SERPs. Creating Microsites is a good way to promote individual products and services and they can help you achieve better rankings especially if you can incorporate the main targeted search terms in the domain name. There are several business, marketing and SEO reasons that can affect your decision on whether you should have multiple domains, but we will analyze them in another article.
Examples:
www.example.com
www.example.de
www.example-blog.com
www.micro-example-product.com

When you should use Sub-domains

Subdomains are used when you have different products and services that you want to present by using a different website structure (Google does this for several products such as Adwords, Google Docs etc). Also they can be used for GEO targeting, or for increasing your results in SERPs. In many cases websites use subdomains because they use hosted blog services to power their blogs. Finally for dynamic multilanguage websites, subdomains are a great solution because they can be easily coded and they can achieve good SEO Results.
Examples:
specialproduct.example.com
blog.example.com
fr.example.com

When you should use Folders

The folders are the most common, easy to use and all purpose solution. It is the safest method in terms of SEO and Web Development. You should use folders when you have a relatively small website and when you want to maintain the authority of the domain in the main categories.
Examples:
www.example.com/product/
www.example.com/blog/
www.example.com/fr/

Summary

summary-almost-there
In this article we examined in detail the best current practices, we covered when and why each method should be used and what are the pros and cons. Remember that before making the decision you have to ask yourself the following questions:
  • Do I have the resources to support multiple websites or subdomains?
  • Do I have the knowledge to setup correctly the domains/subdomains?
  • Can I develop a strong SEO campaign for them?
  • Do I have enough content to add to all the new websites?
  • Can I provide enough links to all the domains and subdomains?
If you don’t answer positively to all the above questions then the safest way is to proceed with folders.
The table below shows the various factors that we examined along with the 3 methods:

Different Domains Subdomains Folders
GEO Targeting High Medium Low
Authority, Trust, Domain Strength No authority is inherited A part of authority is inherited The authority is inherited
SERPs Increased number of results Increased number of results in some cases Limited number of results
per domain
Sitelinks support No Yes Yes
Website Control Very Difficult Difficult Easy
Design & Web Structure Freedom Very high Medium-High Very low
Link Building &
Link Structure
New Link Building Campaigns Cross linking domains New Link Building Campaigns Cross linking Subdomains Single Link Building Campaign Internal Link Structure
Last but not least, remember to share this article if you like it. Sharing is caring! :)