Is there any way to add a "local" virtualhost and restrict it for local access only ?
I tried to copy the domain config to vhost.conf and vhost_ssl.conf and changed the public IP within the Virtualhost container to 127.0.0.1, but that results in an error when try to reconfigure:
Maybe a bit of explanation:
My server was delivered with a auto-generated hostname like "lvps....".
I am running the same board software like this site here, XenForo.
XenForo has an Autolink option, that replaces raw links with the name of the linked page.
For a long time everything went well, I only had some problems with some free mailers like freenet.de . e-mails where rejected with "450 4.7.1 Client host rejected: cannot find your hostname, [12.34.567.890] (in reply to RCPT TO command)".
According to some articles on the internet and a KB doc in my provider's support area, I changed the hostname to the domain name.
The e-mail rejections are gone, but now XenForo's Autolink function doesn't work anymore for internal URL's. External URL's are still handled without any problems.
My internal statistics script also stopped working. This script uses curl to get the index.php. Now curl returns "curl: (35) error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol" when I try to connect to the domain.
I assume that this is a result of the name change. The domain is now an alias of localhost in /etc/host, but the domain's virtualhost is bind to the public IP. Everytime, Xenforo and curl try to connect to the domain, they don't do it over the Internet on the public IP, but internally. The SSL certificate is only valid for the domain, therefore connection are refused.
Somewhere on the internet I found a thread, where some guy had the same problem. His solution was:
Any help would be much appreciated.
I tried to copy the domain config to vhost.conf and vhost_ssl.conf and changed the public IP within the Virtualhost container to 127.0.0.1, but that results in an error when try to reconfigure:
Syntax error on line 3 of /var/www/vhosts/domain.tld/conf/vhost.conf:
<VirtualHost> cannot occur within <VirtualHost> section
Maybe a bit of explanation:
My server was delivered with a auto-generated hostname like "lvps....".
I am running the same board software like this site here, XenForo.
XenForo has an Autolink option, that replaces raw links with the name of the linked page.
For a long time everything went well, I only had some problems with some free mailers like freenet.de . e-mails where rejected with "450 4.7.1 Client host rejected: cannot find your hostname, [12.34.567.890] (in reply to RCPT TO command)".
According to some articles on the internet and a KB doc in my provider's support area, I changed the hostname to the domain name.
The e-mail rejections are gone, but now XenForo's Autolink function doesn't work anymore for internal URL's. External URL's are still handled without any problems.
My internal statistics script also stopped working. This script uses curl to get the index.php. Now curl returns "curl: (35) error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol" when I try to connect to the domain.
I assume that this is a result of the name change. The domain is now an alias of localhost in /etc/host, but the domain's virtualhost is bind to the public IP. Everytime, Xenforo and curl try to connect to the domain, they don't do it over the Internet on the public IP, but internally. The SSL certificate is only valid for the domain, therefore connection are refused.
Somewhere on the internet I found a thread, where some guy had the same problem. His solution was:
Unfortunately he did not describe how he created the new local Virtualhost.The Virtual Host was bound to the external interface, and curl was trying to connect over localhost. So it never ended up at the configured virtual host.
To fix this, I have created a new VirtualHost entry bound to 127.0.0.1:80 that only allows connections from localhost. For my purposes, that is enough.
Any help would be much appreciated.