Hi all,
I have my virtualmin server at fshlampserver.local
Before i created the first Virtual Server (manuscript.local) typing http://fshlampserver.local into a browser from a different machine on the lan correctly rendered the index.html page located at /var/www/index.html
After creating the VS manuscript.local when I type fshlampserver.local it renders the the index.html page located at /home/manuscript/public_html/index.html
Which is not exactly what I want. I suspect Virtualmin is set up by default with apache to do name-based hosting. So if a name cannot be found it should display the first virtual host listed.
Below is how virtualmin has configured apache
[code:1] NameVirtualHost * NameVirtualHost 192.168.1.56: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
</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> <VirtualHost 192.168.1.56:80> SuexecUserGroup "#1001" "#1002" ServerName manuscript.local ServerAlias www.manuscript.local ServerAlias webmail.manuscript.local ServerAlias admin.manuscript.local DocumentRoot /home/manuscript/public_html ErrorLog /var/log/virtualmin/manuscript.local_error_log CustomLog /var/log/virtualmin/manuscript.local_access_log combined ScriptAlias /cgi-bin/ /home/manuscript/cgi-bin/ ScriptAlias /awstats /home/manuscript/cgi-bin DirectoryIndex index.html index.htm index.php index.php4 index.php5 <Directory /home/manuscript/public_html> Options -Indexes IncludesNOEXEC FollowSymLinks allow from all AllowOverride All </Directory> <Directory /home/manuscript/cgi-bin> allow from all </Directory> RewriteEngine on RewriteCond %{HTTP_HOST} =webmail.manuscript.local RewriteRule ^(.) https://manuscript.local:20000/ [R] RewriteCond %{HTTP_HOST} =admin.manuscript.local RewriteRule ^(.) https://manuscript.local:10000/ [R] Alias /dav /home/manuscript/public_html <Location /dav> DAV On AuthType Basic AuthName manuscript.local AuthUserFile /home/manuscript/etc/dav.digest.passwd Require valid-user ForceType text/plain Satisfy All </Location> <Files awstats.pl> AuthName "manuscript.local statistics" AuthType Basic AuthUserFile /home/manuscript/.awstats-htpasswd require valid-user </Files> </VirtualHost> [/code:1]
If i type in fshlampserver.local or 192.168.1.56 I want it to render the page in /var/www which is the first virtual server definition ... but it's not doing that for some reason.
If I manually remove NameVirtualHost * and in the first Virtualhost definition change <VirtualHost *> to <VirtualHost 192.168.1.56> only then do I get the behaviour i would like.
But my problem is if I edit this configuration manually will it in anyway confound virtualmin when it comes to configuring apache thru the virtualmin interface. Or can I safely make the manual edit.
Also does the change actually make any sense.
Thanks.
Your manual change is correct.
Having the "NameVirtualHost *" setting in there will just cause problems, and getting rid of it now is the right thing to do :-)
-Eric