Forum

Using virtual Host without TLD

Edu
23 March 2015, 18:48
Hello

I'm trying to host several application in same server with one virtual host for every application.
But I succeed to make run only the application that have TLD.

Is there a limitation that virtual host will not work if I create a simple name?

Here is an example for phpmyadmin

123.16.13.123/phpmyadmin

This is not working
VirtualHost {
Hostname = phpmyadmin
WebsiteRoot = /var/www/phpmyadmin
StartFile = index.php
AccessLogfile = /var/www/phpmyadmin/access.log
ErrorLogfile = /var/www/phpmyadmin/error.log
TimeForCGI = 5
UseFastCGI = PHP5
EnablePathInfo = yes
}


This works fine
VirtualHost {
Hostname = ec2-XX-XX-XX-XXX.eu-west-1.compute.amazonaws.com (or my TLD)
WebsiteRoot = /var/www/phpmyadmin
StartFile = index.php
AccessLogfile = /var/www/phpmyadmin/access.log
ErrorLogfile = /var/www/phpmyadmin/error.log
TimeForCGI = 5
UseFastCGI = PHP5
EnablePathInfo = yes
}


Is possible to set a virtual host to something like ip address? 123.16.13.123/phpmyadmin


Hiawatha version: v9.12
Operating System: Linux Fedora 21
Hugo Leisink
23 March 2015, 18:55
Just use 123.16.13.123 as the hostname. You than have several options:

  • Set WebsiteRoot to /var/www, in which case phpmyadmin automaticly will work as a subdirectory.
  • Use a soft- / hardlink to /var/www/phpmyadmin.
  • Use the Alias opion to create a virtual directory which points to /var/www/phpmyadmin


Use a Directory section to set specify options for /var/www/phpmyadmin:
Directory {
Path = /var/www/phpmyadmin
TimeForCGI = 5
...
}
This topic has been closed.