作者: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 )