Your SlideShare is downloading. ×
WP Sandbox Presentation WordCamp Toronto 2011
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

WP Sandbox Presentation WordCamp Toronto 2011

1,377
views

Published on

To help attendees install XAMPP and WordPress to run on their local machines, whether PC or Mac.

To help attendees install XAMPP and WordPress to run on their local machines, whether PC or Mac.

Published in: Technology

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,377
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
18
Comments
0
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Sandbox: Running WordPress on Your Local Machine Presented by: A. Alfred Ayache, ZCE @NotrsWebmaster [email_address] http://notoriouswebmaster.com
  • 2. Prerequisites
    • Unzipping files
    • 3. Copying and moving files
    • 4. Running programs and batch scripts
    • 5. Editing text files with a text editor
  • 6. What Is (Not) a Sandbox? Is :
    • Sandbox: Your own private webserver, running on your local machine (Windows, OSX, Linux)
    Is Not :
    • Not a production server.
    • 7. Should not be exposed to the world.
    • 8. Not security hardened.
  • 9. Uses of a Sandbox
    • Running a local copy of WordPress
    • 10. Testing downloaded themes and plugins
    • 11. Testing beta releases of WP
    • 12. Developing your own themes and plugins
    • 13. Developing websites and web apps
    • 14. Running local copy of web apps (other than WP)
    • 15. Learning Web programming (PHP, Perl, Ruby, Python)
    • 16. NOT RECOMMENDED: running a local production server
  • 17. WordPress Requirements WordPress XAMPP PC OSX Version 3.1 3.2 1.7.7 1.7.3 PHP 4.3 5.2.4+ 5.3.8 5.3.1 MySQL 4.1.2 5.0+ 5.5.16 5.1.44 Optionally, you may also need mod_rewrite and email capabilities, depending on how you want to configure your installation, or what plugins you want to test.
  • 18. Introducing XAMPP
    • Collection of open source apps
    • 19. Apache , PHP , MySQL , phpMyAdmin , and more!
    • 20. Available for Windows , OSX , Linux and Solaris
    • 21. Super easy installation (especially compared to manual installation of the components)
  • 22. Why Do I Need Apache?
    • Your browser can consume, process and display HTML , CSS and JavaScript .
    • 23. A webserver can serve HTML, CSS and JS; but can also process PHP .
    • 24. Then, PHP can access MySQL databases.
  • 25. So What's This PHP and MySQL?
    • PHP is the scripting language used to write WordPress.
    • 26. MySQL is the database used to store your WordPress data, such as posts and user information.
    • 27. Together with Linux and Apache , they form the LAMP stack; one of the most popular platforms for web development.
  • 28. Installing XAMPP for Windows
    • Download the zipped XAMPP from ApacheFriends.org (149MB)
    • 29. Unzip to C:XAMPP
    • 30. Run setup_xampp.bat
      • Sets directory names in the batch files.
  • 31. Running XAMPP on Windows
    • Run xampp-control.exe
    • 32. Start Apache and MySQL
    • 33. http://localhost/
  • 34. Problems With Windows Installation
    • Apache wouldn't start on WinXP.
    • 35. Download vcredist_x86.exe from Microsoft, and run it. This will install missing DLL's.
    • 36. Try starting Apache again.
    • 37. (BTW: no problems running on Win7.)
  • 38. Installing XAMPP on OSX
    • Download XAMPP dmg from apachefriends.org (86MB)
    • 39. Double click dmg, and drag XAMPP to Applications folder
  • 40. Running XAMPP on OSX
    • Go to the XAMPP folder in Applications. Run XAMPP Control
    • 41. Start Apache and MySQL (order is unimportant)
    • 42. You'll be asked for the admin password to your machine
    • 43. The LEDs should turn green
    • 44. http://localhost/
  • 45. Apache Won't Start :(
    • On occasion Apache won't start.
    • 46. XAMPP Control may even show it as started, but it hasn't.
    • 47. On OSX it actually tells you why:
      • There's another process listening to port 80 . You need to find that process and terminate it with extreme prejudice.
    • Chances are good that process may be Skype .
    • 48. Quit Skype , and start Apache again. You should be good to go.
  • 49. XAMPP localhost
    • Main XAMPP page:
  • 50. Installing WordPress on OSX
    • Download the latest version of WordPress from wordpress.org
    • 51. Unzip it under /Applications/XAMPP/xamppfiles/htdocs/<dir>
    • 52. In your browser go to http://localhost/<dir>
    • 53. You can also:
      • Unzip it under /Users/<username>/Sites/<dir>
      • 54. In your browser go to http://localhost/~<username>/<dir>
  • 55. Installing WordPress on Windows
    • Download the latest version of WordPress from wordpress.org
    • 56. Unzip it at C:XAMPPhtdocs<dir>
    • 57. In your browser go to http://localhost/<dir>
  • 58. Create a Database
    • At the bottom of the XAMPP localhost menu, click phpMyAdmin
    • 59. Enter a database name (alphanumeric and underscores, no spaces or special characters) and click Create
  • 60. Back to Our WordPress Install
    • Windows will allow creation of configuration file
    • 61. OSX will not: you'll need to edit the wp-config-sample.php and save it as wp-config.php
    • 62. You'll need to know:
      • database name
      • 63. database user ID (root)
      • 64. database password (blank)
      • 65. database host (localhost)
      • 66. table prefix (wp_)
    • If the install program can't write your wp-config.php file, it'll display the text, and ask you to cut and paste it into the file, using an editor of your choice.
  • 67. Virtual Hosts
    • Chances are you'll want/need more than one web site/app hosted on your machine.
    • 68. Virtual hosts (aka vhosts) allows you to host multiple web apps or sites, on the same machine.
    • 69. This is what the hosting companies use for shared hosting.
  • 70. Virtual Hosts: Files
    • hosts - shortcuts DNS
      • Win: C:WindowsSystem32driversetchosts
      • 71. OSX: /etc/hosts
    • httpd.conf - Apache configuration
      • Win: C:XAMPPapacheconfhttpd.conf
      • 72. OSX: /Applications/XAMPP/xamppfiles/etc/httpd.conf
    • httpd_vhosts.conf - Virtual Hosts configuration
      • Win: C:xamppapacheconfextrahttpd-vhosts.conf
      • 73. OSX: /Applications/XAMPP/xamppfiles/etc/extrahttpd-vhosts.conf
    • After modifying these files, restart Apache
  • 74. Virtual Hosts: hosts ## # Host Database # # localhost is used to configure the loopback interface # when the system is booting. Do not change this entry. ## 127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 localhost fe80::1%lo0 localhost 127.0.0.1 lphsgrads 127.0.0.1 lphsgrads2.dev 127.0.0.1 aaa
    • The 127.0.0.1 IP address is your localhost machine
    • 75. Just add another line with the localhost IP, a space or two, and your desired domain name
  • 76. Virtual Hosts: httpd.conf
    • This is the main configuration file for Apache
    • 77. Insure the include for httpd-vhosts.conf is uncommented:
  • 78. Virtual Hosts: httpd-vhosts.conf NameVirtualHost *:80 <VirtualHost *:80> ServerName mybloggittyblog.blog DocumentRoot &quot; /Applications/XAMPP/xamppfiles/htdocs/myblog &quot; <Directory &quot; /Applications/XAMPP/xamppfiles/htdocs/myblog &quot; > Options Indexes FollowSymLinks ExecCGI AllowOverride FileInfo Order allow,deny Allow from all </Directory> </VirtualHost>
    • For a new vhost:
      • Copy the VirtualHost segment, and change the ServerName
      • 79. DocumentRoot and Directory must be the same, and point to the document root of your virtual site
      • 80. Use forward slashes between dirs, even on Windows. No slash at the end.
      • 81. Restart Apache
      • 82. In your browser: http://mybloggittyblog.blog
  • 83. A Debt of Gratitude
    • Owed to the open source developers, testers and documenters who give so generously of their time and skills, to provide us with these awesome tools.
    • 84. Thanks to their efforts, we can easily communicate with unprecedented reach.
  • 85. Best Practices
    • Keep your sandbox as close to the server's versions as possible
    • 86. Install WP/plugin updates as they become available
    • 87. Take regular backups
    • 88. manifest.txt
  • 91. Resources
    • WordPress.org (of course)
    • 92. WordPress.tv
    • 93. XAMPP - http://apachefriends.org
    • 94. Notepad++ - http://notepad-plus-plus.org/
    • 95. TextWrangler - http://barebones.com/products/textwrangler/
    • 96. Microsoft - http://www.microsoft.com/download/en/details.aspx?id=5555
      • For vcredist_x86.exe DLL installer