On Thu, May 31, 2012 at 3:56 AM, Craig Rosenblum <crosenblum at gmail.com> wrote:
> Now All i want is to setup http://localhost:8082 or any other unused port
> number to point to a new folder i have.

Okay, so first step there is to get apache to listen on port 8082. To
do that, add the following line to your apache2.conf file:

Listen 8082

Since you're going to be hosting multiple sites, you want to enable
name-based virtual hosting. I'm not certain how your distro does
thing, but it's likely that this is already enabled. You can likely
grep through the stock apache config to find this out:

Assuming that your apache config is in /etc/apache2

$ grep -R -i NameVirtualHost /etc/apache2

You should see a result similar to:

NameVirtualHost *:80

Edit the file that contains that line and add the following:

NameVirtualHost *:8082

Then all you need to do is start adding virtualhosts. How this works
depends on how your distribution organizes things. A quick google
should suffice to figure that out. The short version is that to add,
say, example.com to your apache config, you'll need to add the
following configuration:

<VirtualHost *:8082>
    ServerName example.com
    DocumentRoot /path/to/web/root

    # add the following two lines if you want vhost-specific logging
    ErrorLog /ver/log/apache2/example.com-error
    CustomLog /var/log/apache2/example.com-access combined
</VirtualHost>

Then restart apache, ensure that example.com is pointing to the IP
address of your server and away you go.

If you wanted to add a second virtual host, just add another stanza
like the above, only with different hostname, document root, and
logfile names.

> I have 3 partitions on my main hard drive, and in one of those partitions is
> a www folder, where i plan to keep all centralized websites that i ever
> worked on, or plan to work on.

This doesn't really have any bearing on apache configuration.

> I even install webmin, but I am more than a bit rusty on virtualhost setup.

Nooooooooo! While webmin/cpanel/ispconfig/etc. are very tempting for
new linux admins. You really really don't want to get in the habit of
using them. It's well worth learning how to configure things from the
ground up rather than make yourself beholden to a crutch that does it
for you.

> I really prefer not to have to add folders to /var/www because I want to
> keep my linux partition small.

Not sure what you're getting at here. You're going to have to add
folders as you add additional sites and additional content.

> Do i need to setup any special permissions for that www folder so that it
> can be accessed?

Yes, the files need to be readable by the user that apache is running
as. In debian derivatives, this is typically www-data.

-Erik