Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Activating Apache on Lion

From: Installing Apache, MySQL, and PHP

Video: Activating Apache on Lion

Just as with older versions of the Mac operating system, version 10.7, or Lion, includes the Apache HTTP server. It's up to you to activate, or turn it on. I'll go to the Apple menu and choose System Preferences. You can also get here through the Dock. On this screen, go to the Internet & Wireless section and choose Sharing. Mac OS X refers to the Apache HTTP service as Web Sharing. Go to that category, and you'll see that it's turned off by default.

Activating Apache on Lion

Just as with older versions of the Mac operating system, version 10.7, or Lion, includes the Apache HTTP server. It's up to you to activate, or turn it on. I'll go to the Apple menu and choose System Preferences. You can also get here through the Dock. On this screen, go to the Internet & Wireless section and choose Sharing. Mac OS X refers to the Apache HTTP service as Web Sharing. Go to that category, and you'll see that it's turned off by default.

To turn it on, just check the check box; it's that simple. Now to test your Apache server, go to the second link on this screen. It will either show an IP address, as it does here, or your computer name. Click the link. If everything is working correctly you should see the page, "It works!" This is a very simple homepage that's provided with the Apache server. Now it might not work on your system, especially if it's showing the computer name instead of an IP address, but here is the URL that always works.

Go up to the address bar and change either the IP address or the computer name, whichever showed up, to this IP address, 127.0.0.1. Then press Return and now you should definitely see this page. The IP address that starts with 127 is a globally used IP address that refers to the local computer. It's used on Mac, Windows, Linux, and other operating systems. There's a name that goes with it.

Instead of 127.0.0.1, you can instead use localhost and that should work as well. Now let's take a look at where these files are stored on your Mac. Now let's return to the Sharing dialog. Lion has added a couple of useful buttons to this interface. There is a button above called Create Personal Website Folder-- I'll show you that in a moment--and this one Open Computer Website Folder. When you click the button it takes you to your document root folder on your Mac hard disk.

You'll find that it has this file, index.html, and some graphic files that might or might not be showing up on your screen. There's also this folder, postgresql. This is new to Lion. It contains documentation for the PostgreSQL database, and it's not relevant to what we're doing here, so I won't talk about it anymore. I'm going to show you exactly where this folder is located on the disk. I'll make sure that I've deselected all the files and folders in this screen. Then I'll go to the Finder menu and choose View > Show Path Bar.

Down at the bottom of the screen, that will show that this folder is under Library > WebServer > Documents. If you're using the Apache HTTP server, this is where you put your HTML, graphics, PHP files, and other files that you want to be able to browse from the browser. We call it the document root folder. On Mac OS X there is also a concept of a personal document root folder. Each user can have a folder named Sites, with an uppercase S, which is also accessible from a browser.

I'll go back to my Sharing dialog and show you that there's a link here with the original URL and the syntax ampersand and then username. My username is simply lyndadotcom, so this would refer to the Sites folder under my home directory. I'll click the link and you'll see that there's a message saying I don't have permission to access that folder, and here's why. On Lion that folder does not exist by default for new users. I'll go back to Finder and go to the menu and choose Go > Home, and I'll show you that there is no sites folder here.

There is the Desktop, the Documents, and so on, but that folder has not been created yet. So, going back to Sharing, this is where this button comes into play. I'll click Create Personal Website Folder and then Open Personal Website Folder, and I'll see that I have a file called index.html and a folder named images. And looking at the path bar at the bottom, I'll see that I can now do have a Sites folder in my lyndadotcom home folder.

I'll double-click lyndadotcom and show you that that's where the folder has been created. Going back to Sharing, I'll click that link again, and this time I see files that have been created for me. Now just like the computer's own web site, you can either use the URL that's generated here or you can use 127.0.0.1 or you can also use localhost. So if you're able to access both the computer's web site, which is in that Library > WebServer > Documents folder, and your personal web site, which is in the Sites folder, under your home directory, you have Apache completely set up and ready to use.

Show transcript

This video is part of

Image for Installing Apache, MySQL, and PHP
Installing Apache, MySQL, and PHP

39 video lessons · 43577 viewers

David Gassner
Author

 
Expand all | Collapse all
  1. 17m 35s
    1. Welcome
      1m 9s
    2. Understanding Apache, MySQL, and PHP
      7m 12s
    3. Using the exercise files
      1m 7s
    4. What's new in this update
      3m 35s
    5. Choosing a software stack
      4m 32s
  2. 30m 18s
    1. Installing Apache HTTP Server 2.4 on Windows
      6m 51s
    2. Installing PHP 5.5 on Windows
      4m 12s
    3. Starting Apache from the command line
      5m 24s
    4. Installing MySQL on Windows
      7m 24s
    5. Installing phpMyAdmin on Windows
      6m 27s
  3. 44m 5s
    1. Activating Apache on Leopard and Snow Leopard
      3m 35s
    2. Activating Apache on Lion
      5m 9s
    3. Activating Apache on Mountain Lion and Mavericks
      4m 57s
    4. Configuring personal site folders on Mountain Lion and Mavericks
      6m 59s
    5. Activating PHP on Mac OS X
      6m 12s
    6. Installing MySQL on Mac OS X
      3m 59s
    7. Setting the root user password
      2m 28s
    8. Installing phpMyAdmin on Mac OS X
      6m 16s
    9. Uninstalling MySQL on Mac OS X
      4m 30s
  4. 14m 35s
    1. Installing WampServer
      6m 25s
    2. Managing WampServer
      2m 2s
    3. Defining directory aliases through WampServer
      2m 55s
    4. Changing software versions with WampServer add-ons
      3m 13s
  5. 10m 58s
    1. Installing MAMP
      4m 6s
    2. Configuring Apache and MySQL server ports
      1m 57s
    3. Managing MAMP
      4m 55s
  6. 29m 3s
    1. Installing XAMPP for Windows
      10m 0s
    2. Managing XAMPP for Windows
      4m 4s
    3. Managing MySQL security through XAMPP for Windows
      2m 40s
    4. Installing XAMPP for Mac OS X
      6m 14s
    5. Managing XAMPP for Mac OS X
      2m 27s
    6. Managing MySQL security through XAMPP
      3m 38s
  7. 13m 20s
    1. Installing BitNami for Windows
      6m 31s
    2. Installing BitNami for Mac OS X
      6m 49s
  8. 18m 49s
    1. Handling port conflicts with Skype on Windows
      2m 37s
    2. Handling other port conflicts on Windows
      5m 19s
    3. Detecting and handling port conflicts on Mac OS X
      6m 26s
    4. Configuring Apache to work with IPv6 on Windows 8
      4m 27s
  9. 31s
    1. Goodbye
      31s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Installing Apache, MySQL, and PHP.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.