Memory Manual Instrumentation
  • 21 Sep 2023
  • 2 Minutes to read
  • Dark
    Light
  • PDF

Memory Manual Instrumentation

  • Dark
    Light
  • PDF

Article summary

About this Article
This article provides Memory Protection manual instrumentation configuration settings for Apache HTTP server and NGINX server.  


Apache HTTP Server

Linux Server RHEL/CentOS 7.X

  1. Log in to the Linux Host (RHEL/CentOS) that has Apache Server installed
  2. If the Apache Server is running, stop it using the below commands:
    service httpd stop
    OR
    <Apache_Directory>/httpd -k stop
  3. Verify that all the httpd processes are stopped using the below command:
    ps -ef | grep -i httpd
  4. If the httpd processes are still running, kill them using:
    kill -9 <httpd-pid>
  5. Start the httpd2.4 Server with VSP protection using the below command:
    /opt/virsec-web-mem/vsp_memory/vsp-memory <Apache_Directory>/httpd -k start
    OR
  6. Start the httpd2.4 Server with VSP protection as a Service
    cd /usr/lib/systemd/system/
    vi httpd.service 
    1. Append the below text to the ExecStar argument
      /opt/virsec-web-mem/vsp_memory/vsp-memory
      Before Change:
      #Type=notify
      ExecStart=<Apache_Directory>/httpd $OPTIONS -DFOREGROUND
      
      After Change:
      #Type=notify
      ExecStart=/opt/virsec-web-mem/vsp_memory/vsp-memory <Apache_Directory>/httpd $OPTIONS -DFOREGROUND
      
    2. Save the file httpd.service
    3. Execute the below commands to start the service:
      systemctl daemon-reload
      service httpd start
      


Ubuntu Server 14.x ,16.x and 18.x

  1. Log in to the Ubuntu Host that has Apache Server installed
  2. If the Apache Server is running, stop it using the below commands:
    service apache2 stop
    OR
    <Apache_Directory>/apache2 -k stop
  3. Verify that all the httpd processes are stopped using the below command:
    ps -ef | grep -i apache2
  4. If the httpd processes are still running, kill them using:
    kill -9 <apache2-pid>
  5. Start the Apache Server with VSP protection using the below command:
    /opt/virsec-web-mem/vsp_memory/vsp-memory <Apache_Directory>/apache2 -k start
    OR
  6. Start the Apache Server with VSP protection as a Service
    cd /usr/sbin/
    vi apachectl
    1. Append the below text to the HTTPD argument
      /opt/virsec-web-mem/vsp_memory/vsp-memory
      Before Change:
      HTTPD=${APACHE_HTTPD:-/usr/sbin/apache2}
      After Change:
      HTTPD="/opt/virsec-web-mem/vsp_memory/vsp-memory ${APACHE_HTTPD:-/usr/sbin/apache2}"
    2. Save the file
    3. Execute the below commands to start the service:
      systemctl start apache2

Windows Server

  1. Log in to the Windows Host that has Apache Server installed
  2. If the Apache Server is running, stop it as described below:
    1. At the command prompt, navigate to the directory: <Apache_Home>/bin
    2. Start the Httpd2.4 Server with VSP protection through command line
      "C:\Program Files (x86)\Virsec\virsec-web-mem\vsp_memory\vsp-memory.exe" <Apache_Home>\bin\httpd.exe
      OR
    3. Start the Httpd2.4 Server with VSP protection as a Service
      1. Verify the Apache service name in services.msc
      2. Modify registry entry for Apache2.4 under the below path:
        HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Apache2.4
        Modify ImagePath to add the below path before httpd.exe:
        C:\Program Files (x86)\Virsec\virsec-web-mem\vsp_memory\vsp-memory.exe
      3. Restart the Apache2.4 service from services.msc
NOTE
Apache2.4 mentioned above is the service name. This value may vary in the target server. Replace it accordingly with the respective service name


Nginx Server

Linux Server RHEL/CentOS 7.X

  1. Log in to the RHEL/CentOS Host that has Nginx Server installed
  2. If the Nginx Server is running, stop it using the below commands:
    service nginx stop
    OR
    <Nginx_Directory>/nginx -s stop
  3. Verify that all the Nginx processes are stopped using the below command:
    ps -ef | grep -i nginx
  4. If the Nginx processes are still running, kill them using:
    kill -9 <nginx-pid>
  5. Start the Nginx Server with VSP protection using the below command:
    /opt/virsec-web-mem/vsp_memory/vsp-memory <Nginx_Directory>/nginx
    OR
  6. Start the Nginx Server with VSP protection as a Service
    cd /etc/systemd/system/multi-user.target.wants
    vi nginx.service 
    1. Append the below text to the ExecStar argument
      /opt/virsec-web-mem/vsp_memory/vsp-memory
      Before Change:
      ExecStart=<Nginx_Directory>/nginx -c /etc/nginx/nginx.conf
      After Change:
      ExecStart=/opt/virsec-web-mem/vsp_memory/vsp-memory <Nginx_Directory>/nginx -c /etc/nginx/nginx.conf
    2. Save the file nginx.service
    3. Execute the below commands to start the service:
      systemctl daemon-reload
      service nginx start
      

Ubuntu Server 14.x ,16.x and 18.x

  1. Log in to the Ubuntu Host that has Nginx Server installed
  2. If the Nginx Server is running, stop it using the below commands:
    service nginx stop
    OR
    <Nginx_Directory>/nginx -s stop
  3. Verify that all the Nginx processes are stopped using the below command:
    ps -ef | grep -i nginx
  4. If the Nginx processes are still running, kill them using:
    kill -9 <nginx-pid>
  5. Start the Nginx Server with VSP protection using the below command:
    /opt/virsec-web-mem/vsp_memory/vsp-memory <Nginx_Directory>/nginx
    OR
  6. Start the Nginx Server with VSP protection as a Service
    cd /etc/systemd/system/multi-user.target.wants 
    vi nginx.service
    1. Append the below text to the ExecStar argument
      /opt/virsec-web-mem/vsp_memory/vsp-memory
      Before Change:
      ExecStart=<Nginx_Directory>/nginx -g 'daemon on; master_process on;'
      After Change:
      ExecStart=/opt/virsec-web-mem/vsp_memory/vsp-memory <Nginx_Directory>/nginx -g 'daemon on; master_process on;'
    2. Save the file nginx.service
    3. Execute the below commands to start the service:
      systemctl daemon-reload
      systemctl start nginx
      



Was this article helpful?