Setting up apache web server on a Mac running Lion (OS X 10.7.x)

HTML Styling for Developer Code

 

Note: If you were running apache2 on Snow Leopard (Mac OS X 10.6.x) and then upgraded to Lion, there are some issues that need to be corrected. See separate instructions for Re-enabling apache2 on Lion upgrade from Snow Leopard

Legend:

Placeholder for your terminal (shell cmd) prompt – you do not type this in…

>

After a command line prompt, this is what you would actually type…

commandlineinput

Within a command line, values that you would have to substitute from your own specific environment…

putyourvaluehere

Example command line input…

>
sudo mycommand -r
somecustominput
| grep coolwhatever

 

Icons courtesy of function

Setting up the httpd.conf and php.ini file to enable php on your local Mac

  1. Open the “Terminal” application from your Applications folder, or your dock (or where ever) to begin a “shell” environment.
  2. Make a backup copy of your httpd.conffileNavigate to the file’s location

    At the shell’s prompt >, type

    > cd /private/etc/apache2

    To make a backup copy of the httpd.conf file, enter the command…

    > sudo cp httpd.conf httpd.conf_bu_YYYYMMDD

    Where
    YYYY is the year,
    MM is the month,
    DD is the day of the month (just a suggested naming convention).

  3. Edit the httpd.conf file to enable php scripting (vi editor shown but most any editor will work)

    To open httpd.conf in the vi editor, enter the following command in Terminal

    > sudo vi httpd.conf

    (NOTE: If prompted for your login password, reply as requested.)

     

    Editing the httpd.conf file

    1. Find the line that enables/disables php scripting

      Within vi, search for “libphp5.so” by typing
      /libphp5.so and then enter/return

      The / causes vi to enter search mode

      The line found should read

      #LoadModule php5_module        libexec/apache2/libphp5.so

      If the line does not begin with a # then PHP is already enabled and you can exit your editor by entering
      :q to continue with the next command line. So, skip past the rest of these editor steps.

      The : causes vi to enter command mode

      If the line you found doesn’t match for any other reason, first check your search command and/or search the internet for an answer to why and drop me an to let me know what you found instead. I appreciate input that makes these instructions more useful. Thanks.

    2. Delete the # in column 1 of the text

      Type the number zero key 0 to position the cursor over column 1

      Type a lowercase x once to delete the #

      If you make a mistake, type ESC and then :quit! to exit the editor without saving changes by typing :quit! and try again.

      The line should now read…

      LoadModule php5_module        libexec/apache2/libphp5.so

    3. Exit the editor

      Type :wq  to save (write) and quit

      If it doesn’t let you save, try typing :write!

      If that doesn’t work, perhaps you didn’t enter the editor with the sudo command. So, exit without saving by typing :quit! and try again

  4. Make a backup copy of your php.ini file

    To navigate to the file’s location, at the shell’s prompt >, type

    > cd /etc

    To make a backup copy of the php.ini file, enter the command…

    > sudo cp php.ini php.ini_bu_YYYYMMDD

    Where
    YYYY is the year,
    MM is the month,
    DD is the day of the month (just a suggested naming convention).

  5. Edit the php.ini file to enable and set a correct timezone (vi editor shown in this example)

    To open php.ini in the vi editor, enter the following command in Terminal

    > sudo vi php.ini

    (NOTE: If prompted for your login password, reply as requested.)

     

    Editing the php.ini file

    1. Find and edit the line that sets the timezone

      Within vi, search for “date.timezone” by typing
      /date.timezone and then enter/return

      The line found should read

      ; http://php.net/date.timezone

      or it may read

      ;date.timezone={may blank or set to some existing timezone value}

      If the line does not begin with a ; then timezone is already enabled.

      If the line does begin with a ; then delete the ; using the vi command x with the cursor on top of the ;

      If the line is blank after the = then enter a timezone value by typing the following vi commands
      $aAmerica/Central and then ESC

      The command $a causes vi to jump to the end of the line then begin “append” mode. Pressing the ESC key ends any append or insert mode.

      Ensure that you have a valid timezone value. Many former values are now invalid and obsolete.

      If the line has an existing value that needs to be changed, then position the cursor over the 1st character after the = then type the following vi commands
      DaaValidCountry/aValidTimeZone and then ESC

      The command Da causes vi to delete the rest of the line and enter append mode. Note: the case of the letters used as vi commands is significant.

    2. Find and edit the line that sets the maximum size of file uploads to 8 Megabytes

      Within vi, search for “upload_max_filesize” by typing
      /upload_max_filesize and then enter/return

      The line found should read:

      upload_max_filesize = 4M

      Position the cursor over the 4 then replace it with an 8 by typing the vi commands
      r8

      The line should now read:

      upload_max_filesize = 8M

      Other values can be set but it would be good to learn more about how to use vi if you wish to do so. Search google for “learn vi editor” or for “vi cheat sheet” or see a example vi cheat sheet

    3. Exit the editor

      Type :wq  to save (write) and quit

      If it doesn’t let you save, try typing :write!

      If that doesn’t work, perhaps you didn’t enter the editor with the sudo command. So, exit without saving by typing :quit! and try again.

  6. Restart (or start) the apache web serverTo restart the localhost web server (example shown here for doing so from a Terminal command line) type the following:

    > sudo apachectl -k restart

    The localhost web server may also be restarted (started) from the System Preferences‘ “Sharing” pane by setting/toggling the “Web Sharing” checkbox.

 

Setting up a login for posting comments (on a WordPress based blog)

So, you’d like to make a comment to a blog?
Some blogs allow anyone to comment, others (like this one) require a valid login first (this cuts down on spam).

Here are some easy steps on who to create a login for the blog you wish to comment on.

1) For this site in particular, you must attempt to comment before you are provided a link to click to get logged in. Click on the link below the word “Comment.” Here are a couple of possible presentations – which will vary based upon how many times someone else has already commented.

2) Click on the “logged in” link – which may appear at the bottom of the blog entry that you wish to comment on.

3) When prompted by the WordPress login page, click on “Register”

4) Enter your new login name and a valid email (which will be used to send you your first password) and click “Register”

5) After clicking Register, you will be prompted on the refreshed login page with the yellow banner instructing you to check your email. Then go check your email for a message from WordPress.

6) In the email from WordPress, select the provided password and copy it to your clipboard (using ctrl-C (for Windows) or cmd-C (for Macs) ) then click the link provided which will take you back to the WordPress login screen.

7) On the WordPress login screen, enter the login name you chose during registration, paste the password you copied into the password entry field, then click “Login.”

8) Voila! You now have a valid login that enables you to provide comments to a blog entry. You’ll be taken to your new Profile page where you can change to a new password, set your screen name, change your email, or whatever. Click “Update Profile.”

9) When done editing your email, click the upper left corner of the Profile page on the name of the website (“Dokimay” in this case). You’ll be taken to the blogs where you can now offer comments (which are greatly appreciated).

If this was helpful, post a comment!

BTW – each comment has to be reviewed by the administrator before it will actually show up on the blog (for this site anyway) to keep down the spam.

Setting the name and identity of a new theme

Step 1. Create a new folder for your new theme by

  1. creating a folder and files from scratch or
  2. copying an existing theme.

Put this new folder in the wp-content/themes/ directory of your WordPress installation and give the folder your new name.  Having a different folder name will not make your new theme show up in the WordPress admin panels.

Step 2. Modify the style.css file within your new theme’s folder

1) In the wp-content/themes/myNewTheme/style.css file change the value of the Theme Name: comment to the name you would like to see in your WordPress / Appearance / Themes / panel.

/*
Theme Name: myNewThemeName

2) In the same style.css file change the value of the Version: comment to the version you would like to see in your WordPress / Appearance / Themes / panel. The .x.y represents the major and minor version of your theme.

/*

Version: myThemeVersion.x.y

Step 3. You will also want to create a modified or new screenshot.jpg (or .png) file as well.

HTML and CSS in 24 hours

Title: Sams Teach Yourself HTML and CSS in 24 hours 7th ed.
Author(s): Dick Oliver and Michael Morrison

Copyright: © 2006 Sams Publishing
Pub: Sams 800 East 96th Street, Indianapolis, Indiana, 46240 USA
ISBN: 0-672-32841-0
Library of Congress Cat Cd #: 2005927446
Description/Summary: HTML4, XHTML, CSS2

Image:
Teach Yourself HTML4 and CSS2 in 24 Hours

Typing in IPA (International Phonetic Alphabet) made easy (Mac OSX version)


Background:

IPA is an international phonetic character set (with some extra markings) that help singers sing in any language by just learning how each phoneme is to be pronounced (easier said than done). Currently many who want to write out or print out a song's words in IPA, either have to do it by hand, or make use of the very unproductive, finger twisting, immensely inefficient “Symbols” option in tools like MSWord.
There's a better way – install a keyboard layout on your Mac and install a reputable version of the IPA font. If that is what you want to do, then read on!

Note:Windows and Linux is also supported by following various links within these instructions

For Mac OSX users

(tested on 10.6 Snow Leopard)

There are 3 simple things that need to be done to enable typing IPA directly into a text document (as opposed to the very cumbersome use of MSWord's Insert Symbol hassle).

1) Install a keyboard layout file and re-login

  • Retrieve the IPA keyboard layout
    • To download the layout immediately right from this page
    • To navigate to the original web pages (in case you would like to find other alternatives and options along your way, or in case there might be a newer update)
      • Navigate in your browser to IPA Keyboard.
      • Scroll down to the subheading “Mac OS X Keyboards” (about 4 screen pages worth).
      • Continue down past the sub-subheading “IPA Unicode 5.1 Macintosh Keyboard v1.4″.
      • Then down to the sub-sub-subheading “Download”.
      • Click on the
        hotlink “Download “IPA-MACkbd.dmg”" under the entry for “IPA Unicode 5.1 Macintosh Keyboard v1.4″ which downloads your downloads folder.
  • Install the IPA keyboard layout
    • Depending on your personal settings, the downloaded .dmg file might auto-launch. If not, then double-click it (from within your downloads folder) and it will open a custom finder installer window.
    • In this window, there will be two files: 1) a .pdf file to let you know what keys to press etc., and 2) a keyboard layout file you need to install. Save a copy of the .pdf file elsewhere on your hard drive for later use (drag it somewhere) because its presently only located within your .dmg file.
    • Open a 2nd finder window and navigate to the location
      YourHardDriveName – Library – Keyboard Layouts.
    • Drag a copy of the file called “IPA Unicode 5.1(v1.4) MAC.keylayout” to this Keyboard Layouts folder.
    • Installing the layout in this folder will allow anyone who logs into your computer to use the layout (provided they also follow other pertinent installation instructions for their login).
    • Dismount the disk image by clicking the eject icon next to the “Keyboard” entry under DEVICES in a finder window.
  • Log out and back in again
  • Notes − README (to save you from wasting time)
    • You won't see anything different yet until you complete step 2.
    • Read the file you dragged off for later use called “IPA Unicode 5.1 (v1.4) MAC Keyboard.pdf” − which explains how to use the keyboard layout
      successfully. Without using the “deadkey” sequence, your IPA keyboard will likely work like any other English (USA) keyboard and allows you to type normally in most cases without changing back and forth between keyboard layouts when you need to type normally.
    • Various fonts and tools on the www.sil.org site have licenses. Individual users are responsible for how they use such freely offered resources referenced in this article as terms may change or be updated from time to time.

2) Enable international keyboard capabilities

  • Enable the IPA keyboard layout
    • Open your System Preferences application (from your Dock, or from the Apple menu in the top left of your screen)
    • Select the icon in the top row called “Language & Text” (Note: As of this posting, the included instructions in the “IPA Unicode 5.1 (v1.4) MAC Keyboard.pdf” file are out of date and instruct you to select an icon entitled “International” which might apply to Mac OSX 10.5 or something earlier).
    • Click the “Input Sources” tab (Note: As of this posting, the included instructions in the “IPA Unicode 5.1 (v1.4) MAC Keyboard.pdf” file are again out of date and instruct you to select the “Input” tab which again might apply to an earlier version of Mac OSX).
    • Scroll down to find “IPA Unicode 5.1(v1.4) MAC” and click the box on its left.
    • If you hadn't already selected another international keyboard, you will now see a new icon in your upper right menu bar area (a national flag of sorts). Click on the flag to pop down a list of enabled key layouts to change between keyboards.
  • Notes − README
    • Changing to the keyboard layout to IPA will not automatically switch you into the correct font (since there could still be many to choose from). You will also have to select the DoulosSIL font within your application as well − which must be installed in step 3.
    • In the future now, once multiple keyboards have been made available, make sure you have the correct keyboard enabled during other activities so that you don't get weird behaviors in your apps and font situations. For the most part, it won't be a big deal if you have the wrong keyboard layout selected. But, I've made
      my disclaimer − personal experiences may vary.

3) Install the DoulosSIL font suite (which works with the keyboard layout given in these instructions)

  • Retrieve the DoulosSIL IPA font
    • To download the font immediately right from this page
    • To navigate to the original web pages (in case you would like to find other alternatives and options along your way, or in case there might be a newer update)
      • Navigate in your browser to DoulosSIL font.
      • Scroll down to the subheading “Font Download” (about 1 and ½ screen pages worth).
      • Scroll just a little further to the sub-subheading “Doulos SIL 4.106 (official release)”.
      • Just below that
        sub-subheading are various download options under the title “Doulos SIL”.
      • Click on hotlink “Download “DoulosSIL4.106.zip”" which downloads your downloads folder.
  • Install the DoulosSIL IPA font
    • Open your downloads directory, navigate to the DoulosSIL folder.
    • Double-click the file “DoulosSILR.ttf” thats within the DoulosSIL folder This will open your pre-installed application called Font Book and open a window that gives you the choice to “Install Font”.
    • Click “Install Font”.
    • Close Font Book application.
  • Notes − README
    • While your text editing applications may now see the font, getting at the “funny IPA” characters will still be difficult unless the keyboard layout is installed as well (see step 1) − just in case you skipped around in the order of your installation :).
    • Text editing applications may need to be closed and restarted in order to see the freshly
      installed font.
    • See the SIL.org web pages to read up on Known issues.
    • Various fonts and tools on the www.sil.org site have licenses. Individual users are responsible for how they use such freely offered resources referenced in this article as terms may change or be updated from time to time.

Using the IPA keyboard layout and font

  • Once these 3 steps are completed switching back and forth is as simple as two mouse-clicks (well, maybe only one mouse-click!)
    • Click one − change keyboard layouts from the flag in the upper right corner of your screen.
    • Click two − change to the DoulosSIL font in your editing application.
  • Note: As mentioned above in the keyboard layout installation instruction notes, you should be able to use the IPA keyboard to do normal typing in for your English (USA) needs and not have to keep swapping between layouts. You will have to swap fonts as you need to however. Other notes:
  • For a current list of compatible apps and their quirks.
  • Main page for the DoulosSIL font.
  • Fonts in Cyberspace (lots of other fonts for use).

Feedback please!

  • Found a typo?
  • Have a better way to communicate these steps?
  • Want to offer your experiences with other versions of operating systems (including Windows, Linux)?
  • Then please either email me at: developer@dokimay.com or create a login to this blog and enter a reply comment!

Thanks for visiting!