Local Mamp



Local by Flywheel vs MAMP: What are the differences? Developers describe Local by Flywheel as 'A way to develop WordPress locally'. It is a free local development environment designed to simplify the workflow of WordPress developers and designers. It makes creating a local WordPress site a light breeze. For good measure, try loading local server in your browser, it shouldn't work. Then, undo everything above and change your document and directory roots back to their originals. Stop/Restart MAMP. Official MapQuest website, find driving directions, maps, live traffic updates and road conditions. Find nearby businesses, restaurants and hotels. See full list on recentwp.com.

With XAMPP (Windows)

  • Locate your hosts file. In Windows XP, this file is located in C:WINDOWSsystem32driversetc. Different versions of Windows may store the file in a different directory. And depending on your Windows setup, you might need to be logged in as an administrator to modify the hosts file.
  • Open the file with a plain text editor (like Notepad++ or Sublime Text). In the hosts file, you should see something similar:

Right below the line 127.0.0.1 localhost, enter your domain name information. Example:

  • Put all your website files in a folder “mysite” (for example) and put it in C:xampphtdocs like this C:xampphtdocsmysite.
  • Go to C:xamppapacheconf
  • Open httpd.conf file using a plain text editor (like Notepad++ or Sublime Text) and if you have a “#” before Include conf/extra/httpd-vhosts.conf, remove it by changing:

to:

i.e. uncomment the line so that it can includes the virtual hosts file.

  • Go to C:xamppapacheconfextra and open httpd-vhosts.conf file using a plain text editor (like Notepad++ or Sublime Text) and add the following code:
  • If not already open, open XAMPP control panel and start Apache.
  • Go to the URL: http://mysite.local/
  • You are done.

With WAMP (Windows)

Same steps as that of XAMPP just change the paths according to WAMP which corresponds to path in XAMPP.

  • Locate your hosts file. In Windows XP, this file is located in C:WINDOWSsystem32driversetc. Different versions of Windows may store the file in a different directory. And depending on your Windows setup, you might need to be logged in as an administrator to modify the hosts file.
  • Open the file with a plain text editor (like Notepad++ or Sublime Text). In the hosts file, you should see something similar:

Right below the line 127.0.0.1 localhost, enter your domain name information. Example:

  • Put all your website files in a folder “mysite” (for example) and put it inC:wampwww like this C:wampwwwmysite.
  • Go to C:wampbinapacheapacheX.X.XXconf
  • Open httpd.conf file using a plain text editor (like Notepad++ or Sublime Text) and if you have a “#” before Include conf/extra/httpd-vhosts.conf, remove it by changing:

to:

i.e. uncomment the line so that it can includes the virtual hosts file.

  • Go to C:wampbinapacheapacheX.X.XXconfextra and open httpd-vhosts.conf file using a plain text editor (like Notepad++ or Sublime Text) and add the following code:
  • Restart your server.
  • Go to the URL: http://mysite.local/
  • You are done.

With MAMP (Mac OS)

The easiest way to set up virtual hosts in MAMP is to use the commercial version of MAMP, which automates the process through the MAMP Pro console. However, if you don’t want to buy MAMP Pro, it’s quite simple to do it manually by editing two files. You need to be logged in as a Mac administrator to edit the files.

  • Locate your hosts file. This file is located in /etc/hosts. You might need to be logged in as an administrator to modify the hosts file.
  • Open your console in mac and edit your hosts file like this:
  • This opens a system file that contains the following line:
  • add your desired host name after local host:
  • Press ESC, then :wq! to overwrite and close the file.
  • Put all your website files in a folder “mysite” (for example) and put it in/Users/MyUsername/ like this /Users/MyUsername/mysite.
  • Go to /Applications/MAMP/conf/apache/
  • Open httpd.conf file using a plain text editor (like Notepad++ or Sublime Text) and if you have a “#” before Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf, remove it by changing:

to:

i.e. uncomment the line so that it can includes the virtual hosts file.

  • Go to /Applications/MAMP/conf/apache/extra/ and open httpd-vhosts.conf file using a plain text editor (like Notepad++ or Sublime Text) and add the following code:
  • Restart your server.
  • Note: If your URLs seem to be broken make sure to set AllowOverride to “All” in the Apache config file: /Applications/MAMP/conf/apache/httpd.conf (It’s around line number 206).
  • Go to the URL: http://mysite.local/
  • You are done.

References

In this lesson, you will learn how to install WordPress locally on your own computer.

Prerequisite Skills

Participants will get the most from this lesson if they have familiarity with:

  • Experience downloading and installing programs on their computer.
  • Administrative access to their local machine.
  • Familiarity with the file system of their computer.

Objectives

After completing this lesson, participants will be able to:

  • Download, install and configure MAMP.
  • Start MAMP servers.
  • Create a database.
  • Download and install WordPress.

Materials Needed

Screening Questions

Mamp local server
  • Have you ever used WordPress?
  • Have you created posts and pages in WordPress?
  • Have you changed a theme in WordPress?
  • Have you ever wanted to look under the hood of WordPress?

Notes for the Instructor

  • Ahead of the lesson, make sure you take a look at your own computer setup. If you have MAMP or MAMP Pro already installed on your machine, you may want to run this demo on a virtual box to avoid conflicts with existing software and local sites that you may want to keep on your machine.
  • Sometimes it can take a while to download large files like MAMP or WordPress core. You may want to have a copy of MAMP and the current version of WordPress downloaded and stored on a thumb drive that can be passed around the class before you start the lesson. In the context of the demo, you would still show where to download these files but would skip the actual live download.
  • MAMP is updated quite often. Please be sure to walk through the lesson plan with a fresh install to be sure it is still up to date.

Lesson Overview

To run WordPress locally, you need to have a server. In this lesson, you will learn to set up a server, create a database and install WordPress on your computer.

Install MAMP

MAMP stands for My Apache, MySQL, and PHP. MAMP is an application you can install on your Mac or Windows PC that allows you to have access to a local server that is running PHP and MySQL. Essentially, MAMP gives you all of the tools you need to run WordPress on your machine, for development and testing purposes.

  1. To install MAMP, go to https://www.mamp.info/en/downloads/.
  2. Download the version of MAMP that corresponds with your machine (Mac OS X or Windows).
  3. Double click on the downloaded file. This will open the installation dialog.
  4. Next, we’ll follow the prompts in the dialog to complete the installation. This course uses the default settings recommended by the install dialog.

Open and configure MAMP

  1. Now that MAMP is installed, let’s open it up! MAMP has a button to start servers when first started. By clicking on “Preferences” you can select an option to start the Apache HTTP Server and MySQL database server upon starting MAMP.
  1. Click on the “preferences” icon. You’ll see that there are several tabbed menu items available.
  2. Click the “Web Server” tab and find the “Document Root.” This path is where MAMP expects to find the files associated with your local website. In this case, this is where the WordPress files will need to be located to run them on the server. You may change this directory to whatever you want. The default is “/Applications/MAMP/htdocs” on a Mac and “C:/MAMP” on Windows.

Set up a Database

  1. Next, we will create a database on your new MAMP server. This database will become the database for the locally installed WordPress site.
  1. Go back to the MAMP dialog and click “Start.”
  1. Using the menu bar at the top of the page, click “Tools -> phpMyAdmin.”
  1. The phpMyAdmin dialog will appear.
  1. Click the “New” link in the left menu sidebar.In the following dialog, use the name “mydatabase” to name the database:
  1. Leave the “Collation” option as default.
  2. You now have a database called “mydatabase.” Congratulations!
Mamp

Local Manpower Modifier Eu4

Install WordPress

  1. Now we’re ready to install WordPress on our local machine! Go to https://wordpress.org/download/ to download the most recent version of WordPress. Once you download and copy the WordPress files to your computer, you will be able to install WordPress using the traditional 5 Minute Install.
  1. Move the downloaded zip file to the default server directory, “/Applications/MAMP/htdocs.” You could expand the zip file in your downloads folder and move the expanded folder and its contents, but sometimes the “hidden” system files that are included in WordPress (like the .htaccess file) fail to copy over to new folders if the contents are unzipped. For that reason, we’ll leave our zip file zipped while we’re moving it.
  1. In the new”/Applications/MAMP/htdocs” location, double click the WordPress zip file and it will expand. Remove the zip file and the index.php file.
  1. Go back to your web browser, and in the black menu bar, click the link “My Website.”
  1. The link will take you to a list of websites installed in the directory. Click the “WordPress” link. This link will take you to the 5 minute WordPress install.
  1. Get ready to enter your database information:
  • Your “Database Name” is: mydatabase
  • Your “User Name” is: root
  • Your “Password” is: root
  • Your “Database Host” is: localhost
  • You can leave the “Table Prefix” as the default: wp_
  1. Now, let’s click the “Submit” button to run the install.
  1. Click the “Run the install button” and then choose a username and password on the next screen. That’s it! You’re ready to log in!
  2. The link for your new site: http://localhost:8888/wordpress/. You will log in at this URL: http://localhost:8888/wordpress/wp-login.php.
Mamp

Exercises

The following exercises reinforce the skills needed to install WordPress locally:

Practice Using phpMyAdmin

  • Navigate back to phpMyAdmin on your localhost.
  • Click on the name of your database to view the contents of your database now that you have installed WordPress.
  • When looking at the database tables, scroll to the bottom of the page and click the “check all” box. Then in the dropdown that says “With Selected” choose “Export” and follow the prompts to practice backing up your database.
  • Practice making a new database within phpMyAdmin.

Try Installing a Second WordPress Local Site

Go through the exercise demonstrated in this lesson again and try setting up a second instance of WordPress on your local machine in a new location.

  • Make sure the document root matches wherever you’ll keep your files for the second instance of WordPress.
  • Set up a new database using phpMyAdmin.
  • Extract the WordPress files in a new location on your computer.
  • Run the famous 5 minutes install for your new local site.

Assessment

What does “MAMP” stand for?

  1. My Computer, Apple, MySQL, PHP
  2. My Computer, Apache, MySQL, PHP
  3. My Apache, MySQL, PHP
  4. Macintosh, Apple, MySQL, PHP

Answer: 3. Macintosh, Apache, MySQL, PHP

What is the user name and password for any named local install?

  1. username: root; password: localhost
  2. username: localhost; password: localhost
  3. username: root; password: root
  4. username: localhost; password: root

Local Map

Answer: 3. username: root; password: root

What systems can MAMP run on?

Local Mamp

  1. Macintosh
  2. Windows
  3. Macintosh and Windows
  4. Linux
  5. Macintosh, Windows and Linux

Answer: 3. Macintosh and Windows

Additional Resources

  • WordPress Installation Techniques @ Codex