Reinstall apache mac mountain lion

Learn more about Teams. Alex Coplan 8, 14 14 gold badges 66 66 silver badges bronze badges. JimmyJammed JimmyJammed 5, 14 14 gold badges 67 67 silver badges bronze badges. You can uninstall packages in PEAR. You can even uninstall pear completely. Maybe this already fixes your problem? Well I would like a fresh install. For a clean start why not reinstall your complete OS? Because I don't want to lose all my software, files, etc. I just want the web server to be a clean install.

I too had this exact problem, pear completely foobared lion. I had to reinstall.

How to reinstall Mac OS X 10.7 or OS X 10.8 on your 2011 or newer Mac

Alex Coplan Alex Coplan 8, 14 14 gold badges 66 66 silver badges bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. Both foo and bar will be printed to Terminal. Now that the two test directories are present, we need some files for Apache to serve. To create this new file, use the touch command. This command allows you to create a new empty file or even change a timestamp on a file or directory:.

Enable Apache on Mac OS X

After executing the above command, an empty index. However, an empty index. These commands tell nano to exit the file and to save to the current file name or, conversely you can press N when you want to close but do not want to save. Awesome, we have an index. Instead of manipulating files via Finder, below is a great example of where Terminal can afford you some greater flexibility. Next, go ahead and open the file with nano:. Our first task is to create a new configuration file that helps tell Apache where to serve content from.

This configuration file is actually your username on your Mac and ends with the. For example, I would have to create a file titled John.

Install and configure Apache, PHP and MySQL on Mac OS X 10.8 Mountain Lion

Now that you know your username, navigate to the directory where we need to place this new file. This allows us to navigate into and out of our current working directory to wherever we need to go. Next, lets create the username. If the file exists, nano will open the existing file, otherwise, nano will open a blank text editor and it will allow us to save this file in our current working directory as the specified file name.

As pointed out above in step 1, sudo is a special command that if used incorrectly or haphazardly, can damage and destroy system files. Please proceed with caution! Without going into too much detail on Linux file permissions, the three numbers places for , listed above, represent the following:. Owner Group Other. To change directories one level, you simply need to use this common shorthand coupled with the cd command: two periods instead of an actual directory name:. This may look familiar to some developers who have seen this used in paths for CSS or JavaScript files. To begin, use the cp command to copy and then add.

With the backup now stashed, we can focus our efforts on editing httpd. Open that file with nano:. Nano offers a search capability that makes for finding each line a little easier, as this file is rather lengthy.

Step 1: install Passenger package

Once you have searched for each line above and removed the prepending , save and close httpd. With the httpd. With the backup all set, open and edit httpd-userdir. Uncomment the following line, removing :. Upon clicking one of these folders, Apache then servers the contents of that folder, just like a typical web server.

Below are some optional steps to further enhance your local web development environment. Some developers may actually prefer having a local hostname per project instead of dealing with localhost. This will allow us to create local sites such as foo. First, create a backup of the default httpd-vhosts.

Installing Passenger + Apache on Mac OS X - Passenger Library

Once a backup is handy, clear out the contents of httpd-vhosts. After saving and closing the httpd-vhost. Note: be careful when dealing with this file. Add your changes to the bottom and do not change the first 3 lines! Your host file should appear similar to this when you first open it:. To keep things documented, add a comment identifying your changes to this file, just above the hostname entries for foo. Once added, save and close this file.

Before we can test out foo. Now go ahead and test both foo. Both sites should load and display their relevant index. With this working example in place, you can now see how powerful and flexibly local Virtual Hosts and local hostnames can be for your development efforts.

PHP is the server-side scripting language that pairs up rather nicely with Apache. In this file, we simply need to uncomment one line, by removing :.

With this module enabled once Apache is restarted , you can now serve any files with the. To do that, we need to make a change to the httpd-vhosts. Add this block of code to the very top of the file:. Your httpd-vhosts. After making these changes, restart Apache:.