06-12-2008 06:58 PM
06-15-2008 11:22 PM
03-10-2009 07:24 AM
I've successfully manged to bulid a stand alone vi that starts the web server every time it is started. Now I want to run it on a non standard port (not 80), for network policy reasons. I change the port in options/Web server configuration/ HTTP port to 10080. If I run it in development system it works ok, but when I build it as a stand alone vi and start it I cannot access it from a web browser.
Ola
03-10-2009 07:46 AM
Ola_A, What version of LabVIEW are you using?
Check the web server configuration to make sure the correct port is being used.
Before 8.6 this would be the WebServer.Port token in Application.ini
In 8.6 and later this is found in the niwebserver.conf file next to Application.ini.
If the port is correct then make sure that the web server is turned on with the WebServer.Enabled tag in Application.ini. Also make sure the dev environment doesn't have the server listening on the same port when you run your Application, otherwise the Application's web server will not be able to listen on that port.
Let us know how it goes.
Nathan
03-10-2009 08:44 AM - edited 03-10-2009 08:45 AM
Ola,
First the obvious question...are you putting the non-standard port number into the address bar of the browser trying to access the VI? If the 'standard' port 80 page was at http://localhost/WebPage.html, the new address would be http://localhost:10080/WebPage.html.
What I've got to work is to edit the application.ini file that's in the folder that holds your compiled VI. Open it up and look for the line that starts with "WebServer.Port=". Make sure that the port you want to use follows the = sign. This works for me. I've even got an external program that'll go in and find that line and change it to whatever port I want to use. Then, when the VI starts, I can get to it using the address : port as in the first paragraph.
Good Luck.
Steve
03-10-2009 09:19 AM
The port is set to 10080. As far as I can see the port is also correct in the niwebserver.conf file. In application.ini the WebServer.enabled is true. See below for both files!
Ola
<< niwebserver.conf>>
# Web server configuration file.
# Generated by LabVIEW 8.6
# 2009-03-09 10.48.22
#
# Global Directives
#
ServerRoot "."
ErrorLog "./logs/error.log"
LogLevel 3
CustomLog "/:/:/:/:/:/Program/National Instruments/LabVIEW 8.6/resource/webserver/logs/access.log" "%h %l %u %t \"%r\" %>s %b"
TypesConfig mime.types
ThreadLimit 10
LoadModulePath "./modules" "./LVModules" "./.."
LoadModule LVAuth lvauthmodule
LoadModule LVSnapshot lvsnapshotmodule
LoadModule LVRFP lvrfpmodule
LoadModule dir libdirModule
LoadModule copy libcopyModule
LoadModule esp libespModule
Listen 10080
#
# Directives that apply to the default server
#
ServerName default
DocumentRoot "./../../www"
Timeout 60
AddHandler LVAuthHandler
AddHandler LVSnapshotHandler .snap
AddHandler LVRFPHandler
AddHandler dirHandler
AddHandler espHandler .esp
AddHandler copyHandler
DirectoryIndex index.html
KeepAlive on
KeepAliveTimeout 60
<< application.ini >>
[Recept_22]
server.app.propertiesEnabled=True
server.tcp.servic="My Computer/VI Server"
server.vi.propertiesEnabled=True
WebServer.Enabled=True
WebServer.TcpAccess="c+*"
WebServer.ViAccess="+*"
DebugServerEnabled=False
DebugServerWaitOnLaunch=False
03-10-2009 09:27 AM
Steve, I can connect with localhost:10080 when the vi is run in development system, so most parts are tested. I use LV 8.6. I actually restarted the computer and only run the compiled vi to make sure the development systems web server didn't interfere.
Ola
03-10-2009 09:39 AM
In the niwebserver.conf file you should take a look at a couple of your paths.
The CustomLog path is obviously wrong.
The ErrorLog may be ok but is going to try and save to a directory that might not be convenient for you.
You can delete those lines if you don't want the log files. Otherwise change those to valid paths to the log files you want to use. ie. "C:\logs\error.log" for example.
The DocumentRoot path is probably wrong. It is going to be relative to the LabVIEW run time engine installed directory. This is almost certainly not what you want.
You can't delete this directive or else the server cannot start. Change this to a valid absolute path to the directory where your web pages live.
You can find some more information about using the web server and web services in the following link. Number 13 has some information about built executables.
http://zone.ni.com/devzone/cda/tut/p/id/7747
Nathan