LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Apache configuration (https://www.linuxquestions.org/questions/linux-newbie-8/apache-configuration-209622/)

snurckle 07-25-2004 08:35 PM

Apache configuration
 
I am trying to set up a virtual domain, my regular domain is- <snurckle.net>
virtual domain is- <scyllachat.com> (StarWarsGalaxies gaming site)



I've got the <myvirtualdomain> working, no issues.

But I'm trying to set up- forum.<.myvirtualdomain.>com to go to a different directory, however when I do-

ServerName www or forum.scyllachat.com

it only recognizes the first 'set' in the httpd.conf file.

What is the proper way to point it to a different directory??

btmiller 07-25-2004 09:04 PM

I'm not quite sure exactly what your setup is, but I usually do this with multiple virtusl hosts, so for example I would have:

Code:

<VirtualHost *>
  ServerName something1.example.com
  ServerAlias something2.example.com
  DocumentRoot /www/htdocs/example/adir
  # -- other stuff -- #
</VirtualHost>

<VirtualHost *>
  ServerName something3.example.com
  ServerAlias something4.example.com
  DocumentRoot /www/htdocs/example/anotherdir
  # -- other stuff -- #
</VirtualHost>

This makes something1.example.com and something2.example.com point to adir as the document root and something3 and something4 point anotherdir. Hopefully this is something like what you're trying to do...

snurckle 07-25-2004 09:34 PM

Quote:

Originally posted by btmiller
I'm not quite sure exactly what your setup is, but I usually do this with multiple virtusl hosts, so for example I would have:

Code:

<VirtualHost *>
  ServerName something1.example.com
  ServerAlias something2.example.com
  DocumentRoot /www/htdocs/example/adir
  # -- other stuff -- #
</VirtualHost>

<VirtualHost *>
  ServerName something3.example.com
  ServerAlias something4.example.com
  DocumentRoot /www/htdocs/example/anotherdir
  # -- other stuff -- #
</VirtualHost>

This makes something1.example.com and something2.example.com point to adir as the document root and something3 and something4 point anotherdir. Hopefully this is something like what you're trying to do...

Thanks, but I think I'm trying to do something a little different than this.

<VirtualHost *>
ServerName www.scyllachat.com
ServerAdmin john@snurckle.net
DocumentRoot /var/www/vhosts/scylla/html
ErrorLog /var/log/httpd/scylla/error_log
CustomLog /var/log/httpd/scylla/access_log common
</VirtualHost>

<VirtualHost *>
ServerAdmin john@snurckle.net
DocumentRoot /var/www/vhosts/scylla/html/forum
ServerName forum.scyllachat.com
ErrorLog /var/log/httpd/scylla/error_log_forum
CustomLog /var/log/httpd/scylla/access_log_forum common
</VirtualHost>


As you can see, both virtualhost have the same domain name, but I'm trying to kick one of them (forum) to another DocumentRoot directory.

Any ideas?

btmiller 07-25-2004 10:00 PM

In my example all of the virtual hosts use the example.com domain -- it looks to me like what you have in your post is correct and ought to work. If it's not, firstly make sure you haven't made any typos and make sure you don't have any conflicting ServerAlias directories somewhere else.. It looks like you're pointing to a forum so if it uses CGI scripts, make sure your ScriptAlias is set correctly. I know this works because I have miller.webjudge.net and hosting.webjudge.net running on the same server and this is how I have it set up.

snurckle 07-25-2004 10:06 PM

Well, I haven't added the 'forum' yet, just an index.html file that basically says 'testing index.html' in it.

I'm wondering if I shouldn't make forum.xxx.com 'ip based' and not a 'name based' domain.

I'd rather not do that, but when you go to

forum.xxx.com it sends you to www.xxx.com, and not where I have the DocumentRoot pointing to.

Perhaps this is a DNS problem. I can always change DNS to www and forum and make them two seperate DB's but it seems the way I have it set is correct.

I really appreciate your help.


All times are GMT -5. The time now is 11:26 PM.