Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
In versions of OS X prior to 10.8 Mountain Lion, Apple had a feature that let you easily create a personal website folder. A sub folder of your Home folder named Sites. And you could put your own website assets there and address it as its own distinct website. As I showed previously, the user interface for controlling Apache is gone in Mountain Lion. But you can do the same thing in Mountain Lion manually by just following a few steps in Terminal and in a text editor.
The first step is to create the folder. I'll go to Finder then I'll start in the desktop folder. Then I'll hold down the Command key and press the Up arrow and that takes me to my home folder. And this is where I'll create a new sites folder. I'll right click in the folder and select new folder, and name it sites with an uppercase S. You can name this anything you want. It doesn't have to be sites but I am going to show you how to imitate the behavior of previous version of the operating system.
So the sites folder is being created and now we just need to add a little bit of content. I am going to use text wrangler to create a very simple HTML file. You can use any text editor that you prefer such as Dreamweaver or I'll go to spotlight and type in text wrangler and open the application. I'll start by creating a pair of HTML tags, then a pair of body tags and then within the body, a pair of h1s.
Within the h1 tabs, I'll type in this is my personal website. Then I'll save this file and I'll place it in that new sites folder. Just as I did before, I'll go to my home folder, which is named lynda.com on my computer. From there I'll go down to the sites folder and then I'll name the file index.html. So, now, I have a simple, default webpage. The next step is to add a configuration to Apache. That tells Apache when the user types in a URL that ends with tilde and then my username, it means to open the files in this folder.
I'll close down Text Wrangler, and I'll now go to terminal. In terminal, I'll switch to the users folder underneath the Apache installation folder. I'll type cd, then forward space etc, then Apache two, and then users. This users folder will contain one configuration file for each user who has a personal website. If this is a brand new installation of Mountain Lion and you list out all the files with LS, you should see that there aren't any configuration files there.
If you upgraded to Mountain Lion from an older version of OS X, you might see conf files for each user on the computer. Your job is to create a configuration file for your user profile. To do this, we'll use the editor that's included with OS X. It's named Pico. Its user interface is a little clunky, but it knows how to create system and hidden files. Start by typing sudo for super user do, then pico, then your username.
And this should match the name of your home folder. I'll type lynda.com. Then follow that with the file extension .conf. You are saying, create this file and open it in the Pico editor. When you press return, you might be prompted for your administrative password. If so, type it in and press return and that opens your new file in the editor. Now I'll type in some text. As you will follow along typing in exactly as I'm doing here. It is case sensitive.
I'll start with a directory tag. I start with the beginning tag token a less than character. Then the word directory with an upper case D. Next is the physical name of your sides folder. That's the photo you just created. After a double quote, start with slash users. Then after another slash, the name of you home folder. Again for me, that will be lynda.com. Then after another slash, the name of the subfolder you created and I created a subfolder called sites.
Then close the tag. On the next line, you'll start adding some keywords that tell Apache how this folder should be treated. Start with Options, then Indexes, and then MultiViews. On the next line, type in AllowOverride All. It looks like this. On the following line type in order with an upper case O. Then in all lower case allow,deny. That means that when evaluating permissions for this folder, Apache should give precedence to allow commands.
Then on the next line type in allow from all. And finally, close the directory tag. I'll press Return one more time and I'll review what I've typed. Make sure that you type this in exactly right. You can always come back and edit it again later by executing that same pico command in Terminal. But it's best if you get it right the first time. Once you've confirmed that you've typed everything correctly, press control x to exit pico typing' y' for yes and then return to confirm the file name.
When you come back to the command line, type LS and once again list the files and you should see that the configuration file has been created. Now restart Apache. Type in sudo Apache ctl restart. You won't see any response, but that re-launches the Apache server and it will read that configuration file and be ready to respond. Let's review all the steps that we followed. We created the sides folder, and we populated it with some content.
In terminal, we added a configuration file for the current username, and then restarted Apache. Now, I'll test my personal folder. I'll go to my browser and I'll type in the URL http://localhost and then the tilde character and my username and when I press return, I see my personal web page is displayed, with the content that I typed in. You can follow this process for any user on the computer. Creating configuration files that create exactly the same personal web site as well as created more automatically on older versions of OS X.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 74950 Viewers
80 Video lessons · 129929 Viewers
52 Video lessons · 64107 Viewers
59 Video lessons · 49902 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
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.
Your file was successfully uploaded.