michaelsanford
Translator, Web Developer
I wouldn't have assumed this woudl present any problems, but it has, to no end in fact.
I have my Slackware machine behind a NAT, natting http and ftp to it. I also have a residential ADSL with a dynamic IP, so I use no-ip.org's service to bind to
sonia.bounceme.net (trying to set up a web site for a friend)
michaelsanford.myvnc.com (my stuff)
trogdor.myvnc.com (legacy server name getting migrated to above)
They all, of course, point to the same machine. I also have wildcards enabled on the DNS, which means that I can prefix the subdomain with another subdomain, like blog.sonia.bounecme.net and it will resolve to me and pass that as the host string for processing.
Now for some code:
/etc/hosts
# For loopbacking.
127.0.0.1 localhost
#127.0.0.1 trogdor.local trogdor
127.0.0.1 michaelsanford.myvnc.com sonia.bounceme.net michaelsanford trogdor
[root@0 ~]# cat /etc/HOSTNAME
michaelsanford.myvnc.com
Ok so the server knows itself primarily as michaelsanford.myvnc.com and the login prompts "michaelsanford login: ". I've also added "michaelsanford" as its host name in my router (since the rest just didn't fit).
Now, for httpd.conf
Section 3
NameVirtualHost *:80
# Main Host
<VirtualHost *:80>
ServerName michaelsanford.myvnc.com
ServerAdmin trogdor_at_michaelsanford.com
ServerAlias *.michaelsanford.myvnc.com michaelsanford.myvnc.com
DocumentRoot /var/www/htdocs
ErrorLog /var/log/apache/michaelsanford_error_log
CustomLog /var/log/apache/michaelsanford_access_log common
</VirtualHost>
# Sonia's Host
<VirtualHost sonia.bounceme.net:80>
ServerName sonia.bounceme.net
ServerAdmin trogdor_at_michaelsanford.com
ServerAlias *.sonia.bounceme.net sonia.bounceme.net
DocumentRoot /home/sonia/public_html
#BindAddress sonia.bounceme.net
ErrorLog /home/sonia/logs/sonia_error-log
CustomLog /home/sonia/logs/sonia_access-log common
Options -Indexes +ExecCGI
</VirtualHost>
[root@0 ~]# httpd -S
VirtualHost configuration:
70.48.55.177:80 sonia.bounceme.net (/etc/apache/httpd.conf:1029)
wildcard NameVirtualHosts and _default_ servers:
*:80 is a NameVirtualHost
default server michaelsanford.myvnc.com (/etc/apache/httpd.conf:1019)
port 80 namevhost michaelsanford.myvnc.com (/etc/apache/httpd.conf:1019)
[root@0 ~]# apachectl start
/usr/sbin/apachectl start: httpd could not be started
Any ideas ? If anyone has virtual hosting working and feels like sending me their httpd.conf so I can compare I would be eternally indebted.
I have my Slackware machine behind a NAT, natting http and ftp to it. I also have a residential ADSL with a dynamic IP, so I use no-ip.org's service to bind to
sonia.bounceme.net (trying to set up a web site for a friend)
michaelsanford.myvnc.com (my stuff)
trogdor.myvnc.com (legacy server name getting migrated to above)
They all, of course, point to the same machine. I also have wildcards enabled on the DNS, which means that I can prefix the subdomain with another subdomain, like blog.sonia.bounecme.net and it will resolve to me and pass that as the host string for processing.
Now for some code:
/etc/hosts
# For loopbacking.
127.0.0.1 localhost
#127.0.0.1 trogdor.local trogdor
127.0.0.1 michaelsanford.myvnc.com sonia.bounceme.net michaelsanford trogdor
[root@0 ~]# cat /etc/HOSTNAME
michaelsanford.myvnc.com
Ok so the server knows itself primarily as michaelsanford.myvnc.com and the login prompts "michaelsanford login: ". I've also added "michaelsanford" as its host name in my router (since the rest just didn't fit).
Now, for httpd.conf
Section 3
NameVirtualHost *:80
# Main Host
<VirtualHost *:80>
ServerName michaelsanford.myvnc.com
ServerAdmin trogdor_at_michaelsanford.com
ServerAlias *.michaelsanford.myvnc.com michaelsanford.myvnc.com
DocumentRoot /var/www/htdocs
ErrorLog /var/log/apache/michaelsanford_error_log
CustomLog /var/log/apache/michaelsanford_access_log common
</VirtualHost>
# Sonia's Host
<VirtualHost sonia.bounceme.net:80>
ServerName sonia.bounceme.net
ServerAdmin trogdor_at_michaelsanford.com
ServerAlias *.sonia.bounceme.net sonia.bounceme.net
DocumentRoot /home/sonia/public_html
#BindAddress sonia.bounceme.net
ErrorLog /home/sonia/logs/sonia_error-log
CustomLog /home/sonia/logs/sonia_access-log common
Options -Indexes +ExecCGI
</VirtualHost>
[root@0 ~]# httpd -S
VirtualHost configuration:
70.48.55.177:80 sonia.bounceme.net (/etc/apache/httpd.conf:1029)
wildcard NameVirtualHosts and _default_ servers:
*:80 is a NameVirtualHost
default server michaelsanford.myvnc.com (/etc/apache/httpd.conf:1019)
port 80 namevhost michaelsanford.myvnc.com (/etc/apache/httpd.conf:1019)
[root@0 ~]# apachectl start
/usr/sbin/apachectl start: httpd could not be started
Any ideas ? If anyone has virtual hosting working and feels like sending me their httpd.conf so I can compare I would be eternally indebted.