This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

restart httpproxy

Hello,

we have an asg 220 and I want to know how I can stop/start the httproxy process within putty and the ASG webadmin.
How can make a cronjob to restart a process or is that not allowed?


This thread was automatically locked due to age.
Parents
  • Since the UTM Version 9.0 and 9.1 have this memory leak and SWAP usage issue, I also did a little putty script to restart the http proxy and snort (IPS) automaticly.

    With a configured cronjob you would lose the support from astaro and the feature request for scheduled restarts was denied, this is the only way for a few of my customers to regulate the performance impacts which will hit over time with growing SWAP. 

    Only the root user will have sufficent rights to restart the services, so first of all, we have to enable the shell access for the root user (Management->System Settings->Authentification ->> root access but only with ssh key)

    Therefore we first need an ssh key. This key is generated with the PuTTYgen Tool. Two keys are generated, a public and a private. The public key has to be loaded into the UTM. The private key will be used to identify our "script" as root. Save both keys!

    Now we make a little batch file (I'm a Windows [;)]) with a code like this:
    "C:\Program Files\PuTTY\putty.exe" root@192.168.0.254 -i "C:\Program Files\PuTTY\privkey.ppk" -m "C:\Scripts\astarocommands.txt"
    exit


    In this example 192.168.0.254 is the IP-Adress of my UTM appliance. With the "-i" we give the path to the private ssh key we generated in the first step. The "-m" command specifies the path to a .txt file which will be executed.

    The content of the astarocommands.txt file.

    /var/mdw/scripts/httpproxy restart
    /var/mdw/scripts/snort restart
    exit


    Of course there could be other commands in this text file, you could also restart the whole appliance, but in my case this was sufficent.

    So now I just made a scheduled task in Windows and let this batch file run once a week on sunday midnight.

    Done. Hope this helps till Sophos really fixes this memory and swap issue or permit the RAM upgrade....
Reply
  • Since the UTM Version 9.0 and 9.1 have this memory leak and SWAP usage issue, I also did a little putty script to restart the http proxy and snort (IPS) automaticly.

    With a configured cronjob you would lose the support from astaro and the feature request for scheduled restarts was denied, this is the only way for a few of my customers to regulate the performance impacts which will hit over time with growing SWAP. 

    Only the root user will have sufficent rights to restart the services, so first of all, we have to enable the shell access for the root user (Management->System Settings->Authentification ->> root access but only with ssh key)

    Therefore we first need an ssh key. This key is generated with the PuTTYgen Tool. Two keys are generated, a public and a private. The public key has to be loaded into the UTM. The private key will be used to identify our "script" as root. Save both keys!

    Now we make a little batch file (I'm a Windows [;)]) with a code like this:
    "C:\Program Files\PuTTY\putty.exe" root@192.168.0.254 -i "C:\Program Files\PuTTY\privkey.ppk" -m "C:\Scripts\astarocommands.txt"
    exit


    In this example 192.168.0.254 is the IP-Adress of my UTM appliance. With the "-i" we give the path to the private ssh key we generated in the first step. The "-m" command specifies the path to a .txt file which will be executed.

    The content of the astarocommands.txt file.

    /var/mdw/scripts/httpproxy restart
    /var/mdw/scripts/snort restart
    exit


    Of course there could be other commands in this text file, you could also restart the whole appliance, but in my case this was sufficent.

    So now I just made a scheduled task in Windows and let this batch file run once a week on sunday midnight.

    Done. Hope this helps till Sophos really fixes this memory and swap issue or permit the RAM upgrade....
Children