Tek Eye Logo

Tek Eye

Build a Website on OS X with ↓markdown↓ CMS

↓markdown↓ is a lightweight Content Management System (CMS) for quick and easy website creation and publication. ↓markdown↓ CMS requirements are straightforward, a web server with PHP. Nothing else, no frameworks, database or special libraries. Apple computers run OS X and have a web server (Apache) and PHP available. Therefore ↓markdown↓ CMS can be used to build a website on an Apple computer for later publishing to a web host.

Steps to Create a Website on OS X with ↓markdown↓ CMS

The following tutorial steps are based upon a default OS X Yosemite set up. The steps required are to enable PHP for the Apache web server, start Apache, and copy the ↓markdown↓ CMS files into web servers default folder.

Enable PHP and .htaccess Processing for ↓markdown↓ CMS

The first step is to change the Apache configuration file to enable PHP and allow the use of a .htaccess file for ↓markdown↓ CMS. This requires using the Terminal App.

Apple Terminal

With the Terminal open switch to the root user using the following command sudo su -, then enter the correct password.

$ sudo su -
Password:*

Next change to the Apache default folder:

root# cd /etc/apache2

Edit the Apache configuration file httpd.conf using the terminal editor vim (start vim using the command vi):

root# vi httpd.conf

Scroll or page down to the line starting #LoadModule php5_module..., or simply search forward for the text php using /php and press return (enter). Press i for insert mode and delete the # at the start of the line. Press escape to leave insert mode.

Find the configuration entry for the default Apache document root, the /Library/WebServer/Documents folder, either by paging through the file or searching (search usiing /WebServer then return). Change the AllowOverride option from None to FileInfo, this enables .htAccess processing in the document root folder. (Use i to enter insert mode and use escape when the change has been made.) Save the modified Apache configuration file by entering the command :wq which will write the file and quit vim.

Start the Apache web server:

root# apachectl start

Using the Safari browser enter localhost as the address. If Apache is running the message It works! will appear.

Starting Apache web server on OS X.

To check that PHP is working create a file in the /Library/WebServer/Documents folder containing <?php phpinfo(); ?> which is a test page for PHP. To create this quickly change to the Apache document root and use the echo command to create a PHP file:

root# cd /Library/WebServer/Documents
root# echo '<?php phpinfo(); ?>' > php-test.php

Run the new PHP file in Safari using localhost/php-test.php (or the php filename used) as the address:

PHP runs on OS X.

Download the ↓markdown↓ CMS zip. Use the Finder App to locate the /Library/WebServer/Documents folder (use Finder Preferences to enable viewing the Hard disks to help locate the folder.) Copy everything in the ↓markdown↓ CMS zip file into /Library/WebServer/Documents and check that everything works in Safari using localhost/md:

↓markdown↓ CMS running on a Mac.

You can now build a website by creating content files in the /Library/WebServer/Documents folder. Create a graphic file for the logo and create a text file in the root folder (called index.md). Enter some content in this index file. Copy md-config.php from the md folder to the root folder as site-config.php. Edit site-config.php to set the values for the website name and website logo. Your web site is up and running. For other articles on using ↓markdown↓ CMS see the post Build a Website from Scratch with ↓markdown↓ CMS.

(See also Setting up a local web server on OS X to configure a Sites directory in your Home folder.)

Author:  Published:  

ShareSubmit to TwitterSubmit to FacebookSubmit to LinkedInSubmit to redditPrint Page

Do you have a question or comment about this article?

(Alternatively, use the email address at the bottom of the web page.)

 This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

markdown CMS Small Logo Icon ↓markdown↓ CMS is fast and simple. Build websites quickly and publish easily. For beginner to expert.


Articles on:

Android Programming and Android Practice Projects, HTML, VPS, Computing, IT, Computer History, ↓markdown↓ CMS, C# Programming, Using Windows for Programming


Free Android Projects and Samples:

Android Examples, Android List Examples, Android UI Examples



Tek Eye Published Projects