Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] virtual hosts jetty v9

Hello jetty users,

I need help setting up virtual hosts. I run jetty v9 within Smartfoxserver which is for game development. Currently I have 2 games. The structure looks like this:

/home/fo/SmartFoxServer_2X/SFS2X/www/root/index.html  is the index of game 1

/home/fo/SmartFoxServer_2X/SFS2X/www/jok/index.html  is the index of game 2

/home/fo/SmartFoxServer_2X/SFS2X/lib/jetty/  is the home directory of jetty

What I need to do is simply, if the user access the server via my public IP instead of the domain, serve him the index.html from game 2.

I created a context xml file in the directory

/home/fo/SmartFoxServer_2X/SFS2X/lib/jetty/webapps

The file contains:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
 
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
  <Set name="contextPath">/home/fo/SmartFoxServer_2X/SFS2X/www</Set>
  <Set name="resourceBase">/home/fo/SmartFoxServer_2X/SFS2X/www/jok/</Set>

 
  <Set name="virtualHosts">
    <Array type="java.lang.String">
      <Item>1.2.3.4</Item>
    </Array>
  </Set>
</Configure>

Unfortunately it doesn't work: if I type the IP I still get the index.html of game 1. Any help would be greatly appreciated.

Regards,

Frank

Back to the top