$ python -m venv venv
* Note: Make sure you are using python v3
$ source venv/bin/activate
For Windows OS:
$ .\venv\Scripts\activate
(venv) $ pip install -r requirements.txt
(venv) $ python app.py
* Note: This way of running the project is good for development and testing only, for production deployment you better use a WSGI server
(venv) $ deactivate
Debian
$ sudo apt-get install apache2
RHEL/CentOS
$ sudo yum install httpd
$ sudo systemctl --now enable httpd
* Note: Make sure that the Apache web server has been properly set-up open your web browser and point it to the server IP address. You should see a simple "It works!" page. * Note: Enable the ports used
Debian
$ sudo apt-get install libapache2-mod-wsgi
$ sudo a2enmod wsgi
RHEL/CentOS
$ sudo yum install mod_wsgi
$ sudo systemctl restart httpd
Debian & RHEL/CentOS
$ sudo mv /path/CVE-Monitor /var/www/html/CVE-Monitor
Debian & RHEL/CentOS
$ sudo nano /var/www/html/CVE-Monitor/app.wsgi
The file should look something like this:
#!/usr/bin/python3
import sys
import logging
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0,"/var/www/html/CVE-Monitor/")
from app import app as application
Debian
$ sudo nano /etc/apache2/sites-available/CVE-Monitor.conf
RHEL/CentOS
$ sudo nano /etc/httpd/conf.d/CVE-Monitor.conf
<VirtualHost *:80>
# Be sure to change the ServerName to your domain or IP address
ServerName domain.com
# If you’re using global Python installation, no need to include python-path directive
WSGIDaemonProcess CVE-Monitor python-path=/var/www/html/CVE-Monitor: /path/lib/python3/site-packages
WSGIProcessGroup CVE-Monitor
# Give an alias (/cve) to start the website url with
WSGIScriptAlias /cve /var/www/html/CVE-Monitor/app.wsgi
<Directory /var/www/html/CVE-Monitor/>
# Set permissions as per apache2.conf file
Require all granted
</Directory>
Alias /static /var/www/html/CVE-Monitor/static
<Directory /var/www/html/CVE-Monitor/static/>
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Enable the new virtual host
Debian
$ sudo a2ensite CVE-Monitor.conf
Debian
$ sudo service apache2 restart
RHEL/CentOS
$ sudo systemctl restart httpd
- Make sure to open the needed ports for apache on your server firewall (port 80 for http or port 443 for https)
- If you are using SELinux then allow apache to access the network since it needs it to get the cve data from the internet.
- The errors from the python code will be stored in apache error file under
/var/log/
It's recommended to install the Apache distribution from Apache Lounge (www.apachelounge.com).
After downloading Apache, extract the file contents to a suitable location on your server. By default, Apache configuration file assumes that Apache is extracted to “C:\Apache24” directory.
- If it’s not extracted there, you need to update the ${SRVROOT} variable in "Apache24\conf\httpd.conf" file
$ Define SRVROOT “c:/path/Apache24”
Open a command prompt and Run as Administrator, move to “bin” folder
$ cd c:\Apache24\bin
$ httpd.exe -k install
$ httpd.exe -k start
* Note: Make sure that the Apache web server has been properly set-up open your web browser and point it to the server IP address. You should see a simple "It works!" page
* Note: Microsoft Visual C++ compiler need to be installed in order to install mod_wsgi
You can download and install “Build tools for Visual Studio” from https://visualstudio.microsoft.com/downloads/
* Note: If the Apache is installed in a path other than"c:/Apach24" you need to set the path
$ set "MOD_WSGI_APACHE_ROOTDIR= path\Apache24"
$ pip install mod_wsgi
$ mod-wsgi-express module-config
The output should be something like this:
LoadFile "c:/...../local/programs/python/python36/python36.dl"
LoadModule wsgi_module "c:/...../lib/site-packages/mod_wsgi/server/mod_wsgi.cp36-win_amd64.pyd"
WSGIPythonHome "c:/...../local/programs/python/python36"
Copy the output and paste it at the end of "Apache24\conf\httpd.conf" file
Place CVE-Monitor app in "path\Apache24\htdocs"
Go to "path\Apache24\htdocs\CVE-Monitor\app.wsgi"
The file should look something like this:
#!/usr/bin/python3
import sys
import logging
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0,"htdocs/CVE-Monitor/")
from app import app as application
Go to "path\Apache24\conf\extra\httpd-vhosts.conf" and add the following:
<VirtualHost *:80>
ServerName (domain.com)
WSGIScriptAlias /cve "htdocs/CVE-Monitor/app.wsgi"
DocumentRoot "htdocs/CVE-Monitor/"
<Directory "htdocs/CVE-Monitor">
Require all granted
</Directory>
ErrorLog "logs/error.log"
CustomLog "logs/access.log" common
</VirtualHost>
* Note: If you're not using port 80 make sure to add the port number to "path\Apache24\conf\httpd.conf"
Listen <port No>
Go to "path\Apache24\conf\httpd.conf", uncomment the "Include" line
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
$httpd.exe -k restart
Note: The implemented SSE (server sent events) technology is not supported by Microsoft's Internet Explorer or Edge.