Matt Cone April 26, 2007 TutorialsMacDeveloper
Mac OS X is built on Darwin – a Unix-like, open source operating system developed by Apple and built on FreeBSD. This means that Mac users have access to free built-in server applications, like the Apache web server. With Apache and the DynDNS service, you can turn your Mac into a powerful web server. Anyone will be able to access the website stored on your Mac!
Press the power button to turn on the Mac or wake from sleep. Press and hold the power button for 5 seconds without lifting to force your Mac to turn off. Press and hold power button for 1.5 seconds to get the turn off dialog. This dialog will ask if you want to restart, shutdown or put the Mac to sleep. This article will show you how to turn your MacBook computer into a wireless router so that you can share internet connection with other people or simply use internet on your smartphone. Navigate to AppleSystem Preferences Network.
![Can Can](https://www.lifewire.com/thmb/fhg5FQHdUle9wuKTmAl_OG8gxc4=/2452x1096/filters:no_upscale():max_bytes(150000):strip_icc()/001_how-to-turn-your-macbook-on-or-off-4580539.jpg-ca23095957be48bb9415c6b30b2be3b2.jpg)
The best part is that you can host a website on your Mac for free. There are no hosting fees to pay, and your website will be available any time your Mac is turned on and connected to the Internet. We'll show you how to do it!
Turn on Personal Web Sharing
The first step to web-serving nirvana is turning on your Mac's web serving application. Apple hid the Apache web server in an inconspicuous place in Mac OS X, and they called it Personal Web Sharing. But make no mistake about it – this little service included with every Mac is powered by some serious software. Apache powers the Internet, and now it's going to power the website hosted on your Mac.
Here's how to turn it on:
From the Apple menu, select System Preferences.
Click Sharing, and then click the Services tab.
Select Personal Web Sharing, and then click the Start button.
Personal Web Sharing will turn on. (This could take a minute or two.) After it turns on, note your computer's IP address and URL at the bottom of the Sharing Preferences window. You'll need this later when you test your website.
Now that your Mac is accessible to anyone on the internet – including hackers and other evil-doers – you're going to need to protect it. Click the Firewall tab and make sure your Mac's firewall is turned on. Also make sure that the checkbox next to Personal Web Sharing is selected. This will allow people to access your website through your Mac's firewall.
Remember those IP addresses and URLs we asked you to save? Type those into your web browser to test your web server. (You can also type 'localhost' – this tells your Mac to look for its own website.) If your web server is working, you'll see one of the web pages below.
Close the System Preferences. You've successfully turned on your Mac's web server.
Create Your Website
Obviously, you'll need a website to truly use your Mac as a web server. If you already have one stored on your Mac, you can start hosting it immediately. Here's how:
You have a couple choices when it comes to hosting your website. Every user with an account on your Mac can host his or her own website. There's also a parent directory for the web server – you'll probably want to use this directory. (We'll be working with this parent directory for the duration of this tutorial.) Save your files into one of the following directories:
- Parent Directory: Library > WebServer > Documents
- User Directory: User's Home Directory > Sites
You will need to add at least one file to one of the directories: index.html. This is your homepage!
Test out your website. Depending on which directory you used, you'll need to modify and use one of the following URLs to see your website:
- Parent Directory:
http://youripaddresshere/
(orhttp://localhost/
) - User Directory:
http://youripaddresshere/~usernameWhen
you're satisfied with your website, you're finished.
- Parent Directory:
Make Your Website Accessible to the World
Now your Mac is hosting your website, but if you're on a local network, it's still inaccessible to the rest of the world. The same safeguards that prevent weirdoes from accessing your computer also prevent you from sharing your website. Not to worry! There's a great service called DynDNS that bypasses all of these trivial annoyances and makes your website available to everyone. DynDNS automatically tracks your Mac and maps your IP address to a domain name. That way, your website will always be available, even if you move your Mac to another location and change IP addresses. Here's how to use DynDNS:
Register for an account on the DynDNS website. It's free!
Confirm your new DynDNS by clicking on the link they email you. Log in and click the Add Host Services link, and then click the Add Dynamic DNS Host link.
Enter a hostname and select a domain for your website. This third-level domain name is how the world will access your website, so pick carefully! Don't worry too much about the IP Address right now – DynDNS automatically detects that, and it may or may not be correct. We'll worry about that later.
Download the DynDNS Updater application. Illumin8 best video processing software. Double-click the application and click Install to install it.
You'll be prompted for your administrator password. Enter it, and then wait for DynDNS Updater to install. When it's finished, click OK.
In DynDNS Updater, select Edit Users from the File menu. Enter your username and password. Adding a description is optional. Make sure the Use Secure Connection (SSL) checkbox is selected – you want to protect your password!
In the DynDNS Updater Users window, click the Start Daemon button. If the status of your account says Ok, your website is available at your DynDNS URL. That's it – you're finished!
Oh, #$%&!!! (Important Notes on Using DynDNS)
This whole web server thing with DynDNS is really, really friggin' cool. But before you get carried away with it, you should have a look at these tips and warnings.
- Not Suitable for Production Servers: DynDNS offers a fee-based Recursive DNS service that allows you to map your domain name (i.e.:
macinstruct.com
) to your home computer. This service is not designed for high-traffic websites, and our tutorial presupposes that you will be using DynDNS for small stuff. Please don't use this as a substitute for a full-fledged web server. - Watch Out for Your ISP: Depending on which company you use for Internet connectivity, hosting a live website can be immediate grounds for suspension or termination of your account. Be sure to carefully read your user agreement before using DynDNS.
- Could be Hazardous to Your Mac's Health: Using DynDNS does, at the very least, expose your Mac's IP address. That could be bad news if the wrong people get ahold of it! Plus, running a web server and the always-on DynDNS daemon is processor intensive. Be prepared to take a performance hit. And there's some more bad news for people with Intel processors: There's no Universal version of DynDNS Updater.
Subscribe to our email newsletter
Best 3d animation software 2015. Sign up and get Macinstruct's tutorials delivered to your inbox. No spam, promise!
Not interested in attracting mosquitoes? Keen to save battery and power? Find out here how to quickly turn off the screen on a Mac at any time using the mouse or the keyboard.
![How To Turn Your Macbook On How To Turn Your Macbook On](https://support.apple.com/library/content/dam/edam/applecare/images/en_US/macbookpro/macbook-pro-2017-touchbar-touch-id-tech-spec.jpg)
The best part is that you can host a website on your Mac for free. There are no hosting fees to pay, and your website will be available any time your Mac is turned on and connected to the Internet. We'll show you how to do it!
Turn on Personal Web Sharing
The first step to web-serving nirvana is turning on your Mac's web serving application. Apple hid the Apache web server in an inconspicuous place in Mac OS X, and they called it Personal Web Sharing. But make no mistake about it – this little service included with every Mac is powered by some serious software. Apache powers the Internet, and now it's going to power the website hosted on your Mac.
Here's how to turn it on:
From the Apple menu, select System Preferences.
Click Sharing, and then click the Services tab.
Select Personal Web Sharing, and then click the Start button.
Personal Web Sharing will turn on. (This could take a minute or two.) After it turns on, note your computer's IP address and URL at the bottom of the Sharing Preferences window. You'll need this later when you test your website.
Now that your Mac is accessible to anyone on the internet – including hackers and other evil-doers – you're going to need to protect it. Click the Firewall tab and make sure your Mac's firewall is turned on. Also make sure that the checkbox next to Personal Web Sharing is selected. This will allow people to access your website through your Mac's firewall.
Remember those IP addresses and URLs we asked you to save? Type those into your web browser to test your web server. (You can also type 'localhost' – this tells your Mac to look for its own website.) If your web server is working, you'll see one of the web pages below.
Close the System Preferences. You've successfully turned on your Mac's web server.
Create Your Website
Obviously, you'll need a website to truly use your Mac as a web server. If you already have one stored on your Mac, you can start hosting it immediately. Here's how:
You have a couple choices when it comes to hosting your website. Every user with an account on your Mac can host his or her own website. There's also a parent directory for the web server – you'll probably want to use this directory. (We'll be working with this parent directory for the duration of this tutorial.) Save your files into one of the following directories:
- Parent Directory: Library > WebServer > Documents
- User Directory: User's Home Directory > Sites
You will need to add at least one file to one of the directories: index.html. This is your homepage!
Test out your website. Depending on which directory you used, you'll need to modify and use one of the following URLs to see your website:
- Parent Directory:
http://youripaddresshere/
(orhttp://localhost/
) - User Directory:
http://youripaddresshere/~usernameWhen
you're satisfied with your website, you're finished.
- Parent Directory:
Make Your Website Accessible to the World
Now your Mac is hosting your website, but if you're on a local network, it's still inaccessible to the rest of the world. The same safeguards that prevent weirdoes from accessing your computer also prevent you from sharing your website. Not to worry! There's a great service called DynDNS that bypasses all of these trivial annoyances and makes your website available to everyone. DynDNS automatically tracks your Mac and maps your IP address to a domain name. That way, your website will always be available, even if you move your Mac to another location and change IP addresses. Here's how to use DynDNS:
Register for an account on the DynDNS website. It's free!
Confirm your new DynDNS by clicking on the link they email you. Log in and click the Add Host Services link, and then click the Add Dynamic DNS Host link.
Enter a hostname and select a domain for your website. This third-level domain name is how the world will access your website, so pick carefully! Don't worry too much about the IP Address right now – DynDNS automatically detects that, and it may or may not be correct. We'll worry about that later.
Download the DynDNS Updater application. Illumin8 best video processing software. Double-click the application and click Install to install it.
You'll be prompted for your administrator password. Enter it, and then wait for DynDNS Updater to install. When it's finished, click OK.
In DynDNS Updater, select Edit Users from the File menu. Enter your username and password. Adding a description is optional. Make sure the Use Secure Connection (SSL) checkbox is selected – you want to protect your password!
In the DynDNS Updater Users window, click the Start Daemon button. If the status of your account says Ok, your website is available at your DynDNS URL. That's it – you're finished!
Oh, #$%&!!! (Important Notes on Using DynDNS)
This whole web server thing with DynDNS is really, really friggin' cool. But before you get carried away with it, you should have a look at these tips and warnings.
- Not Suitable for Production Servers: DynDNS offers a fee-based Recursive DNS service that allows you to map your domain name (i.e.:
macinstruct.com
) to your home computer. This service is not designed for high-traffic websites, and our tutorial presupposes that you will be using DynDNS for small stuff. Please don't use this as a substitute for a full-fledged web server. - Watch Out for Your ISP: Depending on which company you use for Internet connectivity, hosting a live website can be immediate grounds for suspension or termination of your account. Be sure to carefully read your user agreement before using DynDNS.
- Could be Hazardous to Your Mac's Health: Using DynDNS does, at the very least, expose your Mac's IP address. That could be bad news if the wrong people get ahold of it! Plus, running a web server and the always-on DynDNS daemon is processor intensive. Be prepared to take a performance hit. And there's some more bad news for people with Intel processors: There's no Universal version of DynDNS Updater.
Subscribe to our email newsletter
Best 3d animation software 2015. Sign up and get Macinstruct's tutorials delivered to your inbox. No spam, promise!
Not interested in attracting mosquitoes? Keen to save battery and power? Find out here how to quickly turn off the screen on a Mac at any time using the mouse or the keyboard.
First, a Goddess Wrapped around the Dark Side
of the known earth had an important function in Ancient Egypt: Nut swallowed the sun at night to end the day and, in the morning, gave birth to it so a new day could begin.
Now, how about having your Mac screen's bright light swallowed at will and any time (without putting the whole computer to sleep)?
How to Turn Off the Screen on a Mac (Without Putting It to Sleep)
Using a Keyboard Shortcut
Time needed: 1 minute.
To quickly turn off your Mac's screen at any time:
- Press
Control
Shift
Eject
.Tip: The
Eject
key usually shows⏏
.
Note: If your Mac's keyboard lacks anEject
key, you can use hot corners to black out the screen using mouse or trackpad or set up a custom keyboard shortcut; see below. - Press and key, click a mouse button or tap on a trackpad to wake the screen again
Note: Merely moving they mouse pointer or touching the trackpad will not turn on the screen.
Hours later…
Ready to go to sleep now but your Mac apparently is not? How to find out why your Mac Is not going into sleep mode
Using a Hot Corner on the Screen
To set up a corner on the screen to turn off the display:
- Select System Preferences… from the Apple () menu.
- Open the Desktop & Screen Saver category.
- Make sure you are on the Screen Saver tab.
- Click Hot Corners….
- Now pick a corner to turn off the screen and select Put Display to Sleep for that corner.
Tip: You can require one or more keys to be pressed while the mouse cursor is in the corner for the display to be turned off; hold down the desired key or keys (Command
,Control
,Option
,Shift
and any combination) while selecting the Put Display to Sleep from the corner action's menu.
Hint: You can make more than one corner turn off the Mac screen, too. - Click OK.
Now, to turn off the screen with a flick of the mouse cursor:
- Move the mouse cursor to any corner configured to turn off your Mac's screen.
Hint: If your hot corner requires holding down a key, you can let go of the key before you release the mouse.
Using the Command Line
To immediately turn off the screen on any Mac running macOS from Terminal (or any tool that can run command line scripts and applications):
- Open Terminal.
- Type
To create your own keyboard shortcut for putting the display (but not the Mac itself) to sleep—if your keyboard lacks an
Eject
key, for instance:- Open Automator.
- Click New Document.
- Select Quick Action.
- Click Choose.
- Select no input under Workflow receives at the top.
- Click Library if you do not see the command library.
- Drag and drop the Run Sheet Script action to the workflow.
Tip: Search the library forshell
to quickly find the action. - Type
pmset displaysleepnow
for the shell script. - Select File | Save from the menu.
- Enter the desired name (say, 'turn off screen') for the new quick action's name.
- Click Save.
- Now select | System Preferences… from the menu.
- Go to the Keyboard category.
- Open the Shortcuts tab.
- Select Services.
- Highlight the quick action just created ('turn off screen') under General.
- Click Add Shortcut.
- Type the desired key combination for turning off the display.
How to Turn Off the Screen on a Mac Notebook That Uses an External Display
To turn off only the screen on your Mac laptop (MacBook Pro, MacBook Air, etc.) while working on an external display:
Turn On Macbook Air
- Connect the Mac laptop to a power source.
Tip: This can be a power cord, of course, but also a display that powers the computer through USB-C. - Use an external mouse or trackpad and keyboard to operate the laptop.
Note: The devices can connect via USB or Bluetooth. - Now connect the Mac laptop to an external monitor.
Note: Depending on the ports on the display and laptop, you may have to use an adapter.
Tip: Connect the external monitor while the laptop is asleep if it fails to turn on. - Close the laptop's lid for macOS clamshell mode.
- Press a key (or click with the mouse) to wake the external display.
How to Turn Off the Screen on a Mac Laptop Connected to an External Display While Using the Built-In Keyboard and Trackpad
To turn down a Mac laptop's screen without closing its lid while you use it with an external display:
- Connect the laptop to an external monitor.
- Open System Preferences.
Tip: Select | System Preferences… from the menu. - Go to the Displays category.
- Now go to the Arrangement tab.
- Turn on Mirror Displays.
Tip: Switch to the Displays tab and pick the external display under Optimize for if the monitor resolution seems off. - Go to the Display tab.
- Turn down the Brightness to its very minimum.
Note: This will almost (but not quite) turn off the screen and Automatically adjust brightness is disabled.
Tip: Use the laptop's function keys to turn up the brightness if the external display disconnects and you sit in front of a black screen.
How to Turn Off the Screen on a Mac: FAQ
How can I make sure my Mac does not go to sleep with the display off?
Of the countless ways to keep a Mac awake, one is particularly easy and typically at hand:
How To Turn Off Macbook Pro 13
- Open Music on Mac (or iTunes).
- Pick a random song.
Tip: I'm partial to Telemann, Paul Desmond, and Silvius Weiss; and a few precious birds' songs, of course. - Play it on repeat.
Be safe: Do not play a radio station; iTunes may automatically stop playback after some 2 hours or when it runs out of things to play deemed interesting enough.
Tip: You can set up a keyboard shortcut for looping one song.
Looking for a nonmusical solution? Find out how to prevent a Mac from sleeping.
How To Turn On Mac
(How to turn off the screen on a Mac tested with macOS Big Sur 11.0 and macOS Catalina 10.15; updated January 2021) Adobe song mixer software.