kumajaya

Forum Replies Created

Viewing 15 posts - 76 through 90 (of 144 total)
  • Author
    Posts
  • in reply to: HTTPS on Linux #8146
    kumajaya
    Participant

    I just installed RS on Ubuntu server 20.04 and follow https://www.mono-project.com/docs/web/fastcgi/nginx/ without any success, repeatedly errors in table view. I want to run RS purely with Nginx without Apache. A tested working solution:

    1. Add ScadaWeb to Mono XSP server:
    sudo mono-xsp4-admin add --path=/opt/scada/ScadaWeb --app=/scada
    2. Fix mono-xsp service bug:
    sudo nano /etc/init.d/mono-xsp
    change:
    for i in $(ps aux | grep -v grep | grep 'xsp4.exe' | cut -c 10-15)
    to:
    for i in $(ps aux | grep -v grep | grep 'xsp4.exe' | cut -c 10-17)
    3. Reload mono-xsp service:
    sudo systemctl daemon-reload
    4. Start Mono XSP server. Server will run on port 8084, you can change it in /etc/default/mono-xsp4:
    sudo systemctl start mono-xsp
    5. Follow https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-20-04 to install Nginx
    6. Follow https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-20-04 to secure Nginx
    7. Edit /etc/nginx/sites-available/example.com and add:

            if ($scheme != "https") {
                    return 301 https://$host$request_uri;
            }
    
            location /scada {
                    proxy_pass http://127.0.0.1:8084;
                    sub_filter 'example.com:8084' 'example.com';
                    sub_filter 'example.com%3a8084' 'example.com';
                    sub_filter_once on;
                    proxy_redirect off;
                    proxy_buffering off;
                    proxy_set_header Host $host;
                    proxy_set_header X-Real-IP $remote_addr;
                    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                    proxy_set_header X-Forwarded-Proto $scheme;
            }

    8. Restart Nginx:
    sudo systemctl restart nginx
    9. Test as previous post.

    NOTE: Not tested to load a scheme yet but “Unable to receive list of plugins” in Main Menu – Plugins – Download

    in reply to: Not Receiving Data from Request – Modbus #8018
    kumajaya
    Participant

    I set InHand 615’s serial port as TCP client on port 40000, RS as Modbus master on TCP server communication line. After that I can access Schneider PM810MG via cellular network but the problem I got communication error repeatedly and sometime RS still assume incorect response as a correct value, data value
    jumping strangely. My solution for now make use of Perle TruePort driver for Linux https://www.perle.com/downloads/trueport.shtml as TCP server on port 40000 and RS access serial data from /dev/tx0000. Working good so far.

    Perle TruePort config in /etc/trueport/config.tp:
    /usr/bin/trueportd -noudp -opmode optimize_lan -tty 0 -port 40000 -ka 30

    Perle TruePort driver also available for Windows with better configuration GUI.

    in reply to: URL in interface database not get updated #8007
    kumajaya
    Participant

    Yes, 5.8.2 Mono installed on Raspberry Pi 4B, Ubuntu server. I’m afraid it’s also related to browser/server cache.

    in reply to: Not Receiving Data from Request – Modbus #7975
    kumajaya
    Participant

    Just received InHand 4G modem from their local distributor for testing. Not as good as Moxa device but cheaper.

    in reply to: URL in interface database not get updated #7968
    kumajaya
    Participant

    For a brand new installation, I create ULR link entry under HelloWorld\Simulator.tbl in Interface table. For example: Path: https://www.myhome.com, Title: HelloWorld\Home. It’s work after initial upload, click on Home link will open https://www.myhome.com . But later even after I have change Home link to https://www.myhome.com/subpage, I always got https://www.myhome.com

    in reply to: Modbus RTU comunication issue #7923
    kumajaya
    Participant

    I’ll try it @Mikhail. For now I accessed it from Node-RED using node-red-contrib-modbus. I have to enable TCP in telnet mode because got incorrect Modbus stream in default TCP mode.

    in reply to: Transfer File from Computer to Rpi #7922
    kumajaya
    Participant

    My English not good enough to explain but I can upload RS project from Windows to Linux over internet easily.

    in reply to: Modbus RTU comunication issue #7905
    kumajaya
    Participant

    @Mikhail Today I realized how simple NPort in TCP mode. Thank you.

    Not actually NPort device I use here but a GSM modem from Moxa with a serial port. With a private IP from GSM operator, the only option to access it is via OnCell Central Manager. OCM map the serial port to a local TCP port.

    in reply to: HTTPS on Linux #7848
    kumajaya
    Participant

    At least we have 2 options to run RS with SSL even with a negative impact if exists. Nginx + Mono FastCGI will be perfect for RS but I have multiple application run under Apache for now.

    in reply to: HTTPS on Linux #7846
    kumajaya
    Participant

    Run Mono FastCGI via Nginx behind Apache (even Apache behind Nginx must be better):

    1. Install Nginx:

    sudo apt-get install nginx

    2. Change Nginx default port from 80 to 8008 and add /scada-fastcgi virtual path:

    sudo nano /etc/nginx/sites-available/default

    	listen 8008 default_server;
    	listen [::]:8008 default_server;
    	location /scada-fastcgi {
    		index index.html index.htm default.aspx Default.aspx;
    		fastcgi_index index.htm;
    		fastcgi_pass 127.0.0.1:9000;
    		include /etc/nginx/fastcgi_params;
    	}

    3. Edit Nginx FastCGI parameter:

    sudo nano /etc/nginx/fastcgi_params

    fastcgi_param  PATH_INFO          "";
    fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;

    4. Edit Apache config and reload it:

    sudo nano /etc/apache2/sites-enabled/default-ssl.conf

        	ProxyPass /scada-fastcgi http://127.0.0.1:8008/scada-fastcgi
        	ProxyPassReverse /scada-fastcgi http://127.0.0.1:8008/scada-fastcgi

    sudo systemctl reload apache2

    5. Install Mono FastCGI if needed, run it:

    sudo apt-get install mono-fastcgi-server
    fastcgi-mono-server4 /applications=/scada-fastcgi:/var/www/html/scada/ /socket=tcp:127.0.0.1:9000

    6. Start Nginx:

    sudo systemctl reload nginx

    You can access SCADA web at https://yourserver/scada-fastcgi

    in reply to: HTTPS on Linux #7837
    kumajaya
    Participant

    No problem here, I can access for example http://scada.myserver.com/ without a redirect. But to be honest, I’m not expert in Apache configuration.

    in reply to: HTTPS on Linux #7823
    kumajaya
    Participant

    I think run scada web as web root for my server is not a good idea since I also use it for different service.

    1. Edit scada-xsp4 config:

    sudo nano /etc/xsp4/scada.webapp

    <apps>
      <web-application>
        <name>scada</name>
        <vpath>/scada</vpath>
        <path>/opt/scada/ScadaWeb</path>
      </web-application>
    </apps>

    2. Edit Apache config:

    sudo nano /etc/apache2/sites-enabled/default-ssl.conf

        	SSLProxyEngine on
        	SSLProxyVerify none
        	SSLProxyCheckPeerCN off
        	SSLProxyCheckPeerName off
        	SSLProxyCheckPeerExpire off
        	ProxyPreserveHost off
        	ProxyRequests off
        	ProxyVia off
    
        	ProxyPass /scada http://127.0.0.1:8000/scada
        	ProxyPassReverse /scada http://127.0.0.1:8000/scada

    3. Disable scada web in Apache:

    sudo a2dissite scada.conf

    4. Restart scada-xsp4 service:

    sudo service scada-xsp4 stop
    ps ax –> to check mono pid that load xsp4.exe
    sudo kill -9 pid_from_previous_step
    sudo service scada-xsp4 start

    5. Restart Apache:

    sudo service apache2 restart

    in reply to: Installing GrafanaDataProvider on Linux #7820
    kumajaya
    Participant

    You’re welcome! Just a litle bit contribution from me.

    in reply to: HTTPS on Linux #7819
    kumajaya
    Participant

    I can’t edit my previous post, you can test previous configuration by accessing for example https://scada.rapidscada.org/ after restarting Apache web server:

    sudo service apache2 restart

    For my future references:
    1. Run Apache and Nginx together: http://kbeezie.com/apache-with-nginx/
    2. Mono and Nginx: https://www.mono-project.com/docs/web/fastcgi/nginx/

    in reply to: HTTPS on Linux #7818
    kumajaya
    Participant

    PART 2: Apache configuration

    Depend on your server configuration, my working /etc/apache2/sites-enabled/default-ssl.conf configuration:

        	SSLProxyEngine on
        	SSLProxyVerify none
        	SSLProxyCheckPeerCN off
        	SSLProxyCheckPeerName off
        	SSLProxyCheckPeerExpire off
        	ProxyPreserveHost off
        	ProxyRequests off
        	ProxyVia off
    
        	ProxyPass / http://127.0.0.1:8000/
        	ProxyPassReverse / http://127.0.0.1:8000/
Viewing 15 posts - 76 through 90 (of 144 total)