albtechportal

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Tuesday, 10 September 2013

Beginner’s Guide to WordPress Multisite with MAMP

Posted on 05:19 by Unknown
According to BuiltWith.com, WordPress is the most popular publishing platform with more than 8 million website using it as their Content Management System (CMS). In addition, Google Trends shows the increasing popularity of WordPress cross over the other CMS, such as Joomla and Drupal.
Some reasons that makes WordPress that immensely popular are it is easy to use, it is in very active development, it has great community support, many plugins with great functionality, beautiful themes, and one particular feature that makes it a powerful CMS is the ability to create multiple websites with one WordPress installation.
Originally, this WordPress Multisite was developed separately from the main WordPress. Then, the project has been merged since WordPress 3.0. So, if you are using WordPress 3.0 (and above), you are able to enable this feature and start creating multiple blogs. In this post, we will show you how to develop WordPress Multisite with MAMP, before bringing it online.
Make sure you have installed MAMP in your OSX. Otherwise, follow this instruction before proceeding this post.

Step 1: Setting-up Virtual Host

We will first setup Virtual Host so that we can host the website with a custom hostname or domain name, instead of using the default http://localhost:8888/. To do so, we will need to edit two files, the hosts file and the apache config file, httpd.conf.

Step 1.1: Adding a Hostname

Frist, we will add a hostname for local development in the hosts file. The hosts file is a plain text file to map the hostnames or domain names to their associated IP Address. When we try accessing a hostname (or a domain name) through the browser, the Operating System (OS) will first look-up the hosts file for the corresponding name and its IP address. If it is not available within the file, the OS will then look-up the DNS.
Recommended Reading: Domain Names & Hostnames
So, let’s open the Terminal and run the following command to open the hosts file.
  1. sudo nano /etc/hosts  
Then, add a hostname along with the IP Address. In this, I name it as domain.local, as follows.
  1. 127.0.0.1       domain.local  
This is only an example, you can name the hostname to be something like domain.loc or domain.com. Change the name, as you want it.
Furthermore, If we host the sites using sub-directories adding the above line will be sufficient. However, since we are going to use sub-domain for hosting the sites, we need to add one line to specify a sub-domain, like so.
  1. 127.0.0.1       domain.local  
  2. 127.0.0.1       sub.domain.local  
Press Control + O and hit Enter to apply the changes within the hosts file. Then, press Control + X to exit.

Step 1.2: Directing the domain names

Next, we will direct the hostname to the directories where we will install the WordPress. To do so, we need to edit the Apache HTTP Configuration, which is located in Applications/MAMP/conf/apache/httpd.conf.
For your convenient run the following command through the Terminal to open it in TextEdit.
  1. open -a TextEdit /Applications/MAMP/conf/apache/httpd.conf  
In the httpd.conf file, add the following line to specify the directory where the hostnames, which we have just added, should refer to it. In my case, I will install my WordPress at /Users/thoriq/Sites/wordpress.
view plaincopy to clipboardprint?
  1. <VirtualHost *>   
  2.     DocumentRoot "/Users/thoriq/Sites/wordpress"   
  3.     ServerName domain.local  
  4.     ServerAlias domain.local *domain.local  
  5. </VirtualHost>  
Afterwards, Restart the server.

Step 2: Installing WordPress

Installing WordPress is as easy as pie. There is the documentation and a lot of posts that shows you how to install WordPress locally with MAMP. For your convenient, here are a few links to visit.
  • Installing WordPress Locally on Your Mac With MAMP — WordPress.org
  • WordPress for Mac: How to Install Locally with MAMP [Tutorial] — WPMU.org
  • If you prefer video over text-based tutorial, then this is one for you: Install WordPress locally using MAMP — Youtube
Make sure that you have downloaded the latest WordPress version, which currently is 3.5.1, and place it under the directory that is specified in the DocumentRoot in httpd.conf file. So, you are able to access it through the domain name, as shown below.

Step 3: Enable Multisite

The Multisite feature is not activated by default, but we can enable it easily. First, let’s open the WordPress config.php.
Then, add the following line.
view plaincopy to clipboardprint?
  1. define('WP_ALLOW_MULTISITE', true);  
Login to your WordPress backend, and you should now find Network Setup under the Tools menu.
As mentioned, we will host our site with sub-domain. In the Network Setup setting page, check the Sub-domains option, and optionally you can name your network websites as well. Then, click on the Install button.
WordPress will generate some configuration lines to add in wp-config.php and .htaccess. The generated output will be slightly different than the one shown below, but the instruction remains the same.
Add these lines in config.php
view plaincopy to clipboardprint?
  1. define('MULTISITE', true);  
  2. define('SUBDOMAIN_INSTALL', true);  
  3. define('DOMAIN_CURRENT_SITE', 'domain.local');  
  4. define('PATH_CURRENT_SITE', '/');  
  5. define('SITE_ID_CURRENT_SITE', 1);  
  6. define('BLOG_ID_CURRENT_SITE', 1);  
And add these lines in .htaccess
view plaincopy to clipboardprint?
  1. RewriteEngine On  
  2. RewriteBase /  
  3. RewriteRule ^index\.php$ - [L]  
  4.  
  5. # add a trailing slash to /wp-admin  
  6. RewriteRule ^wp-admin$ wp-admin/ [R=301,L]  
  7.   
  8. RewriteCond %{REQUEST_FILENAME} -f [OR]  
  9. RewriteCond %{REQUEST_FILENAME} -d  
  10. RewriteRule ^ - [L]  
  11. RewriteRule ^(wp-(content|admin|includes).*) $1 [L]  
  12. RewriteRule ^(.*\.php)$ $1 [L]  
  13. RewriteRule . index.php [L]   
Now, the Multisite feature has been fully enabled and configured.

Step 4: Creating Multiple Websites

We just need to create the websites. So, let’s login to the dashboard.
In the admin bar, go to My Sites > Network Admin > Sites menu. Then, click on the Add New to create the website using the sub-domain name that we have added in hosts file, like so.
Now, when we access the sub-domain we will get our newly created WordPress website.
That’s it; you can then create as many websites as you want, in the same way.

Plugins for Multisite

Additionally, you can install some plugins to power-up your website networks. Below are some of my recommendations.
  • Jetpack
  • Multisite Admin Bar Switcher
  • Simple Multisite Sitemaps
  • Network Shared Media
  • Multisite Language Switcher
  • Simple Multisite Login Log
  • Multilingual Press
  • Multisite Taxonomy Widget
  • WordPress Multisite Domain Mapping
Once we added in the WordPress plugins directory, the plugins will be available in all the websites across the network.

Final Thought

The Multisite feature is an incredible addition in WordPress. By utilizing this feature, you are able to build blog or website networks like in Tutsplus.com and New York Times Blog directories. We can also create UGC (User Generated Content) website that is similar to Hubpages, Squidoo, Tumblr, and WordPress.com.
We hope that this guide is useful for and can help you get started with WordPress Multisite.
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in Mac, Wordpress | No comments
Newer Post Older Post Home
View mobile version

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • ‘Strata’ for iOS and Android game review
    There are games that are fun. There are games that look great. And then there are games that do both. Strata is one such game that h...
  • Call of Duty: Ghosts Review
    Developer: Infinity Ward Publisher: Activision Platforms: PC, X360, PS3, PS4, Xbox One Price: £39.99 Reviewing a Call of Duty game is a ...
  • Review: Seagate 600 480GB SSD
    Seagate Joins the Fray It’s been quite an interesting turn of events over the past couple years in the storage industry. Whereas practical...
  • CCBoot - LAN Boot Software for Windows
    LAN Boot Solution Background LAN boot is a technology based on IP (Internet Protocol), UDP (User Datagram Protocol), DHCP (Dynamic ...
  • Adobe Photoshop CS6 Extended 13.0 & Plugins + Textures
    Adobe Photoshop CS6 Extended 13.0 & Plugins + Textures | 3.5 GB Adobe Photoshop CS6 Extended software delivers even more imaging magi...
  • iBuypower Chimera 4SE FX Ultimate: AMD Gaming PC
    iBuypower is offering an AMD-based system in its Chimera 4SE line, which is designed to give users serious gaming performance without a wa...
  • Buying Guide: Find the best headphones
    If you’re looking to get more audio enjoyment from your smartphone, tablet, media player, or computer, new headphones will do wonders. And ...
  • The Last Days of the DSLR
    The DLSR is everywhere. You see it around the necks of tourists, against the faces of pro photographers. Since Canon introduced the Digita...
  • Xbox One vs. PS4: How They Stack Up Today
    Two new gaming consoles. Both very powerful. Both very ambitious. Both about to meet head to head... and do battle for your time, money an...
  • How To Splice Fiber Optic Cable - Mechanical Splice
    Instructions for splicing fiber optic cable with the AFL CS004162 mechanical splice kit. Watch quick overview video at bottom of post. 1.0 ...

Categories

  • Android
  • Apple
  • Audio
  • Blogger
  • C/C++
  • Cabling
  • Cameras
  • Cases
  • CISCO
  • Cooling
  • CPU
  • Desktop
  • DNS
  • Ebook
  • Fiber Optic
  • Gadgets
  • Game
  • Google
  • Graphic Card
  • Hardware
  • HDD
  • HTC
  • HTMLCSS
  • Hyper-V
  • Intel
  • iOS
  • iPad
  • Iphone
  • IT
  • jQuery
  • Laptop
  • Linux
  • Mac
  • MacTut
  • Microsoft
  • Mobile
  • Mouse
  • Networking
  • News
  • Nexus
  • Nokia
  • Nvidia
  • OS
  • PERIPHERALS & COMPONENTS
  • Photoshop
  • Printers
  • Programming
  • Projectors
  • PS4
  • Ram
  • RedHat
  • Review
  • Samsung
  • Scanners
  • Seagate
  • Security
  • Server2008
  • Server2012
  • Servers
  • Smartphone
  • Software
  • Sony
  • Storage
  • Tablets
  • TechNews
  • Template
  • Tutorials
  • TV
  • Ubuntu
  • Voip
  • Webdesign
  • Webiste
  • WebServer
  • Win7
  • Win8
  • Windows Phone
  • Wordpress
  • Workstation
  • XBOX

Blog Archive

  • ▼  2013 (495)
    • ►  December (35)
    • ►  November (332)
    • ►  October (12)
    • ▼  September (27)
      • 20 best iPhone and iPad apps this week
      • Autumn brings a chill for BlackBerry
      • 7 unexpected features in iOS 7
      • Building An “About Us” Page That Reels Readers In ...
      • 50 Funny & Creative Error 404 Pages
      • Transform Your PSD into CSS Faster Using CSS Hat
      • 5 Software To Free More Hard Disk Space On Windows
      • Build Professional Websites Without Any Coding Usi...
      • Cloud Hosting & CDN Services for Web Developers
      • 5 Methods To Serve True Responsive Images
      • 17 Premium Horizontal Scrolling WordPress Themes
      • Operating Systems You May Not Have Heard Of (But S...
      • Beginner’s Guide to WordPress Multisite with MAMP
      • 10 Useful Apps to Recover a Lost or Stolen iPhone
      • How To Place Digital Signatures On Any Document / ...
      • 5 Things You Should Consider Before Getting a DSLR
      • Lenovo Vibe X Announced: 5-inch Full HD IPS, 13 MP...
      • How to Sync Files Between Two Computers or More
      • How to Restore Deleted Photos & Videos From a Digi...
      • Sony Xperia Z1 Announced: 20.7 MP Camera, 5-inch F...
      • Samsung's $299 Galaxy Gear smartwatch coming Sept. 25
      • CCBoot - LAN Boot Software for Windows
      • 15 essential open source tools for Windows admins
      • Web technology: 5 things to watch in 2013
      • Exploring TCP/IP Routers
      • Best Nexus 7 Accessories
      • Winners and Losers From Microsoft's Nokia Acquisition
    • ►  August (2)
    • ►  July (10)
    • ►  June (42)
    • ►  May (35)
Powered by Blogger.

About Me

Unknown
View my complete profile