Skip to main content

Posts

Showing posts from April, 2019

Internal Server Error + uWsgi + Python (While Updating Ubuntu from 16.04 to 18.04)

When I tried to upgrade my APP server from Ubuntu 16.04 to 18.04 with Python Django application after upgrade Python virtual env is giving the below error for the ./manage.py runserver command. " ImportError: cannot import name _remove_dead_weakref" For solving this error I have done the below fix: cd my-virtualenv-directory virtualenv . --system-site-packages The option --system-site-packages was needed because the application uses python-gtk from Ubuntu. I gues in most other cases it is not needed. Now after that the first error had gone and the below came up: ImportError: /environment-path/virt-env/local/lib/python2.7/site-packages/lxml/etree.so: undefined symbol: PyFPE_jbuf For solving this error I have done the below fix: sudo pip install --upgrade pyOpenSSL cryptography sudo pip uninstall lxml (Optional if needed only lxml is installed) sudo rm -rf /environment-path/virt-env//local/lib/python2.7/site-packages/lxml /environment-path/virt-env//local/li

Configuring NAXSI WebApplicationFirewall with NGINX & Ubuntu 18.04

 Initial Setup: ########### Nginx latest version installed : 1.14.0 Steps: ##### apt update apt install libpcre3-dev libssl-dev unzip build-essential daemon libxml2-dev libxslt1-dev libgd-dev libgeoip-dev Download and unzip naxis. wget https://github.com/nbs-system/naxsi/archive/master.zip unzip master.zip wget http://nginx.org/download/nginx-1.14.0.tar.gz;tar -xzvf nginx-1.14.0.tar.gz Now cd to the downloaded and untar'ed Nginx package directory. cd nginx-1.14.0 ./configure --conf-path=/etc/nginx/nginx.conf --add-module=../naxsi-master/naxsi_src/ --error-log-path=/var/log/nginx/error.log --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-log-path=/var/log/nginx/access.log --http-proxy-temp-path=/var/lib/nginx/proxy --lock-path=/var/lock/nginx.lock --pid-path=/var/run/nginx.pid --us