How to install on a live domain

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

Post Reply
Soleil
Posts: 19
Joined: 06 Mar 2010, 06:24

How to install on a live domain

Post by Soleil »

Is there documentation for getting SmartFox running on a live server? I have done lots of testing locally and things are working. Now I want to put it online and test. I don't understand how SmartFox gets started when its on a live server and I can't start the server running myself.

Which files to I transfer to my domain, and what is the folder structure? How do I set up the config file (how do I know which ip to connect to)? And how does the server get started?

Thanks for your help. I am really leaning toward SmartFox now. I just need to get it up and running online and see how that works.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

I don't understand how SmartFox gets started when its on a live server and I can't start the server running myself.
It works the same exact way as it does locally.
You run the installer, edit the server settings and finally run it.

If your server has any firewalls or routers you might need to configure those as well. Here's a troubleshooting guide:
http://www.smartfoxserver.com/docs/docP ... ooting.htm
Lapo
--
gotoAndPlay()
...addicted to flash games
Soleil
Posts: 19
Joined: 06 Mar 2010, 06:24

Post by Soleil »

ok, here's what I did.

I connected to my host via ftp and uploaded all the contents of the /Server folder to www.mydomain.com/smartfoxtest/, and also uploaded my swf and html files to the same location.

And, it works, but only on the same computer where I have SmartFox running locally. I'm guessing this is because in my config.xml file I'm pointing to a local ip (<ip>127.0.0.1</ip>)
Do I need to change this to some public ip on my host?

Here's the error I get when try to access the site from another computer:

Code: Select all

Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: http://mydomain.com/smartfoxtest/Main.swf cannot load data from http://127.0.0.1:8080/BlueBox/HttpBox.do.
	at it.gotoandplay.smartfoxserver.http::LoaderFactory()[/Users/path/src/it/gotoandplay/smartfoxserver/http/LoaderFactory.as:32]
	at it.gotoandplay.smartfoxserver.http::HttpConnection()[/Users/path/src/it/gotoandplay/smartfoxserver/http/HttpConnection.as:47]
	at it.gotoandplay.smartfoxserver::SmartFoxClient()[/Users/path/src/it/gotoandplay/smartfoxserver/SmartFoxClient.as:607]
	at com.smartfoxtest::Main()[/Users/path/src/com/smartfoxtest/Main.as:68]
I will look into the security violation documents, but I think the ip in the config.xml is wrong. I don't want to run the server from my local machine, I want to run it on my web domain. Please confirm that I need to change it and how I might go about finding the ip that I should change it to.
Soleil
Posts: 19
Joined: 06 Mar 2010, 06:24

Post by Soleil »

I found out from my hosting service that my public ip is this (changing a couple numbers for anonymity):

http://74.220.512.011/~ccc/

So I tried putting this in the config.xml:

<ip>74.220.512.011</ip>

But it still doesn't work.

I also tried this:
<ip>74.220.512.011/~ccc/</ip>

but I get 404 not found:
http://74.220.512.011/~ccc/:8080/BlueBox/HttpBox.do


I also tried this:
<ip>74.220.512.011/~ccc/smartfoxtest/</ip>

Code: Select all

[ Send ]: sfsHttp=connect
Error opening URL 'http://74.220.512.011/~ccc/smartfoxtest/:8080/BlueBox/HttpBox.do'
HttpError
Connection failed!
Please help me figure this out. I'm desperate to get this working! What do I put for the IP in config.xml if my public ip is as above?
Soleil
Posts: 19
Joined: 06 Mar 2010, 06:24

Post by Soleil »

I determined that my server is running Linux 64bit, so I downloaded that version of SmartFox, uploaded it to my domain, logged in via SSH, and ran the installer:

Code: Select all

+-----------------------------------------------+
+                                               +
+ SmartFoxServer :: Linux Simple Installer      +
+ version 1.2.0 -- (c) 2004 -2006 gotoAndPlay() +
+                                               +
+-----------------------------------------------+

This program will install SmartFoxServer PRO 1.6.6
to a directory of your choice and configure it.

Please type the full path of the folder
where SmartFoxServer should be installed.
Example: /home/userName 

Installation folder > ./
Please hold on while installing... [============] 
-> Files copied.
-> Application configured.
-> Permissions set.

SmartFoxServer was succesfully installed and configured.
I get this when I try ./sfs start:

Code: Select all

Starting SmartFoxServer PRO...
Removed stale pid file: /home1/ccc/public_html/smartfoxtest/SmartFoxServer_PRO_1.6.6/Server/runAsService//SmartFoxServer.pid
 
How do I know if the server is running? I still can't connect:

Code: Select all

[ Send ]: sfsHttp=connect
Error opening URL 'http://74.220.512.011/~ccc/smartfoxtest/SmartFoxServer_PRO_1.6.6/Server/:8080/BlueBox/HttpBox.do'
HttpError
Connection failed!
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Hi,
Starting SmartFoxServer PRO...
Removed stale pid file: /home1/ccc/public_html/smartfoxtest/SmartFoxServer_PRO_1.6.6/Server/runAsService//SmartFoxServer.pid
This is nothing to worry about. Simply a previous pid file was found and removed.
How do I know if the server is running? I still can't connect:
Check the server logs! {your-sfs-folder}/Server/logs
Or alternatively run the server with
./sfs console
to see the output in the console and make sure that everything is fine. Then press CTRL+C and start the server normally.
Lapo
--
gotoAndPlay()
...addicted to flash games
Soleil
Posts: 19
Joined: 06 Mar 2010, 06:24

Post by Soleil »

Here's what I get:

Running SmartFoxServer PRO...
wrapper | --> Wrapper Started as Console
wrapper | Launching a JVM...
wrapper | JVM exited while loading the application.
jvm 1 | wrapper | Unable to start JVM: No such file or directory (2)

Not sure why it can't find the JVM -
"Since version 1.5 SmartFoxServer comes with its own x86 32-bit Sun Java Runtime."
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

I suggest to double check that your Linux is really a 32bit system.
Open a terminal and type this command:
uname -a
It should give you more details. If it says x86_64 or similar you will need to download the SFS version for 64bit
Lapo
--
gotoAndPlay()
...addicted to flash games
Soleil
Posts: 19
Joined: 06 Mar 2010, 06:24

Post by Soleil »

Like I mentioned up above, my server is 64bit Linux, and that is the SFS version I downloaded and installed.

Here is the result of uname -a:

Code: Select all

Linux host310.hostmonster.com 2.6.28-10.7.intel.IGB.BHsmp #1 SMP Thu Aug 13 21:52:24 MDT 2009 x86_64 x86_64 x86_64 GNU/Linux
Any other suggestions?
Rutter
Posts: 99
Joined: 12 Dec 2007, 16:21
Location: Canada
Contact:

Post by Rutter »

login via ssh
in the server folder type ./start.sh
to check if its running open the admin tool and login.
if its running logout and then back in and type

nohup ./start.sh

this will keep the server running after you logout


this has worked for me in my linux installs.
Soleil
Posts: 19
Joined: 06 Mar 2010, 06:24

Post by Soleil »

Here's what I get with ./start.sh:

Code: Select all

Exception in thread "main" java.lang.NoClassDefFoundError: java.util.concurrent.atomic.AtomicLong
   at it.gotoandplay.smartfoxserver.SmartFoxServer.<init>(SmartFoxServer.java:270)
   at it.gotoandplay.smartfoxserver.SmartFoxServer.main(SmartFoxServer.java:237)
me@mydomain.com [~/www/smartfoxtest/SmartFoxServer_PRO_1.6.6/Server]# 
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Sounds like you are not running the Sun Java Runtime but something else.
Make sure to download the JRE from the Sun (erhm.. Oracle) website.
http://java.sun.com/javase/downloads/index.jsp
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply