matlabserver+apache+linux

来源:互联网 发布:python写网络爬虫 pdf 编辑:程序博客网 时间:2024/06/03 18:20

作者:lch

 

matlab 版本:
Matlab_R14_Mac.Linux.Unix_CD1.iso
Matlab_R14_Mac.Linux.Unix_CD2.iso
Matlab_R14_Mac.Linux.Unix_CD3.iso
操作系统:Linux
服务器:Apache

1. 如果报错:Error: gethostbyname() failure:
原因:matweb.conf中mlserver=<matlabserver_host_name>
解决办法:用你的服务器的IP替换<matlabserver_host_name>


2.  Error: Send 2 () Error: 32
Error: recv1() error: 104
libgcc_s.so.1 must be installed for pthread_cancel to work
原因:matlab找不到自己的库(我的理解)
解决办法:在matlabserver.conf中添加LIBRARY_PATH=/lib:$LIBRARY_PATH


3. MATLAB Application Error:
Error using ==> print Error using ==> graphics/private/name Cannot create output file 'wsrml00002.pcx'
原因:权限不够,matweb访问matlabserver时是以普通用户身份访问的,对linux系统的文件没有读写权限。(我的理解)
解决办法:将matweb.conf文件中mldir所对应的文件赋为777(chmod 777 /usr/src/matlab/toolbox/webserver/wsdemos/icons)

 

4. 附:我的配置文件
(1).  matweb.conf
[webmagic]
mlserver=10.10.19.168

[webpeaks]
mlserver=10.10.19.168
mldir=/usr/src/matlab/toolbox/webserver/wsdemos/icons

[webstockrnd]
mlserver=10.10.19.168
mldir=/usr/src/matlab/toolbox/webserver/wsdemos/icons

[players]
mlserver=10.10.19.168
mldir=/usr/src/matlab/toolbox/webserver/wsdemos/icons

(2). matlabserver.conf
-m 1 -l $ELOG_FILE
SERVER=
SERVER_HOST=localhost.localdomain
START_USERNAME=huichen
RELEASE=R14
ARCH=glnx86
MATLAB=/usr/src/matlab
DISPLAY=-nodisplay
LM_LICENSE_FILE=/usr/src/matlab/etc/
LIBRARY_PATH=$MATLAB/sys/os/$ARCH:$MATLAB/bin/$ARCH
LIBRARY_PATH=/lib:$LIBRARY_PATH
WEBSERVER_MARKER=_TMW$RELEASE
SLOG_FILE=/var/tmp/webserver$WEBSERVER_MARKER.slog$SERVER
ELOG_FILE=/var/tmp/webserver$WEBSERVER_MARKER.elog$SERVER
PID_FILE=/var/tmp/webserver$WEBSERVER_MARKER.pid$SERVER
CHECK_XHOST_TIMEOUT=5

(3). Apach的配置文件http.conf
###############ScriptAlias /cgi-bin/ "/usr/local/apache2/cgi-bin/"
###############上面的路径必须与下面一行的路径相同就可以了
<Directory "/usr/local/apache2/cgi-bin">
    AllowOverride None
    Options ExecCGI
    Order allow,deny
    Allow from all
</Directory>
################( 我的matweb和matweb.conf两个文件放在/usr/local/apache2/cgi-bin )

Alias /icons/ "/usr/src/matlab/toolbox/webserver/wsdemos/icons/"
<Directory "/usr/src/matlab/toolbox/webserver/wsdemos/icons">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
###############( matlab生成的图片放在/usr/src/matlab/toolbox/webserver/wsdemos/icons )