HTTPS on Linux

Tagged: , , ,

Viewing 15 posts - 16 through 30 (of 47 total)
  • Author
    Posts
  • #4669
    AvatarSuperDev
    Participant

    I did not have problem with https running. The only problem is URL Rewrite like on windows. https://forum.rapidscada.org/?topic=run-self-ssl-to-secure-scada
    As you remember we added Url Rewrite on IIS and made it work.
    But on linux again that problem occurs when running https and any trick we did we couldn’t solve the problem.
    yet the error

    Scheme loading failed. Try to reload scheme

    shows while loading scheme
    <img src=”http://s8.picofile.com/file/8344101834/iis0.png&#8221; alt=”error loading scheme in rapid scada” /

    #4674
    MikhailMikhail
    Moderator

    I think the only way at this time is written here. I mean using reverse proxy.

    #4679
    AvatarSuperDev
    Participant

    But i don’t have problem in https. I have configured my linux server and it loads https and converts http to https as well.
    The only problem is Url Rewrite. when https loads the schemes (in iframe) doesn’t load.
    Exactly like this in windows:
    https://forum.rapidscada.org/?topic=run-self-ssl-to-secure-scada/#post-4623

    #4683
    MikhailMikhail
    Moderator

    Please make a screenshot of the browser console (Press F12 in browser).

    #4687
    AvatarSuperDev
    Participant
    #4689
    MikhailMikhail
    Moderator

    There is no screenshot by this link. At least on my PC.

    #4691
    AvatarSuperDev
    Participant
    #4694
    MikhailMikhail
    Moderator

    I asked for a screenshot but I see *.json file.

    #4702
    AvatarSuperDev
    Participant

    Hi
    As you know we use the below command while installing mono for apache to install required modules.
    sudo apt-get install libapache2-mod-mono mono-apache-server4

    The question is this, what command should we use if we want to install mono for nginx

    #4703
    AvatarSuperDev
    Participant
    #4705
    MikhailMikhail
    Moderator

    Hi,

    You should press F12 in browser, go to the Console and Network tabs and make a screenshot of the detailed error message.

    #7732
    Avatarvertigo0001
    Participant

    did we have a solution for HTTPS to rapid SCADA on Linux?

    #7745
    MikhailMikhail
    Moderator

    We recently discussed this in Russian forum. Could you use Google Translate starting from this message? Pay attention to the link to a manual which describes how to use nginx as an endpoint. We can continue the discussion here.

    #7817
    Avatarkumajaya
    Participant

    I believe Nginx must be better but since somehow mono-xsp4 available on my Ubuntu system:

    PART 1: mono-xsp configuration

    1. Copy /etc/init.d/mono-xsp4 as /etc/init.d/scada-xsp4 and modify it:

    sudo cp /etc/init.d/mono-xsp4 /etc/init.d/scada-xsp4
    sudo nano /etc/init.d/scada-xsp4

    #! /bin/sh
    ### BEGIN INIT INFO
    # Provides:          mono-xsp4
    # Required-Start:    $remote_fs
    # Required-Stop:     $remote_fs
    # Should-Start:      
    # Should-Stop:
    # Default-Start:     2 3 4 5
    # Default-Stop:      0 1 6
    # Short-Description: Mono XSP4
    # Description:       Debian init script for Mono XSP4.
    ### END INIT INFO
    #
    # Written by Pablo Fischer <pablo@pablo.com.mx>
    #            Dylan R. E. Moonfire <debian@mfgames.com>
    # Modified for Debian GNU/Linux
    #
    # Version:	@(#)mono-xsp4 pablo@pablo.com.mx
    #
    
    # Variables
    PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
    DAEMON=/usr/bin/xsp4
    NAME=scada-xsp4
    DESC="XSP 4.0 WebServer"
    DEFAULT=/etc/default/$NAME
    CFGDIR=/etc/xsp4
    VIRTUALFILE=$CFGDIR/scada.webapp
    MONO_SHARED_DIR=/var/run/$NAME
    start_boot=false
    
    # Use LSB
    . /lib/lsb/init-functions
    
    # If we don't have the basics, don't bother
    test -x $DAEMON || exit 0
    test -f $DEFAULT && . $DEFAULT	
    
    if [ "x$start_boot" != "xtrue" ] ; then
        exit 0
    fi
    
    if [ ! -e $MONO_SHARED_DIR ]; then
    	mkdir $MONO_SHARED_DIR   
    	chown $user:$group $MONO_SHARED_DIR
    fi
                    
    should_start() {
        if [ ! -e $VIRTUALFILE -o <code>cat $VIRTUALFILE | wc -l</code> = "2" ]; then
    	log_action_msg "You have an incomplete $VIRTUALFILE"
    	log_action_msg "To fix it, you need to install at least one package for xsp4 (like asp.net-examples)"	
    	return 1
        fi 
        
        if [ -f /var/run/$NAME.pid ]; then
    	# Are we really running xsp4?
    	xsp4_pid=<code>cat /var/run/$NAME.pid</code>
    	xsp4_ps=<code>ps -p $xsp4_pid | wc -l</code>
    	if [ "$xsp4_ps" != "1" ]; then
    	    log_action_msg "Sorry, there is already a xsp4 running, stop it first"
    	    return 1		
    	fi
        fi
        
        return 0
    	
    }
    
    case "$1" in
        start)
    	if should_start ; then
    	    log_daemon_msg "Starting $DESC" "$NAME"
    	    export MONO_SHARED_DIR
    	    start-stop-daemon --start --background --make-pidfile \
    		--quiet --pidfile /var/run/$NAME.pid \
    		--user $user --group $group --chuid $user \
    		--exec $DAEMON -- \
    		--port $port --address $address --appconfigdir \
    		$CFGDIR --nonstop
    	    log_end_msg $?
    	fi
    	;;
        stop)
    	log_daemon_msg "Stopping $DESC" "$NAME"
            for i in $(ps aux | grep -v grep | grep 'xsp4.exe' | cut -c 10-15)
            do
                    kill $i > /dev/null 2>&1
            done
    	log_end_msg $?
    	;;
        restart|force-reload)
    	$0 stop
    	$0 start
    	;;
        *)
    	N=/etc/init.d/$NAME
    	echo "Usage: $N {start|stop|restart|force-reload}" >&2
    	exit 1
    	;;
    esac
    
    exit 0

    2. Copy /etc/default/mono-xsp4 as /etc/default/scada-xsp4 and modify it:

    sudo cp /etc/default/mono-xsp4 /etc/default/scada-xsp4
    sudo nano /etc/default/scada-xsp4

    # Defaults for mono-xsp4, official version
    # sourced by /etc/init.d/scada-xsp4
    
    # Should we start it?
    start_boot=true
    
    # User and group by default
    user=www-data
    group=www-data
    
    # Default port
    port=8000
    address=0.0.0.0
    
    # Directory for config files
    config_files=/etc/scada-xsp4

    3. Copy /etc/xsp4/debian.webapp as /etc/xsp/scada.webapp and modify it:

    sudo cp /etc/xsp4/debian.webapp /etc/xsp4/scada.webapp
    sudo nano /etc/xsp4/scada.webapp

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

    4. Activate scada-xsp4 service and start it:

    cd /etc/init.d/
    sudo chmod +x scada-xsp4
    sudo update-rc.d scada-xsp4 defaults
    sudo service scada-xsp4 start

    5. Open http://localhost:8000 on your browser for testing

    #7818
    Avatarkumajaya
    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 - 16 through 30 (of 47 total)
  • You must be logged in to reply to this topic.