2012年11月25日星期日

Installing WordPress with MAMP on Mac OS X


Installing WordPress with MAMP on Mac OS X

This is an absolute beginners tutorial on how to get yourself a local WordPress development environment set up on your Mac OS X with MAMP. Step by step (and with screenshots,) we’ll go through each part of the process — downloading and installing MAMP, basic MAMP configuration, creating a MySQL user and database, getting WordPress up and running, and in the end I’ll share some tips you might find useful in your WordPress journey.

What is MAMP and why MAMP?

WordPress is not a stand-alone application. In order to work, it requires a special set of server software that your hosting company will typically provide for you, but such software is not pre-installed on your local Mac. This means that in order to run WordPress locally, you would need to install and configure the set of software yourself, but luckily there’s MAMP!
MAMP is a stand-alone application for Mac OS X which brings server power to your home or office desktop or laptop. It bundles the typical software stack you’d need to run all sorts of web applications including WordPress; that is the Apache web server, a MySQL database server and a PHP interpreter. As you might have noticed, those three are the “AMP” part. The first “M” stands for Macintosh, or as we call it nowadays — Mac.

Installing MAMP

If you’re a Mac user, you’ve probably gone through the process of installing new software in OS X, and MAMP is not too different. Let’s browse to the MAMP website and get ourselves the latest copy of the software. It’s usually bundled with MAMP PRO trial (a commercial and more advanced) version, but we’ll be using the free version which is enough to get you started.
Download MAMP
Once the download is complete (over a hundred megabytes,) extract the contents of the archive somewhere, your desktop is a good place. You’ll see that it contains a MAMP.pkg package which you can run. You’ll be greeted with a user-friendly installer where you’ll have to keep hitting Continue to get through each step.
Note that during the Installation Type step, you can hit Customize and uncheck MAMP PRO which would skip the trial commercial package.
Installing MAMP
After MAMP has been installed, you can launch it using the Applications tab in your dock or by searching for MAMP in Spotlight. Note that when starting and stopping services and changing the configuration, MAMP may ask you for your password, which is required to make system changes in OS X.
MAMP Configuration Password
The Status section on the left will show you when the Apache and MySQL services are started or stopped. After changing any configuration, you might need to restart the servers for your changes to take effect.

Configuring Apache & MySQL Ports

This step is quite important. By default MAMP sets non-default ports for Apache and MySQL in order to avoid possible conflicts with other running applications, so unless you’re using some software that occupies the default ports, it would be nice to change them. Apache to port 80 and MySQL to port 3306.
Use the Preferences button, and then the Ports tab to make the necessary changes. MAMP will have to restart your servers for the changes to take effect.
MAMP Ports Setup
Now while you’re at the MAMP preferences, hit the Apache tab to be able to select a directory root. This is like the public_html folder on your web hosting server, but a local one. That’s where you will install WordPress and store all your project files. A folder in your Documents is a good place to start. I’ll call itmy_document_root.
To make sure everything is working correctly, let’s create a new PHP file in the directory we just set as our document root. Call the file index.php and have its contents say something simple:

Then get your web browser to point to localhost and if you’re lucky enough you’ll see the PHP info page that looks like this:
phpinfo with MAMP
Hurray, now delete that file and let’s get a MySQL database ready for WordPress.

Creating a MySQL Database for WordPress

Now, before installing WordPress we need a database where it would store its data and settings. MAMP ships with a database manager application called phpMyAdmin and the WordPress Codex has a guide on how to create a database with that, but let’s take a shortcut here and fire our Terminal in OS X. You can find it in your Applications folder or easier, through Spotlight.
Spotlight Terminal
The Terminal is a command line utility to your Mac, sort of what you might have heard about Linux, DOS and so on.
Terminal in OS X
If you’re planning to become a kick-ass WordPress developer, you’re going to have to learn this tool. We’ll type in a few commands (which you can easily copy and paste) that will connect to your local MySQL server, create a new database for WordPress and then create a new MySQL user with access to that database. Ready?
mysql -uroot -proot
CREATE DATABASE wordpress;
GRANT ALL PRIVILEGES ON wordpress.* TO wp@localhost IDENTIFIED BY 'hello';
EXIT;
Don’t get too scared yet, it’s quite simple if you understand what each command does. The first one connects to our local MySQL server using root as the username (the -u argument) and root as the password (the -p argument.) These are the default settings in MAMP. Note that there is no space character between arguments and their values. If that gives an error, you should explicitly tell Terminal where the MySQL binary is (where you installed MAMP,) in my case it’s:
/Applications/MAMP/Library/bin/mysql -uroot -proot
If everything’s correct, the first command will open a MySQL command line (in the same Terminal window) to which you type in the rest of the commands or as they’re called SQL queries. The first query (second command) is straightforward — it will create a new database called wordpress and the second query will grant all possible privileges (read, write, delete, etc.) on every table in the wordpress database, to the wp user originating from localhost identified by the hello password.
The third query exits the MySQL shell, at which point you no longer need Terminal so feel free to close it. Here’s a screenshot from my Terminal to make sure you’ve done everything right:
MySQL Terminal
As you might have guessed, the bolded words in the paragraphs above are the values we’re going to use when setting up WordPress, so we’re really close now!

Installing WordPress

Okay, I assume you already know where to get the latest version of WordPress. Download the ZIP archive and extract it to that document root directory. The one where we created our index.php file, remember? Note that the archive might (and probably will) extract an additional folder called wordpress with all the WordPress files inside. Feel free to move all the contents of that folder back to your document root and then delete the empty WordPress folder.
WordPress Contents in Finder
Now, open your browser and point your web browser to localhost again. This should bring up the WordPress welcome page and then on to your database settings, which you probably are familiar with already.
WordPress MAMP Database
The database name, username, password fields are the ones we used when creating the user and database, remember? The host field is localhost because MySQL is running on the same computer (your computer) as the Apache web server. The table prefix is up to you. I generally leave it wp_ for local installs.
The rest is pretty straightforward, blog name, admin username, password and e-mail. After having filled those in you’re left with your brand new and empty WordPress installation, on your local machine, running MAMP. Congratulations!

Conclusion

I’d like to end this tutorial with a few short tips you might find useful when working with WordPress locally on MAMP.
  • While MAMP itself is a lightweight application, when working for a long time without turning it off (and without restarting your computer,) it can get a little laggy and use too much memory. Kick it around from time to time.
  • If ever needed, Apache and PHP configuration files are located in MAMP’s conf directory, that’s /Applications/MAMP/conf.
  • Apache and PHP binaries and service scripts are available in MAMP’s bin directory, Apache, PHP and MySQL logs are in the logs folder (duh.)
  • You don’t need MAMP PRO unless you’re 100% sure you do.
Final tip — whenever you become a MAMP ninja, don’t stop there! Your next goal is being able to run a local virtual machine with your favorite Linux distribution linked to your Mac OS X with a network file system or something similar. That would really get you closer to the real world hosting environments, and a better WordPress pro.
Thank you so much for reading, hope you enjoyed it and feel free to ask questions, post comments and come say hi on Twitter too. Cheers and thanks again!

6 thoughts on “Installing WordPress with MAMP on Mac OS X”

  1. The first bullet point in the conclusion is so right. After awhile all the Apache processes being created and destroyed constantly will eat away at all your free memory and make your “inactive” memory pool larger than it needs to be.
    Definitely stop the servers processes when you don’t need them.
  2. This -> Whenever you become a MAMP ninja, don’t stop there! Your next goal is to write the best tutorial available on the interwebs about how to run a local virtual machine with your favorite Linux distribution linked to your Mac OS X. :P
    • Steve, honestly I haven’t tried DesktopServer yet, so I can’t really encourage people to use it. For the simplest matter, virtual hosts management is great and awesome, but I don’t want to use .dev domains, so I’d rather do it manually in my /etc/hosts file.
      Frankly, I’m not a big fan of MAMP, XAMPP, LAMP or whatever and I try to constantly push towards VPS, virtual environments and command line tools rather than all in one solutions. I think that one might greatly benefit from being able to work with the command line, install software, use source control, make database backups, configure schedules and so on. But the reason I mentioned MAMP is that it’s something in between which lets you use Apache and MySQL without having to install and configure Linux, which as I mentioned in a comment above, is a tutorial in my roadmap.
      Thanks for stopping by and keep up the good work with DesktopServer! :)
Comments are closed.

2012年11月23日星期五

Codex tools: Log in Installing WordPress Locally on Your Mac With MAMP


Codex

Installing WordPress Locally on Your Mac With MAMP

Contents

[hide]

What is MAMP?

MAMP stands for Macintosh, Apache, MySQL, and PHP. MAMP is an application you can install on your Mac which allows you to have access to a local PHP server and MySQL server. Essentially, MAMP gives you all of the tools you need to run WordPress on your machine, fordevelopment and testing purposes. You can accomplish this in different ways, but the other ways aren't nearly as simple (seeMacOS_X_Local_Mirror for the long, manual version of installing PHP and MySQL on your Mac).

Step 1: Installing MAMP

Before you can install MAMP on your Mac, you'll need to download it from the MAMP website. MAMP requires that your Mac be running Mac OS X 10.6.6 or later.
Once the MAMP download is complete, double-click the MAMP disk image (it should be something like MAMP_2.0.3.dmg), and you should get a MAMP window pop up. Drag the MAMP folder (not MAMP PRO - we'll save that walk-through for another time) to the Applications folder.

Step 2: Basic MAMP Settings

Now that you've got MAMP installed on your system, launch MAMP.app (located at /Applications/MAMP/MAMP.app).
While you're editing settings, MAMP might prompt you for an administrator password. This is required because MAMP needs to run two processes: mysqld (MySQL) and httpd (Apache), and depending on the settings you set for those processes, you may or may not need to input your password.
Once you open MAMP, click the Preferences button. Next, click over to "Ports." The default MAMP ports are 8888 for Apache, and8889 for MySQL. If you use this configuration, you shouldn't get asked for your password, but you'd need to include the port number in the URL (localhost:8888). If you'd like to leave the port number out of the URL, change the Apache port to 80. The downside of using port 80 as your MAMP Apache port is that you'll always be asked for your password.
On the PHP tab, select PHP version 5. The PHP minimum requirement for WordPress was raised to 5.2.4+ in version 3.2.
Lastly, on the Apache tab, you'll need to set a document root. This is where all of your files are going to be for your local web server. An example of a document root is /Users/USERNAME/Sites/wordpress/.
Once you're done editing all of the settings, hit OK to save them.

Step 3: Starting MAMP Servers & Creating The Database

To start the MAMP Apache and MySQL servers, simply click "Start Servers" from the main MAMP screen. Your MAMP servers have now been started.
Once the MAMP servers start, the MAMP start page should open in your default web browser. If not, click on "Open start page" in the MAMP window. Once that's open, select phpMyAdmin from the webpage.
Under "Create new database", enter in a database name such as "wordpress", and press "Create."

Step 4: Downloading and Installing WordPress

Now it's time to download WordPress. Once you've downloaded and unzipped the WordPress download, open up the "wordpress" folder. Click and drag all of the files from the wordpress folder to your MAMP document root (I use/Users/USERNAME/Sites/wordpress/).
Lastly, we've got to run WordPress' famous 5-minute install. Visit your local site (localhost:port or localhost:port/wordpress), and enter the following information into the database setup form:
database name: wordpress
database host/server: localhost
database user: root
database password: root
Once that's complete, enter a blog name and email address, and you're ready to use WordPress on your Mac.

2012年11月8日星期四

Keep Marketing Your Massage Business In Economic Hard Times


Keep Marketing Your Massage Business In Economic Hard Times Part 1
By Amy Roberts
As Massage Therapists we can become afraid of what we hear on the news about the global economy. And when we hear stories of doom and gloom, the first thing we want to stop doing is marketing. Regardless of what is happening in the world, many of our clients have not lost jobs or financial security. In fact many people’s situations have not changed one bit. And they’re the people to focus on.
If your massage business does drop off a little, then marketing is even more important. People still need to know you are still around, still offering the great service you always have and are there for them.
 The danger is when you make the decision not to market yourself. You, as a sole trader, or clinic owner with staff, need to keep marketing regardless of what’s going on in the world. This danger is when you find that the marketing ceases and soon, so will the new clients coming in.
It’s not good practice to only rely on one marketing strategy. You really do need to have all your eggs in one basket, so to speak, when it comes to marketing avenues. Your marketing of your massage practice will work far more effectively if you rely on a few different sources. If there is a drop off in clients at the moment, do not panic, it just means you have an opportunity to increase your marketing sources.
In times of economic depression your success as a massage therapist depends on your persistence. Persistence means you ask “what other avenues can I market to?” perhaps you could do another break down of your target market and find some sub-markets in the mix of your clients than may become a good group of people to market to. Ask yourself this simple question: “Which of my clients might represent another group of people that would become clients?”
Your success depends on your persistence in your marketing and drive to find other opportunities that might be waiting for you to discover. Sometimes life presents you with things that enable flourishing through well planned targeted marketing. By performing with power and visibility when all you hear are words like “Depression” you will continue to attract clients who have faith and confidence in you. Take this chance to position yourself even stronger.

Keep Marketing Your Massage Business In Economic Hard Times Part 2
By Amy Roberts 
In Part One of this article we discussed how this economic situation can be a great opportunity for you to gain strength, find other target markets you may not have been tapping into yet, and how persistence can increase confidence from your clients. Here are seven ways you can keep attracting more clients using well planned marketing and saving on cost
  1. Use your email signature to offer something of value –If you haven’t got into the 21st century and created an electronic database of all your clients names and details, then now is the time. You can send out e-newsletters with a free bonus eBook such as better postures for prevention of shoulder& neck pain.
  1. Give away an eBook or even some audio recordings of you talking about back pain (or muscle pain) that can be eased with self massage or massage aids in the time between appointments. If you’re not sure how to create an eBook do a search on the internet or ask someone online who sells eBooks.
  1. At the end of your e-newsletter, direct clients to your new website where they can sign up for your massage and book online. You can also use this space to advertise a special promotion or even a tip of the week.
  1.  Questions on your business cards to be used as prompts are also a good point to make your business stand out a bit more. You can have questions printed on the back or front of your cards that address the striking needs of your potential clients. "Would you like to experience life without back pain?” “Do want a life free of stiff and painful joints and muscles?"
  1. Use the internet to create business for yourself. You can do a search on Google local results. Type in “Massage Therapy” then the name of your area and city and see what comes up. These will be the best results on the first page that comes up. See what’s happening online in your local area and try to get some extra business by offering to treat the spill-over clients from your competitors that advertise online in your local area.
  1. If you have a video camera you can create a small video and post it on You Tube. You can film yourself in your massage room talking about the benefits of massage and you can even video current clients as to how good your massage treatments are. Create your settings to local search results when users look at your video. Make it educational and make sure the quality is good. 
  1. Stay positive with everything that you do. Remember in the first article I said that persistence radiates confidence. When you have confidence in yourself, others can’t help but have the same confidence in you. When you feel confident, you tend to make good decisions that have repercussions that echo ahead of the time that we can immediately foresee.
Be proud of yourself. Your massage therapy practice is the result of your thoughts, energy and actions. In fact your actions stem from how you ultimately feel about yourself. Reinforce an image of value and deliver the highest quality to your clients from that unique value.
To get started on a new train of thought that creates success and radiates happiness. What is it that makes you different, special and valuable to your clients? You know the answers so tell the world what they are.

2012年11月7日星期三

做GOOGLE ADWORDS最常见的十种错误

通过从这些错误中学习你会节省时间和金钱的浪费自己的时间,你开始建立和运行您的AdWords广告系列。因此,无论您是经验丰富的Adwords迷或者只是一个新手,我希望你会发现在这个名单有价值的东西,甚至可能发现新的技巧。因此,没有进一步的ADO(插入击鼓这里)我现在与谷歌AdWords营销的十大误区你... 

1 没有设置每天的预算。如果你自己不为Adword Campaigns设置一个预算,很容易花掉上千美元。 

2 不知道你网站的转换率。很多渴望成功的Marketer最后会选择高出价的关键词,但是他们并不知道网站的转化率。这是非常危险的。如果你不能从商家那里得到产品的转换率,现从一些非常Targeted,低价的关键词慢慢开始。找一些只有0.05美金的关键词开始,在有500个click以后,你就能大概确定产品的转化率。如果500点击你还没有卖掉一单,你也只损失了25美金。这个过程可能很慢,但是一旦你得到了这个点击->销售转化率,你就可以知道你可以负担多贵的关键词。 

3 没有正确的进行关键词研究。绝大多数人用Google的关键词工具,所以绝大多数人都在那些关键词上竞争。用Wordtracker作一些研究。先用一些老式的方法,比如先想一些可能和站点相关的词语,题目,然后用wordtracker来看他们搜索量有多大?是不是值得继续研究。你在关键词上花的功夫越多,你就越可能赚钱。通常这也是最容易被忽略的一点 

4 没有花时间来写广告。我这里有一个技巧。把所有的关键词放在一个group里,3-4天后你就会得到几千个Impressions。把访问量最大的150-200个关键词分组。为每个关键词写一个独特的广告,把关键词包括在广告里。基本上每个每天100impression以上的关键词都值得写一个广告。 

5 没有跟踪你每天的数据。大多数Marketer建立很多Canpaigns,然后每天看看销售状况,如果赚钱就OK,不赚钱就退出。你必须保持一个每天的数据,包括有几个Ad group,每天花多少钱,多少个点击,多少个销售。这样你就能得出你的佣金/点击,投资回报率等等。我建议使用Excel来跟踪。 

6 选择很差劲的产品。有些人是因为看见别人在这个产品上赚了很多钱,有些只是听到别人说。要用常识来判断。在决定选择那个产品之前,先问自己: 

我会不会买? 
这个是常竞争是不是激烈? 
商家的网站是否专业,你通过他们的网站是不是能拿到佣金? 
那些人是可能的买家,他们有没有信用卡? 

7 经历一点点失败就退出,一开始的时候Adword会非常困难。但是如果你不断测试,不断修改,一个产品上不超过25-40美金(也就是你能得到的佣金),你不大会被迫退出。很多人因为花了太多的钱没有进帐而被迫退出,不要让这发生在你身上。 

8 不知道什么时候放弃一个Campaign。如果你在一个产品上花了50美金,1000个点击还没有销售,那就退出把。不要为了证明自己而继续花钱,换另一个产品测试吧。 

9 没有收集email地址。如果收集浏览者的email地址,你就有机会不断Promote产品给他们,你的成本也会不断下降,你会有更多的销售,赚更多的钱。用Auto Responder收集他们的Email,在接下来的几年里,你都可以不断Promote相关产品。 

10 不知道Google的规则,不遵守规则。很多人认为他们可以欺骗Google Adword,因为他们知道一些“秘诀”。最后导致他们的帐户被停。如果你想玩游戏的话,花点时间读读游戏规则。你不仅会知道应该怎么作,而且经常会有一些好想法。 

These top 10 mistakes are based on real world experiences from my personal use of Google Adwords, as well as experiences from many of my consulting clients. By learning from these mistakes you will save yourself hours of wasted time and money as you begin setting up and running your Adwords campaigns. So whether you are an experienced Adwords junkie or just a newbie I hope you will find something of value in this list and possibly even discover a new trick or two. So without further ado (insert drum roll here) I present you with the Top 10 Google Adwords Marketing Mistakes… 

1. Not placing a limit on your advertising budget. If you don’t place a limit on your advertising campaigns you could very easily run your costs into the thousands. Google Adwords makes it very easy to setup a campaign spending limit. Use it. 

2. Not knowing the conversion rate of your website. Many eager marketers end up choosing high priced words and place their bids on those words without basing their bids on anything. Don’t do this. If you don’t know the conversion rate of the product you are selling then start slow, very slow, bid only 5 cents or less on many less competitive keywords and try to get as many keywords as possible at this bid price. This will enable you to determine your market on many words as well as determine some kind of conversion rate after 500 clicks to the website. If you don’t make any sales after 500 clicks you’ve only spent $25 and you know the product is a dud. It may take you a while to receive 500 clicks, but if you figure out your average “click to sales ratio” it will empower you with the knowledge to bid on more competitive keywords. 

3. Not doing proper keyword research. Most people use the Google keyword tool and so will most people that are competing against you. Do deep research with Wordtracker, or even better yet, use it in combination with old fashioned thinking to come up with related terms and topics that may be relevant to your site, then use Wordtracker to look them up and see how popular they are and if they are worth further research. The more time you spend on your keyword development the better your chances of success will be. This is one of the most neglected aspects of setting up an Adwords campaign. 

4. Not placing time and effort into writing your ads. I’m gonna give you a big hint and if you are not doing this already, then start. Take all your words, run them for 3 or 4 days or until you start getting a few thousand impressions. Next, take the most popular 150 to 200 words (the words with most impressions) and do separate, yes separate campaigns for each and every one. This will allow you to write separate ads for each word and use that word in your ad. By writing your ads out by hand making each one unique and distinct for each keyword you will be leaps and bounds ahead of your competition. Am I saying you need to write 150 to 200 unique ads? No. I am saying you need to start with 150 to 200 and write up to as many unique ads as you possibly can. If you can do 1000 that’s even better. My rule is that if the word gets 100 impressions or more a day then you will need to write a separate ad just for that keyword. 

5. Not tracking your daily stats. Most marketers will run a few campaigns with Adwords, then check out their sales stats, if they are making money great, if not they get frustrated and quit. You need to keep daily records. Set up each website you are advertising in a separate ad group. Then track how much you spend each day, how many clicks you got, how many sales you get, etc. This will allow you to determine your Earnings Per Click, your Return On Investment, and much more powerful data. I personally use an Excel spreadsheet to manage my campaigns, I insert some basic data and Excel will calculate the rest, saving me much time and effort. Tracking means everything as long as you are tracking everything! Once you start tracking you will know exactly to a tee what is going on and you will be able to adapt accordingly. 

6. Choosing lousy products or services to promote. It boggles my mind the rationale that some people use to promote certain products over others. It could be because you saw someone else make a lot of money with the product, or maybe you read on a blog it was the next best thing. Well, please, use common sense. Before promoting a product or service ask yourself these questions… 

Would I buy this product? 
Is this market very competitive or not competitive enough? 
Is the website professional, is there leakage on the site (meaning does the webpage promote products or services that don’t pay you)? 
Who is my market and do they have money and credit cards? 

7. Quitting too soon. Yes, Adwords is not easy and many marketers give up before they learn the system. Adwords can be very frustrating, difficult, and intimidating the first time you use it. But if you make it a priority to test, track, and spend as little money as possible then you won’t have much reason to quit. You should never spend more than $25 to $40 to test a new product and advertising campaign. Many people end up running out of money too soon and are forced to quit. Don’t let this happen to you, start small and slow and don’t give up. 

8. Not knowing when to give up. Give up on a campaign that is. If you’ve spent $50 and received 1000 visitors to your site and you haven’t made any sales, I would say it’s time to give it up. Don’t keep going and spending money just to try and prove yourself right, move on. 

9. Not collecting email addresses. If the niche you are marketing to has any related products or services you could market to them (and just about all of them do) then collect their emails and follow up with them! If you do this your cost of advertising gets less and less with each email you send out. Plus, you make more money, year after year. Set up an autoresponder and collect the visitors email address. Using Adwords gives you extremely targeted and interested leads, don’t let them get away forever, get their email and market to them for years to come. 

10. Not knowing the rules and breaking them. Many people think they can beat or cheat the system, others don’t know better and will place popup ads or link to inappropriate sites getting their account revoked. If you’re going to play the game, take the time and read through the rules and guidelines. Not only will you know what not to do, it may inspire a few ideas of what you can do to maximize your income.