Use Your Mac to Share a Web Site

Use Your Mac to Share a Web Site

Use Your Mac to Share a Web Site GA S REGULAR Menu Lifewire Tech for Humans Newsletter! Search Close GO Computers, Laptops & Tablets > Apple

Use Your Mac to Share a Web Site

Enable web sharing on your Mac using its built-in web server

By Tom Nelson Tom Nelson Writer Tom Nelson is an engineer, programmer, network manager, and computer network and systems designer who has written for Other World Computing,and others. Tom is also president of Coyote Moon, Inc., a Macintosh and Windows consulting firm. lifewire's editorial guidelines Updated on April 24, 2021 Tweet Share Email Tweet Share Email

In This Article

Expand Jump to a Section Personal Web Sharing Computer Website Create Web Pages Step-by-Step: Enable Sharing How to Access Your Website Server OS for Web Sharing Your Mac comes equipped with the same Apache web server software that made its reputation by serving up commercial websites. Anyone using OS X Lion (10.7) and earlier can set up web sharing on their Mac by using an easy-to-use interface to access the Apache web server. This setup on OS X made it easy for anyone to serve up a website with a series of simple mouse clicks. The basic web sharing service remained part of OS X until the release of OS X Mountain Lion, which removed the simplified user interface but left the Apache web server installed. Information in this article refers to Mac web sharing using OS X Lion (10.7) and earlier. Apple recommends purchasing OS X Server or macOS Server to return web sharing capabilities to users of OS X Mountain Lion (10.8) and later.

Personal Web Sharing in OS X Lion and Earlier

Your Mac supports two locations for serving up a website. The first is for personal websites created by each user on your Mac. This separation offers an easy way for every member of a family to have a website. Find personal websites in the user's home folder in the Sites directory, located at ~/username/Sites. Don't go looking for the Sites directory just yet. OS X doesn't bother to create the Sites directory until it's needed.

Computer Website in OS X Lion and Earlier

The other location for serving up a website goes by the name "computer website," but this is a bit of a misnomer. The term refers to the main Apache documents folder, which contains the data for websites that the web server serves up. The Apache documents folder is a system-level folder, which is restricted to administrators by default. The Apache documents folder is located at /Library/WebServer. The documents folder's restricted access is the reason why OS X has personal Sites folders for each user. Individual Sites folders allow users to create, manage, and control their own sites without interfering with anyone else's. If you intend to create a company website, you may want to use the computer website location, as it prevents others from making changes to the site easily.

Creating Web Pages in OS X Lion and Earlier

Use your favorite HTML editor or one of the popular WYSIWYG web page editors to create your site and store it in your user Sites directory or the Apache Documents directory. The Apache web server running on your Mac is configured to serve up the file in the Sites or Documents directory with the name index.html.

Enable Web Sharing

To enable web sharing in OS X Lion and earlier: Select System Preferences > Sharing. Place a check mark in the Web Sharing box to turn on web sharing. OS X 10.4 Tiger calls this box Personal Web Sharing. In the Sharing window, click the Create Personal Sites folder button. If the Sites folder is already present from earlier use of the web sharing preference pane, the button reads Open Personal Website Folder. If you prefer to use the Apache documents folder to serve up a website, click the Open Computer Website Folder button.

Accessing Your Website

The Apache web server starts up and serves at least two websites, one for the computer and one for each user on the computer. To access any of these websites, open a browser and enter one of the following: Use the format http://your.computer.address/ for the computer's web page. To find your computer's address, bring up the Sharing window and highlight the Web Sharing name in the list. Your computer's address displays to the right.Use the format http://your.computer.address/~yourusername for a personal web page. To access it, enter the computer's address from the previous step, followed by the ~ (tilde) character and your username with no spaces in the username or between the tilde and your username. If you're not sure what your username is, bring up the Sharing window you accessed earlier and highlight the Web Sharing name in the list. Your personal website address displays to the right.

OS X Server or macOS Server for Web Sharing

Newer Macs ship with an up-to-date version of the Apache web server that's ready for anyone to use—just not with a simplified user interface. However, a move to OS X Server (or macOS Server depending on your operating system) returns web sharing capabilities to the Mac. OS Server for OS X Mountain Lion and later offers a rich collection of server features, including mail server, web server, file sharing, Calendar and Contacts server, Wiki server, and more. Was this page helpful? Thanks for letting us know! Get the Latest Tech News Delivered Every Day Subscribe Tell us why! Other Not enough details Hard to understand Submit More from Lifewire How to Activate the iPhone Debug Console or Web Inspector How to Update Your MacBook Pro What Is a Web Browser? PHP File (What It Is & How to Open One) How to Set up a DNS Alias With Apache Set up a Gmail Account Using the Mac's Mail Application How to Find Files Faster Using Spotlight Keyword Searches How to Factory Reset Your Mac HTACCESS File (What It Is & How to Open One) How to Update Your MacBook Air Laptop How to Move Your Apple Mail to a New Mac How to Save Files to iCloud Drive on Your Mac Personalize the Mac's Desktop Wallpaper With Your Own Pictures How to Transfer Data From Mac to Mac With Migration Assistant Sharing OS X 10.5 Files With Windows XP How to Fix a Mac Application That's Not Starting Newsletter Sign Up Newsletter Sign Up Newsletter Sign Up Newsletter Sign Up Newsletter Sign Up By clicking “Accept All Cookies”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. Cookies Settings Accept All Cookies
Share:
0 comments

Comments (0)

Leave a Comment

Minimum 10 characters required

* All fields are required. Comments are moderated before appearing.

No comments yet. Be the first to comment!