Category Archives: Web development
The quickest way to get out of a persistent popup that won’t go away (unless you do what it demands!) is to quit or force quit* the browser then restart Safari holding down the ‘Shift’ key.
Holding down Shift allows Safari (or any other app) to restart without resuming its last state.
While this is a great, fast way to solve the problem, it can be annoying if you had other tabs open, and you don’t want to loose those too (or any unsaved data they may contain).
1. Go to Terminal and paste this command (it’s all one line):
2. Reopen Safari
You’ll get all your tabs back including the hijacked tab, but the pop up won’t appear, and you can now close the hijacked tab.
(alternatively you can do that in Terminal).
Don’t forget this step, or you’ll think the web is broken!
*You can force quit an app by pressing the following keys in combination on your keyboard <command><option><esc> then choosing the app you want to quit.
If you’ve installed a MAMP dev environment and have found the instructions you’ve read elsewhere for setting up a virtual host on port :80 aren’t working, the following should get you sorted.
1. First of all, make sure Mountain Lion’s not running Apache separately from MAMP. To do so, open Terminal.app, and copy/paste this into the Terminal window:
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
(that’s all one line!)
Enter your admin password when prompted. Be aware that it will be invisible as you type, so type carefully. If you get an error message that says “Sorry, try again”, then indeed, try again. Only type more carefully this time! :D. On the other hand, if Terminal just returns the prompt after you hit ‘return’ or reports ‘Nothing to unload’ then you’re good to go to Step 2.
2. Assuming that you want to call your virtual host site ‘mytest’, then add to the last line of the /etc/hosts file:
3. That’s the easy part! Next, add to the end of the /Applications/MAMP/conf/apache/httpd.conf file the following text:
Note that there are quote marks around both
DocumentRoot filepaths. Also, be sure to change the items highlighted in red to reflect your own shortuser name and site name.
4. Go into your Home folder in the Finder, and create a folder called ~/Sites/mytest/ (before creating the ‘mytest’ folder, you may need to create the parent folder ‘Sites’ if it doesn’t already exist).
5. Create an ‘index.html’ file inside ~/Sites/mytest/ that looks something like this:
<p>My virtual host site is up!</p>
6. Finally, be sure to restart the MAMP servers and you should be up and running! 🙂
For further help with MAMP, please see the documentation here.
Learn Ruby on the Mac