name based hosting

15 posts / 0 new
Last post
#1 Wed, 11/26/2008 - 13:54
Hardwarewizard

name based hosting

i have setup virtulmin on etchnhalf using the install script.

the setup installs just fine but when i create virtual servers i can only get the the first site based on alphabetical order.

i have read the faq's and nothing in them solves this problem.

i am looking for any suggestions for what could cause this problem.

Wed, 11/26/2008 - 14:09
Joe
Joe's picture

This is covered in the troubleshooting guide here:

http://www.virtualmin.com/documentation/id,troubleshooting_common_proble...

It's probably that you've got your NameVirtualHost and VirtualHost addresses botched. This is often the case when people try to use * for the IP address in Virtualmin, though there are a number of others ways to get this result.

--

Check out the forum guidelines!

Sun, 06/07/2009 - 07:32 (Reply to #2)
Hardwarewizard

i have read that. to to be honest i found it vague as how to which config file to check to see if this is the problem

as i used the install script i would have to say it has a possible error as it install with no intervention on my part, but i could be wrong.

this is a typical conf as configured by virtualmin

<VirtualHost 192.168.0.96:80>
SuexecUserGroup "#1002" "#1003"
ServerName princereunion.com
ServerAlias www.princereunion.com
ServerAlias webmail.princereunion.com
ServerAlias admin.princereunion.com
ServerAlias lists.princereunion.com
DocumentRoot /home/princereunion/public_html
ErrorLog /home/princereunion/logs/error_log
CustomLog /home/princereunion/logs/access_log combined
ScriptAlias /cgi-bin/ /home/princereunion/cgi-bin/
ScriptAlias /awstats /home/princereunion/cgi-bin
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/princereunion/public_html>
Options -Indexes IncludesNOEXEC FollowSymLinks
allow from all
AllowOverride All
</Directory>
<Directory /home/princereunion/cgi-bin>
allow from all
</Directory>
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.princereunion.com
RewriteRule ^(.*) https://princereunion.com:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.princereunion.com
RewriteRule ^(.*) https://princereunion.com:10000/ [R]
<Files awstats.pl>
AuthName "princereunion.com statistics"
AuthType Basic
AuthUserFile /home/princereunion/.awstats-htpasswd
require valid-user
</Files>
Alias /dav /home/princereunion/public_html
Alias /pipermail /var/lib/mailman/archives/public
<Location /dav>
DAV On
AuthType Basic
AuthName princereunion.com
AuthUserFile /home/princereunion/etc/dav.digest.passwd
Require valid-user
ForceType text/plain
Satisfy All
</Location>
RedirectMatch /cgi-bin/mailman/([^/]*)(.*) https://princereunion.com:10000/virtualmin-mailman/unauthenticated/$1.cgi$2
RedirectMatch /mailman/([^/]*)(.*) https://princereunion.com:10000/virtualmin-mailman/unauthenticated/$1.cgi$2
</VirtualHost>

Wed, 11/26/2008 - 16:33 (Reply to #3)
Hardwarewizard

NameVirtualHost *
NameVirtualHost 192.168.0.96:80
<VirtualHost *>
ServerAdmin webmaster@localhost

DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
RedirectMatch ^/$ /apache2-default/
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined
ServerSignature On

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

</VirtualHost>

Wed, 11/26/2008 - 17:59 (Reply to #4)
Joe
Joe's picture

<div class='quote'>NameVirtualHost *</div>

That's what I was talking about above. Get rid of that line. It makes no sense in a virtual hosting environment.

--

Check out the forum guidelines!

Thu, 11/27/2008 - 04:11 (Reply to #5)
Hardwarewizard

ok got rid of that line and i have the same effect it goes to the first site only.

also why by default does virtual min add that line in the first place??

Thu, 11/27/2008 - 05:44 (Reply to #6)
andreychek

I think you may want to change &quot;&lt;VirtualHost *&gt;&quot; to &quot;&lt;VirtualHost 192.168.0.96:80&gt;&quot;.

Also, after you change all that, make sure you restart Apache.
-Eric

Thu, 11/27/2008 - 14:15 (Reply to #7)
Joe
Joe's picture

<div class='quote'>also why by default does virtual min add that line in the first place?? </div>

It doesn't. ;-)

--

Check out the forum guidelines!

Thu, 11/27/2008 - 09:50 (Reply to #8)
Hardwarewizard

here is where i stand now

i did as you both selected the first site comes up the 2nd site displays the apache2-default page.

btw thanks for your help and patience

Thu, 11/27/2008 - 14:27 (Reply to #9)
Hardwarewizard

ok what part of the does put it in? as i didn't.

what else can i check to get my server to go to that correct site.

i have reinstalled debian and webmin/virtualmin using the script. same problem

i have also tried ispconfig and it worked fine just not how i want it setup.

so basically i'm still lost

Fri, 11/28/2008 - 08:53 (Reply to #10)
andreychek

What does the Apache configuration look like for the second site again?
-Eric

Sun, 06/07/2009 - 07:32 (Reply to #11)
Hardwarewizard

&lt;VirtualHost 192.168.0.96:80&gt;
SuexecUserGroup &quot;#1002&quot; &quot;#1003&quot;
ServerName wizardhardware.com
ServerAlias www.wizardhardware.com
ServerAlias webmail.wizardhardware.com
ServerAlias admin.wizardhardware.com
ServerAlias lists.wizardhardware.com
DocumentRoot /home/wizardhardware/public_html
ErrorLog /home/wizardhardware/logs/error_log
CustomLog /home/wizardhardware/logs/access_log combined
ScriptAlias /cgi-bin/ /home/wizardhardware/cgi-bin/
ScriptAlias /awstats /home/wizardhardware/cgi-bin
DirectoryIndex index.html index.htm index.php index.php4 index.php5
&lt;Directory /home/wizardhardware/public_html&gt;
Options -Indexes IncludesNOEXEC FollowSymLinks
allow from all
AllowOverride All
&lt;/Directory&gt;
&lt;Directory /home/wizardhardware/cgi-bin&gt;
allow from all
&lt;/Directory&gt;
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.wizardhardware.com
RewriteRule ^(.*) https://wizardhardware.com:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.wizardhardware.com
RewriteRule ^(.*) https://wizardhardware.com:10000/ [R]
Alias /dav /home/wizardhardware/public_html
Alias /pipermail /var/lib/mailman/archives/public
&lt;Location /dav&gt;
DAV On
AuthType Basic
AuthName wizardhardware.com
AuthUserFile /home/wizardhardware/etc/dav.digest.passwd
Require valid-user
ForceType text/plain
Satisfy All
&lt;/Location&gt;
&lt;Files awstats.pl&gt;
AuthName &quot;wizardhardware.com statistics&quot;
AuthType Basic
AuthUserFile /home/wizardhardware/.awstats-htpasswd
require valid-user
&lt;/Files&gt;
RedirectMatch /cgi-bin/mailman/([^/]*)(.*) https://wizardhardware.com:10000/virtualmin-mailman/unauthenticated/$1.cgi$2
RedirectMatch /mailman/([^/]*)(.*) https://wizardhardware.com:10000/virtualmin-mailman/unauthenticated/$1.cgi$2
&lt;/VirtualHost&gt;

Fri, 11/28/2008 - 09:52 (Reply to #12)
Hardwarewizard

BTW right after installing virtualmin

the default file starts with:

<b>[color=#0000FF]NameVirtualHost *
&lt;VirtualHost *&gt;[/color]</b>

after createing the first server it changes to

<b>[color=#0000FF]NameVirtualHost *
NameVirtualHost 192.168.0.96:80
&lt;VirtualHost *&gt;[/color]</b>

Fri, 11/28/2008 - 19:55 (Reply to #13)
Joe
Joe's picture

<div class='quote'>BTW right after installing virtualmin

the default file starts with:

NameVirtualHost *
&lt;VirtualHost *&gt;
</div>

What OS are you running?

--

Check out the forum guidelines!

Sat, 11/29/2008 - 04:07
Hardwarewizard

i'm running Debian etchnhalf

i also finally figured out why i was having a problem

i had to add

ServerAlias wizardhardware.com

to the configs and all started working why i don't understand

Topic locked