rejetto forum

Software => HFS ~ HTTP File Server => Topic started by: dragon_ex on June 13, 2010, 09:24:38 AM

Title: I used AppToService to make hfs.exe run as a service. I cannot access hfs site
Post by: dragon_ex on June 13, 2010, 09:24:38 AM
I used AppToService to make hfs.exe run as a service. I have done this job successfully.

A service named "ApptoService hfs" runned correctly. See the image below:
(http://www.rejetto.com/forum/index.php?action=dlattach;topic=8654.0;attach=5313;image)

and I've checked the TASKMANAGER , the hfs.exe was runned correctly by the service "ApptoService hfs".
(http://www.rejetto.com/forum/index.php?action=dlattach;topic=8654.0;attach=5315;image)

So, I typed the URL of my HFS Site  http://10.0.255.5:8888  in IE . ( I had changed the TCP port to 8888 early)

Failed! I cannot access the web site.

How can I solve the problem?
Title: Re: I used AppToService to make hfs.exe run as a service. I cannot access hfs site
Post by: Mars on June 13, 2010, 12:42:01 PM
localy you have to use the url http://127.0.0.1:8888
Title: Re: I used AppToService to make hfs.exe run as a service. I cannot access hfs site
Post by: rejetto on June 15, 2010, 10:56:09 AM
since you cannot see the HFS window while it is running as a service, use a program like this to see the port it is actually listening to
http://technet.microsoft.com/en-us/sysinternals/bb897437.aspx
Title: Re: I used AppToService to make hfs.exe run as a service. I cannot access hfs site
Post by: dragon_ex on June 17, 2010, 01:09:41 AM
localy you have to use the url http://127.0.0.1:8888

No. I tried to access hfs website on a client in a LAN, not on the server.
Title: Re: I used AppToService to make hfs.exe run as a service. I cannot access hfs site
Post by: dragon_ex on June 17, 2010, 01:52:59 AM
since you cannot see the HFS window while it is running as a service, use a program like this to see the port it is actually listening to
http://technet.microsoft.com/en-us/sysinternals/bb897437.aspx


I have tried the tool you suggested, But I find no program with port 8888 listening in the tool.


But in the TASKMANAGER , I indeed saw that hfs.exe was running in backgroud.


By the way,I tried an experiment like below:

With the hfs.exe running in backgroud, I manually double clicked the hfs.exe to run it.
And then, there were two hfs.exe running ,which was showed in the TASKMANAGER window. the one was started by the "ApptoServerice hfs" service ,and the other one was started by myself manually just then.
In this condition, I can access the hfs website on client in LAN with URL 10.0.255.5:8888

It seemed that the hfs.exe which was started by the  "ApptoServerice hfs" service did not work correctly,while the one I started manually had taken effect.

What should I do now?
Title: Re: I used AppToService to make hfs.exe run as a service. I cannot access hfs site
Post by: maverick on June 17, 2010, 08:58:29 AM
Sounds to me like you have something blocking access to app2service hfs and port 8888 on your computer system.

Check your firewall settings and make sure to allow access to hfs on port 8888 when using app2service.  Check other computer applications that run in the background on your system to make sure access isn't blocked to that port.
Title: Re: I used AppToService to make hfs.exe run as a service. I cannot access hfs site
Post by: dragon_ex on June 21, 2010, 03:50:19 AM
Sounds to me like you have something blocking access to app2service hfs and port 8888 on your computer system.

Check your firewall settings and make sure to allow access to hfs on port 8888 when using app2service.  Check other computer applications that run in the background on your system to make sure access isn't blocked to that port.


But when I started hfs.exe manually,everything went well。 And, when I manually started hfs.exe,a window of hfs.exe appeared.

On the contrary, the hfs.exe running in background which was started by the service “ApptoService hfs”  took no effect。Also, no windows came out.
Title: Re: I used AppToService to make hfs.exe run as a service. I cannot access hfs site
Post by: maverick on June 21, 2010, 05:19:21 AM

I just tried it here.  Everything works perfectly.
1.  HFS vfs loads automatically at bootup.
2.  App2service and HFS show up in Windows Services and Task Manager.
3.  The HFS icon is in the system tray.  I can access the HFS gui like normal.
4.  No problem at all.

Try a different port like 80 to see if the problem goes away.
Title: Re: I used AppToService to make hfs.exe run as a service. I cannot access hfs site
Post by: dragon_ex on June 22, 2010, 09:38:27 AM
I just tried it here.  Everything works perfectly.
1.  HFS vfs loads automatically at bootup.
2.  App2service and HFS show up in Windows Services and Task Manager.
3.  The HFS icon is in the system tray.  I can access the HFS gui like normal.
4.  No problem at all.

Try a different port like 80 to see if the problem goes away.

I think I should post the whole course snapshots of my operating to show if I did something wrong.  ( I did all steps of making hfs.exe run as a service again, keeping using the TCP port 8888,for the TCP port 80 was already used by another web application on the same server)

By the way, my OS is Windows server 2003 R2 X64 Enterprise Edition.
Title: Re: I used AppToService to make hfs.exe run as a service. I cannot access hfs site
Post by: dragon_ex on June 22, 2010, 09:40:52 AM
I just tried it here.  Everything works perfectly.
1.  HFS vfs loads automatically at bootup.
2.  App2service and HFS show up in Windows Services and Task Manager.
3.  The HFS icon is in the system tray.  I can access the HFS gui like normal.
4.  No problem at all.

Try a different port like 80 to see if the problem goes away.



But I see nothing relatived to hfs.exe in the System tray. And I also cannot access the website through port 8888.
Title: Re: I used AppToService to make hfs.exe run as a service. I cannot access hfs site
Post by: rejetto on June 22, 2010, 01:15:27 PM
Also, no windows came out.

that's normal.
services have no windows.

I have tried the tool you suggested, But I find no program with port 8888 listening in the tool.

check for any listening port by HFS. If you find no port, then the server is not working, and othere tests are useless.
you must find why it is not working, like firewall, permissions, working directory, etc.
Title: Re: I used AppToService to make hfs.exe run as a service. I cannot access hfs site
Post by: dragon_ex on June 22, 2010, 03:27:07 PM
that's normal.
services have no windows.

check for any listening port by HFS. If you find no port, then the server is not working, and othere tests are useless.
you must find why it is not working, like firewall, permissions, working directory, etc.

Dear rejetto admin

From the above,the screenshots of the course,can you tell me what my fault was?  

But it is strange that ,when I logined Windows with administrator account and I double clicked HFS.exe to manually run it, a window of HFS appeared and I could successfully access the HFSwebsite with http://10.255.5:8888 on any clients in my LAN. In this situation, it seemed that there were nothing wrong with HFS,such as firewall permissions or working directory or any more~

Why?
Title: Re: I used AppToService to make hfs.exe run as a service. I cannot access hfs site
Post by: maverick on June 23, 2010, 01:58:03 AM
This is a HFS forum.  The problem is not with HFS.  I proved it above in my reply where I ran HFS as a service.

The problem is in your system somewhere.  If the HFS icon does not show up in your system tray, your system can't find it so it could be a path problem.

According to one of your screenshots above, you installed app2service to e:/Http_File_Server/hfs.exe and it started successfully.  Now all you have to do is make sure your system can find the hfs working directory on your drive e:\ and that should solve your problem.
Title: Re: I used AppToService to make hfs.exe run as a service. I cannot access hfs site
Post by: dragon_ex on June 23, 2010, 03:48:44 AM
This is a HFS forum.  The problem is not with HFS.  I proved it above in my reply where I ran HFS as a service.

The problem is in your system somewhere.  If the HFS icon does not show up in your system tray, your system can't find it so it could be a path problem.

According to one of your screenshots above, you installed app2service to e:/Http_File_Server/hfs.exe and it started successfully.  Now all you have to do is make sure your system can find the hfs working directory on your drive e:\ and that should solve your problem.

First of all,Thank you for your patient replies all along these days.

How should I understand these words "Now all you have to do is make sure your system can find the hfs working directory on your drive e:\" ?
Give some explanation?
Title: Re: I used AppToService to make hfs.exe run as a service. I cannot access hfs site
Post by: dragon_ex on June 23, 2010, 07:07:39 AM
Now problem seemed to be solved。But there are still some strange things. Please Look at the TCPVIEW window below

(http://www.rejetto.com/forum/index.php?action=dlattach;topic=8654.0;attach=5358;image)
From the TCPVIEW window, I could see HFS.exe which was started by "AppToService HFS" service was listening to the standard http tcp port 80. How funny it is!!!  Everybody on the earth knows that I had changed the port to 8888!
(http://www.rejetto.com/forum/index.php?action=dlattach;topic=8654.0;attach=5360;image)

Igoring this , I typed "http://10.0.255.5" in browser to have a try, Aha~ HFS Web page appeared, although, I could not see my shared files! 【hfs.exe did not automatically load vfs】
(http://www.rejetto.com/forum/index.php?action=dlattach;topic=8654.0;attach=5364;image)

So,there are 3 problems:

1、What should I do to make vfs automatically be loaded at "AppToService hfs" service startup?
2、Although I had changed TCP Port to 8888 manually in hfs window,saved file system and saved options, why was hfs.exe started by  "AppToService HFS" service  listening to TCP 80???
3、After I double clicked hfs.exe to run it,there were 2 "hfs.exe"s running in the backgroud. In this situation, I could access hfs webpage with both TCP port 80 and port 8888。When using TCP 80, I could not see my shared files(it seem that vfs was not correctly loaded), while when I use port 8888 ,I  could open the hfs page and see my shared files successfully.
 (http://www.rejetto.com/forum/index.php?action=dlattach;topic=8654.0;attach=5362;image)
Title: Re: I used AppToService to make hfs.exe run as a service. I cannot access hfs site
Post by: maverick on June 23, 2010, 08:04:38 AM
First of all, look at the following HFS menu items in expert mode...
1.  menu -> start/exit -> make sure 'only 1 instance' is checked.
2.  menu -> tray icons -> make sure 'show main tray icon is checked.

One of the very first things that should happen when you bootup is you should see the HFS popup loading the virtual file system.  You aren't seeing this.

When you double click on hfs.exe you are actually bypassing apptoservice by running another copy of HFS and that is probably the one that shows up on port 80 because port 80 is the default.  This other copy isn't configured to use port 8888.  That is not what you should do.  Make those menu changes I mention above which includes 'only one instance'.

You have to many things going on here that are causing your problems and they have to do with installation and configuration.

I would suggest you START OVER.
1. Save your virtual file system to a file and Exit from HFS.  If HFS works correctly with IP localhost on port 8888 and there is no problem with your virtual file system you should be ok there.  If there are problems with HFS or your virtual file system, re-install it.
2. Remove the app2service from services and re-configure it.  Reboot to clear the cache.   Make sure that the path to the HFS working directory is correct.  Otherwise, your computer won't be able to find your virtual file system to load at bootup.  If that doesn't happen you will have the same type of problem.
3. It might be a good idea to move the HFS working directory to another drive like c:\
4. When finished configuring apptoservice, Reboot.  Go to Windows Services and make sure apptoservice is set to 'automatic' in properties.  Also in properties check the path to see if it is correct.
5. Reboot again and cross your fingers that it works.
Title: Re: I used AppToService to make hfs.exe run as a service. I cannot access hfs site
Post by: dragon_ex on June 23, 2010, 12:53:22 PM
First of all, look at the following HFS menu items in expert mode...
1.  menu -> start/exit -> make sure 'only 1 instance' is checked.
2.  menu -> tray icons -> make sure 'show main tray icon is checked.

One of the very first things that should happen when you bootup is you should see the HFS popup loading the virtual file system.  You aren't seeing this.

When you double click on hfs.exe you are actually bypassing apptoservice by running another copy of HFS and that is probably the one that shows up on port 80 because port 80 is the default.  This other copy isn't configured to use port 8888.  That is not what you should do.  Make those menu changes I mention above which includes 'only one instance'.

You have to many things going on here that are causing your problems and they have to do with installation and configuration.

I would suggest you START OVER.
1. Save your virtual file system to a file and Exit from HFS.  If HFS works correctly with IP localhost on port 8888 and there is no problem with your virtual file system you should be ok there.  If there are problems with HFS or your virtual file system, re-install it.
2. Remove the app2service from services and re-configure it.  Reboot to clear the cache.   Make sure that the path to the HFS working directory is correct.  Otherwise, your computer won't be able to find your virtual file system to load at bootup.  If that doesn't happen you will have the same type of problem.
3. It might be a good idea to move the HFS working directory to another drive like c:\
4. When finished configuring apptoservice, Reboot.  Go to Windows Services and make sure apptoservice is set to 'automatic' in properties.  Also in properties check the path to see if it is correct.
5. Reboot again and cross your fingers that it works.



Thank you very much!

I did all the steps again.And I am comfirmed in these things below:
1.  menu -> start/exit -> 'only 1 instance' is checked.
2.  menu -> tray icons -> 'show main tray icon is checked.
3.  I moved e:\hfs to c:\
4.  I configured app2service again
5.  I have made "apptoservice hfs" service "automatic", and I am sure that the path of hfs.exe and apptoservice.exe is correct.
6.  I can access hfs webpage on localhost on TCP 8888  when a manually launched instance of ”hfs.exe“ existed and webpage correctly showed files I shared.
7.  I saved vitual file system to a file named "share.vfs" in the same directory of hfs.exe.

And then I rebooted system. What I saw are listed below:
1. After I login Windows with an administrator account,there wasn's popup loading the virtual file system
2. I saw hfs.exe and apptoservice.exe were running in the Taskmanager
3. I saw in the Service managment window, "Apptoservice hfs" was running
4. I launched TCPVIEW.exe and I saw hfs.exe was running and listening to TCP port "SERVERNAME:http" ,not "SERVERNAME:8888"
5. On a workstation in the LAN, I could access http://10.0.255.5 not http://10.0.255.5:8888
6. Webpage "http://10.0.255.5" showed no files I shared. It did not load vfs
8. Although menu -> start/exit -> 'only 1 instance' is checked, I could also launched another instance of hfs.exe,and then " http://10.0.255.5:8888" took effect and showed the very files I shared.


From all the facts above, I come to these conclutions below:

1. Although I set TCP port to 8888, the instance starting in the form of a service will still use TCP 80 as its listening port.
2. At least  two instances of hfs.exe can work correctly in the same time if the two instances use different TCP port for listening. And you can successfully access the webpage of either instance when you use the right TCP port
3. "AppToService hfs" service won't load virtual file system file on its startup.

Please help me,Thank you so much!
Title: Re: I used AppToService to make hfs.exe run as a service. I cannot access hfs site
Post by: Wasserfloh on June 23, 2010, 01:18:45 PM
Switch to Expert Mode and  Menu > Save options > to file
Title: Re: I used AppToService to make hfs.exe run as a service. I cannot access hfs site
Post by: maverick on June 23, 2010, 02:31:55 PM
Check these HFS menu settings....

1. Menu -> load recent files -> select -> 'share.vfs'
2. Menu -> start/exit -> select -> 'reload on startup VFS file previously open' and select -> 'auto-save vfs on exit'
Title: Re: I used AppToService to make hfs.exe run as a service. I cannot access hfs site
Post by: dragon_ex on June 23, 2010, 04:07:52 PM
Thank  maverick Wasserfloh and rejetto very much!!!

Especially appreciate maverick's patient replies in my troubleshooting!!!

I announce that the problem has been absolutely sovled by Wasserfloh's way.

Options must be saved to file ,thus options,including TCP port settings and virtual file system loading, can take effect when hfs.exe starts in the form of a service.
Saved in registry,  options  cannot take effect when hfs.exe starts in the form of a service with the SYSTEM account. In this situation,options only work with the instance of hfs.exe launched with current desktop USER account.
So, remember, service form of "hfs.exe" works correctly only with "hfs.ini" which stores all your HFS options.
Title: Re: I used AppToService to make hfs.exe run as a service. I cannot access hfs site
Post by: rejetto on June 24, 2010, 10:43:06 AM
right, probably because options are saved by default to the user space (in the registry), and services run (by default) with a different user.


so, my advice of changing the service's user could have solved as well.
Title: Re: I used AppToService to make hfs.exe run as a service. I cannot access hfs site
Post by: bmartino1 on June 09, 2015, 04:45:15 AM
yes, yes its old...
http://www.rejetto.com/forum/f-a-q-s/run-hfs-as-windows-service/msg1059183/#msg1059183