• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Run Two Servers On Same Computer (++rep if help!)

Bacheer

New Member
Joined
Jun 18, 2009
Messages
246
Reaction score
0
Location
Sweden
Hello otlanders,

I need to know step by step of how to create 2 diffrent servers with diffrent Sites on same computer...

Etc. and General info etc.

- Server1: Real map server with real-tibia layout with ip "Domain1.net"
- Server2: Custom map server with custom layout with ip "Domain2.net"

- Server1:
IP: Domain1.net
Port: 7171
Site: Domain1.net

-Server2:
IP: Domain2.net
Port: 7171
Site: Domain2.net

Question:
How to do that and what to change in files, please tell!

++Rep if help!

Best Regards,
Bacheer
 
Config.lua of domain 1
edit:
Lua:
	worldId = 0
	ip = "domain1.net"
	loginPort = 7171
	gamePort = 7172 
	adminPort = 7171
	statusPort = 7171

Config.lua of domain 2
edit:
Lua:
	worldId = 1
	ip = "domain2.net"
	loginPort = 7171
	gamePort = 7172 
	adminPort = 7171
	statusPort = 7171
 
Server 1: (7171)
Lua:
worldId = 0
	ip = "188.126.223.74" <---- your global IP, numberic!
	loginPort = 7171
	gamePort = 7172 
	adminPort = 7171
	statusPort = 7171

Server 2: (7181)
Lua:
worldId = 1
	ip = "188.126.223.74" <---- your global IP, numberic!
	loginPort = 7181
	gamePort = 7182 
	adminPort = 7181
	statusPort = 7181

Now enter http://127.0.0.1/apanel

Click on "Admin Virtual Host"
n2ldac.png


Fill the name box with your domain name.

Fill the path box with C:/UniServer/www/domain1 <--- ending with the domain name.

Click "Create VHost", just leave the last window blank.
Then it will automatically set up that domain to connect to the C:/UniServer/www/domain1 folder.

Do the same with domain 2.

Then turn off apache
wait 5 sec
turn on apache.

Now, when you enter with your domain name, you will get directly to the folder that has the same domain name.

This way, you can host several sites using same IP. Separating it with the domains.

Example from me, all my websites are running through same IP atm:
root: http://188.126.223.74/

1st OT: Theosia OT
2nd OT: Customera OT
3rd OT: Zanteria OT
4th OT: Serenity OT.

If you use XAMPP, for several reasons. Delete it, get rid of the crap.
And follow my Uniform Server tutorial here: http://otland.net/f479/nothing-full...niform-server-forgotten-server-0-3-6-a-77593/

:ninja:

Though, if you use Debian or ubuntu server using lighttpd:

First create a directory for each domain:

Code:
# mkdir -p /home/lighttpd/nixcraft.com/http
# mkdir -p /home/lighttpd/theos.in/http
# chown lighttpd:ftpuser1 /home/lighttpd/nixcraft.com/http
# chown lighttpd:ftpuser2 /home/lighttpd/theos.in/http

Replace ftpuser1 and 2 with actual ftp username.

Also create a log directory for each domain:
Code:
# mkdir /var/log/lighttpd/nixcraft.com
# mkdir /var/log/lighttpd/theos.in

Only allow a web server to access our logs:
Code:
# chown -R lighttpd:lighttpd /var/log/lighttpd

Open lighttpd configuration file:
Code:
# vi /etc/lighttpd/lighttpd.conf

Add support for domain nixcraft.com:
Code:
$HTTP["host"] =~ "(^|\.)nixcraft\.com$" {
server.document-root = "/home/lighttpd/nixcraft.com/http"
server.errorlog = "/var/log/lighttpd/nixcraft/error.log"
accesslog.filename = "/var/log/lighttpd/nixcraft/access.log"
server.error-handler-404 = "/e404.php"
}

Add support for domain theos.in:
Code:
$HTTP["host"] =~ "(^|\.)theos\.in$" {
server.document-root = "/home/lighttpd/theos.in/http"
server.errorlog = "/var/log/lighttpd/theos.in/error.log"
accesslog.filename = "/var/log/lighttpd/theos.in/access.log"
server.error-handler-404 = "/e404.php"
}

Restart lighttpd or do a sudo reboot and it should be working fine.

Linux part taken from http://www.cyberciti.biz/tips/howto-lighttpd-web-server-setting-up-virtual-hosting.html
 
Last edited:
When i do this first...
Config.lua of domain 1
edit:
Lua:
	worldId = 0
	ip = "domain1.net"
	loginPort = 7171
	gamePort = 7172 
	adminPort = 7171
	statusPort = 7171

Config.lua of domain 2
edit:
Lua:
	worldId = 1
	ip = "domain2.net"
	loginPort = 7171
	gamePort = 7172 
	adminPort = 7171
	statusPort = 7171

And i wrote "iptables -A INPUT -p tcp --dport 7173 -j ACCEPT"

I get this error in terminal :S, please help!

The error:
theforgottenserver: /usr/include/boost/thread/pthread/condition_variable_fwd.hpp:38: boost::condition_variable::~condition_variable(): Assertion `!pthread_cond_destroy(&cond)' failed.
Avbruten (SIGABRT)
 
Last edited:
change

loginPort = 7171
gamePort = 7172
adminPort = 7171
statusPort = 7171
to

loginPort = 7172
gamePort = 7173
adminPort = 7172
statusPort = 7172

Also check in the xml folder it should be something in there about multiworld. Good luck!
 
change

loginPort = 7171
gamePort = 7172
adminPort = 7171
statusPort = 7171
to

loginPort = 7172
gamePort = 7173
adminPort = 7172
statusPort = 7172

Also check in the xml folder it should be something in there about multiworld. Good luck!

I don't want multiworld.. i want multi servers on diffrent ports.. And im on linux.. so i don't get whats wrong :S

I've typed "iptables -A INPUT -p tcp -d 0/0 -s 0/0 --dport 7181 -j ACCEPT" (also 7182) IN terminal... and also forwarded the ports on the router.

But stil i can't enter the game even if the server is online :O

This is my settings in config:
loginPort = 7181
gamePort = 7182
adminPort = 7181
statusPort = 7181
 
I've got the same problem. I can't log in to game. But there is a character list. It happens to second server when I try to run two. My server is running on Linux.
 
Back
Top