summaryrefslogtreecommitdiff
path: root/_posts/2008-12-25-apache-2-on-mac-os-x-leopard-10-5-issue-on-upgrade.markdown
diff options
context:
space:
mode:
authorJosé Mota <josemota.net@gmail.com>2012-04-26 23:40:52 +0100
committerJosé Mota <josemota.net@gmail.com>2012-04-26 23:40:52 +0100
commit9fbae00333632d1df9fa075fd580ac70e5dd88fd (patch)
tree9af6a7c0fb4822b0a70901bc7c608a80a8150e9e /_posts/2008-12-25-apache-2-on-mac-os-x-leopard-10-5-issue-on-upgrade.markdown
parentc9acd467e38fa267db5972de02a3615ff6998355 (diff)
Convert two posts to Markdown.
Diffstat (limited to '_posts/2008-12-25-apache-2-on-mac-os-x-leopard-10-5-issue-on-upgrade.markdown')
-rw-r--r--_posts/2008-12-25-apache-2-on-mac-os-x-leopard-10-5-issue-on-upgrade.markdown55
1 files changed, 55 insertions, 0 deletions
diff --git a/_posts/2008-12-25-apache-2-on-mac-os-x-leopard-10-5-issue-on-upgrade.markdown b/_posts/2008-12-25-apache-2-on-mac-os-x-leopard-10-5-issue-on-upgrade.markdown
new file mode 100644
index 0000000..51dc3fb
--- /dev/null
+++ b/_posts/2008-12-25-apache-2-on-mac-os-x-leopard-10-5-issue-on-upgrade.markdown
@@ -0,0 +1,55 @@
+---
+layout: post
+title: Apache 2 on Mac OS X Leopard 10.5 issue on upgrade
+tags: [ development, mac, leopard, apache ]
+published: true
+---
+
+This weekend I decided to arrange my hard drive in a way that I could have a
+5GB partition with sinful Windows XP to play some games with the family. To do
+that, I bought a 1TB external hard drive to use as a Time Machine backup for
+the process. At the time, my disk was already partitioned for Ubuntu but since
+I didn't find it useful anymore, I replaced it for Windows.
+
+Well, the good thing is I can actually play some old games like Empire Earth
+and Counter-Strike with the cousins to have some fun. The bad news is my Apache
+server settings screwed up. Two things happened.
+
+_Number one:_ `http://localhost/~user` was thrown a `403 Forbidden` access.
+This problem is the result of the user configurations for the server whilst the
+reinstallation / upgrade of the system, they don't exist now. What you have to
+do is very simple. Go to /private/etc/apache2/users and create a file
+`yourshortusername.conf` and type this:
+
+{% highlight apache %}
+<Directory "/Users/shortusername/Sites/">
+Options Indexes MultiViews
+AllowOverride None
+Order allow,deny
+Allow from all
+</Directory>
+{% endhighlight %}
+
+Restart your server and you're ready to go!
+
+Number two: My virtual hosts blew away. I should have kept a record on how to
+do this in case I had to a reinstallation, I guess I can kick myself now. (I'm
+solving this as I write this post :P) Three steps:
+
+* Go to `/private/etc/hosts` and say you want to assign 127.0.0.1 to your alias,
+ like this: `127.0.0.1 youralias`
+* Go to `/private/etc/apache2` and uncomment the line that includes the virtual
+ hosts configuration file. If you want to use PHP, you might want to uncomment
+ the line that includes it as well.
+* Finally, go to `/private/etc/apache2/extra` and edit the `httpd-vhosts.conf`
+ mentioned on 2. and add this chunk of code:
+
+{% highlight apache %}
+<VirtualHost 127.0.0.1>
+DocumentRoot "/path/to/your/site/"
+ServerAlias yoursitename
+ServerName yoursitename
+</VirtualHost>
+{% endhighlight %}
+
+Restart your server and virtual hosts are up and running.