Server Help

Trash Talk - Apache VHost config

Solo Ace - Mon Sep 25, 2006 3:30 pm
Post subject: Apache VHost config
This is what I want to do, kind of:

Apache runs on 123.123.123.123 (port 80) with hostname toolonghostname.abc.isp.com.

I want http://123.123.123.123/ to open /var/www/default/, and
I want http://toolonghostname.abc.isp.com/ to open, also, /var/www/default/.

Now say I have a dns record somewhere which I want to use, like forums.dns.com.

I'd like http://forums.dns.com/ to open /var/www/forums.

So I want a VirtualHost setup like this:

Code: Show/Hide
http://123.123.123.123/ -> /var/www/default/
http://toolonghostname.abc.isp.com/ -> /var/www/default/

http://forums.dns.com/ -> /var/www/forums


I'm pretty sure this works like this on this (MGB's) server too.

http://server2a.woolnet.net/ AND http://64.91.230.181/ -> phpSysInfo
https://forums.minegoboom.com/ -> phpBB2
http://www.minegoboom.com/ -> Some weird page.

All of this, on one and the same server.

So, MGB, what's your secret? I really have no clue after trying everything.

Or, whoever can help me fixing this VHost config...
Mine GO BOOM - Mon Sep 25, 2006 5:31 pm
Post subject:
A simple google search of vhosts will tell you a bunch.
Code: Show/Hide
NameVirtualHost *:80

<VirtualHost *:80>
        ServerName 207.210.96.187

        DocumentRoot /var/www/phpsysinfo
        <Directory /var/www/phpsysinfo>
                Options FollowSymLinks
                AllowOverride None
        </Directory>
</VirtualHost>

<VirtualHost *:80>
        ServerName minegoboom.com
        ServerAlias www.minegoboom.com

        DocumentRoot /home/mgb/public_html
        <Directory /home/mgb/public_html>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>
</VirtualHost>

<VirtualHost *:80>
        ServerName www.forums.minegoboom.com
        Redirect / http://forums.minegoboom.com
</VirtualHost>

<VirtualHost *:80>
        ServerName forums.minegoboom.com

        DocumentRoot /home/mgb/public_html/forums
        <Directory /home/mgb/public_html/forums>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>
</VirtualHost>

Just an outline of all the good meat of the virtual hosts. Each of my subdomains are actually in their own seperate file and enabled/disabled very quickly. Pretty much how Debian's Apache2 package is installed.

Note that minegoboom.com is actually on the server2a.woolnet.net server while the forums are on mineplowers.com server, but the above configurations should outline exactly what you need.
Solo Ace - Mon Sep 25, 2006 5:44 pm
Post subject:
I see. It was just in the order it seems. Thanks, I spent like 5 hours on trying to get this fixed...
I know it sounds stupid because it's supposed to be very simple, but heh, maybe I just missed this version.

Thanks. icon_smile.gif I'm trying to get some "blackboards"-like system up for my school (Moodle).
And, well, maybe forums.

I hate some things about Debian (which I just ran into) now. But heh, I can finally do what I wanted to do now.
Doc Flabby - Mon Sep 25, 2006 5:58 pm
Post subject:
lol i use lighttpd its easier than apache tongue.gif
Solo Ace - Mon Sep 25, 2006 6:32 pm
Post subject:
So what? I know lighttpd is nice, but I'm not going to use something because it's 'easier' to configure.
D1st0rt - Tue Sep 26, 2006 1:15 am
Post subject:
We use Moodle (CS Department only) and Blackboard here, though there is a push to move off of BB since it's proprietary and apparently you can't just "get all of your documents that you've put on it" according to my CS prof.
CypherJF - Tue Sep 26, 2006 7:21 am
Post subject:
Blackboard does stink, we used it at my alma matter. It's funny being able to say that. icon_smile.gif
Doc Flabby - Tue Sep 26, 2006 7:23 am
Post subject:
Solo Ace wrote:
So what? I know lighttpd is nice, but I'm not going to use something because it's 'easier' to configure.

im lazy
easy=more time to do fun stuff less time spent configuring server biggrin.gif

lighttpd has a much smaller memory footprint and also pwns apache on perfomance (appently) This is the first time i have used it instead of apache i tried it and was surprised it took about 10 mins to set up all my sites to run off my server with php enabled.
Apache might be more suitible for what you are doing (I only need static and php files to be servered up).... but it does make some stuff that should be very simple stupidly complex.
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group