Page 1 of 1

Help with virtual host in Apache

Posted: 29 Mar 2010, 08:35
by RandomUsername
Hi,

I'm trying to install davical and the recommended way of setting it up is as a virtual host.

I'm an Apache noob but I *think* I understand the whole concept of virtual hosts and I've read quite a bit about it but I'm hitting some stumbling blocks.

I've had Dynamic DNS set up for my Bubba with A name records for mydomain, http://www.mydomain which was working fine. So now I've also added davical.mydomain which is pinging back from my IP address OK.

The INSTALL file suggests a virtual host file like this with your own details filled in:
# Virtual Host def for Debian packaged DAViCal
<VirtualHost 123.4.56.78 >
DocumentRoot /usr/share/davical/htdocs
DirectoryIndex index.php index.html
ServerName davical.example.net
ServerAlias calendar.example.net
Alias /images/ /usr/share/davical/htdocs/images/
php_value include_path /usr/share/davical/inc:/usr/share/awl/inc
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value error_reporting "E_ALL & ~E_NOTICE"
php_value default_charset "utf-8"
</VirtualHost>
I've edited it to this (I don't want the IP address in there because I'm on a dynamic IP):
# Virtual Host def for Debian packaged DAViCal
<VirtualHost davical.mydomain >
DocumentRoot /usr/share/davical/htdocs
DirectoryIndex index.php index.html
ServerName davical.mydomain
ServerAlias calendar.mydomain
Alias /images/ /usr/share/davical/htdocs/images/
php_value include_path /usr/share/davical/inc:/usr/share/awl/inc
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value error_reporting "E_ALL & ~E_NOTICE"
php_value default_charset "utf-8"
</VirtualHost>
And put it in /etc/apache2/sites-enabled.

But, once I restart Apache browsing to davical.mydomain gives me a "server not found error". Also, when I browse to a page that previously worked that uses ssl such as https://mydomain/mail I get this error:
An error occurred during a connection to [my domain].

SSL received a record that exceeded the maximum permissible length.

(Error code: ssl_error_rx_record_too_long)
So something's a bit whack. Could anyone offer an idea as to what?

Thanks.

Re: Help with virtual host in Apache

Posted: 29 Mar 2010, 10:38
by RandomUsername
I may as well document my progress for future posterity.

Changing the V-hosts file to this:
# Virtual Host def for Debian packaged DAViCal
<VirtualHost mydomain >
DocumentRoot /usr/share/davical/htdocs
DirectoryIndex index.php index.html
ServerName davical
Alias /images/ /usr/share/davical/htdocs/images/
php_value include_path /usr/share/davical/inc:/usr/share/awl/inc
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value error_reporting "E_ALL & ~E_NOTICE"
php_value default_charset "utf-8"
</VirtualHost>
gets davical.mydomain working but I'm still seeing the SSL errors. Off to ask the mighty Google.

Re: Help with virtual host in Apache

Posted: 29 Mar 2010, 10:47
by RandomUsername
Fixed - yay me!
# Virtual Host def for Debian packaged DAViCal
<VirtualHost davical.mydomain:80 >
DocumentRoot /usr/share/davical/htdocs
DirectoryIndex index.php index.html
ServerName davical
Alias /images/ /usr/share/davical/htdocs/images/
php_value include_path /usr/share/davical/inc:/usr/share/awl/inc
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value error_reporting "E_ALL & ~E_NOTICE"
php_value default_charset "utf-8"
</VirtualHost>