I finished reading through the rest of the chapters in the CouchDB book and decided to start moving forward with creating my application. CouchDB doesn’t really seem to be in a state where I could build the kind of app I want using only what they provide (it’s still in alpha, after all) but I do plan on using it to store all of my data. To handle all of the application logic I’m planning to use my old standby, PHP. I figure learning one new technology is enough for this. And for the server I’ll be using Apache.
Setting up Apache on Ubuntu is a bit different than on Windows. I had no issues installing Apache+PHP, and pulling up Firefox and pointing it at http://localhost/ yielded success. So I knew everything had installed correctly. However, at this point I didn’t know where to place all my html/css/etc. files. From my past experience on Windows I thought those files would be stored in an htdocs directory, so I tried searching for that. No luck. Turns out that Apache on Ubuntu sets up /var/www/ as your root directory for files. That’s all well and good, but only the administrator can modify files there, meaning you end up having to use sudo for everything. Not what I want.
I started looking for a way to change the root directory from /var/www/ to something else. I found a forum post stating that the file I needed to modify was at /etc/apache2/sites-available/ and called “default”. Using that, and Apache’s very good documentation on setting up url mapping, you can get a pretty good idea of what you need to do. I set the DocumentRoot to a directory of my choosing and modified the related Directory section.
But that wasn’t enough by itself, I also needed to restart the Apache server. Which was pretty easy on Windows (they give you shortcuts for it), but I had no idea how to do it on Ubuntu. Thankfully I found that info on a forum post too, and it’s pretty simple. You just need the following commands:
sudo /etc/init.d/apache2 stop
sudo /etc/init.d/apache2 start
or
sudo /etc/init.d/apache2 restart
0 Responses
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.