Fr3d
03-23-2010, 07:47 PM
I was replying to another thread (http://interworx.com/forums/showthread.php?t=3098), but then I had an idea (see end of post), so I posted it here to prevent it getting lost.
That's the way apache works. If you have more than one domain on a shared IP address and navigate to http://ip/, it will show the first virtualhost on that domain, specifically this will be the first domain that comes alphabetically. What would you prefer happen instead?
I created a file called a-default.conf in /etc/httpd/conf.d/ and added a <VirtualHost> block for each IP on my server.
(The filename isn't important, but Apache loads all the .conf files in that directory in alphabetical order... you just need to name it something that Apache will load before the file for the first domain.)
The result: http://78.129.202.211/ shows the "Apache 2 Test Page" instead of some user's domain :D
<VirtualHost 78.129.202.211:80>
DocumentRoot /var/www/html
ServerName your.awesome.server.tld
ServerAdmin root@localhost
</VirtualHost>
My idea/feature request:
Perhaps InterWorx could add something like this in a future version, with Vhost blocks added and removed when IP addresses are?
You could just show the default page for the server, show an IWorx splash page (similar to the SiteWorx "new account" page?), or even redirect visitors to a URL of the admin's choice.
And there could be a nice box on the NodeWorx HTTPd page to control all of that ;)
That's the way apache works. If you have more than one domain on a shared IP address and navigate to http://ip/, it will show the first virtualhost on that domain, specifically this will be the first domain that comes alphabetically. What would you prefer happen instead?
I created a file called a-default.conf in /etc/httpd/conf.d/ and added a <VirtualHost> block for each IP on my server.
(The filename isn't important, but Apache loads all the .conf files in that directory in alphabetical order... you just need to name it something that Apache will load before the file for the first domain.)
The result: http://78.129.202.211/ shows the "Apache 2 Test Page" instead of some user's domain :D
<VirtualHost 78.129.202.211:80>
DocumentRoot /var/www/html
ServerName your.awesome.server.tld
ServerAdmin root@localhost
</VirtualHost>
My idea/feature request:
Perhaps InterWorx could add something like this in a future version, with Vhost blocks added and removed when IP addresses are?
You could just show the default page for the server, show an IWorx splash page (similar to the SiteWorx "new account" page?), or even redirect visitors to a URL of the admin's choice.
And there could be a nice box on the NodeWorx HTTPd page to control all of that ;)