Ahmia is the search engine for .onion
domains on the Tor anonymity
network. It is led by Juha Nurmi and is based
in Finland. This repository contains crawlers used by Ahmia search engine.
The newest version of Ahmia is built with Python 3, Django 5 and Elasticsearch 8. You will need to know these technologies to create a working Ahmia installation. Ahmia crawls using ahmia-crawler.
Ahmia-index should be installed and running
pip install -r requirements.txt
This is a common step, both for local (dev) and production environment.
cp ahmia/example.env ahmia/.env
Please modify the values in .env
, to fit your needs. You have to specify
at least the postgresql credentials, if you are using the production settings.
python manage.py makemigrations ahmia
python manage.py migrate
python manage.py collectstatic
/usr/local/share/ca-certificates/http_ca.crt
Development settings use sqlite as a database. Default settings should work out of the box.
python manage.py runserver
NOTE: If your deployment directory isn't /usr/local/lib/ahmia-site
replace accordingly
- Configure and run nginx:
cp conf/nginx/django-ahmia /etc/nginx/sites-enabled/django-ahmia
service nginx start
Increase worker_connections in /etc/nginx/nginx.conf:
events {
worker_connections 2048;
}
EITHER:
- Run gunicorn via bash scripts (work as daemons ~ edit files to change):
bash ./bin/run-ahmia.sh
bash ./bin/run-ahmia-onion.sh
OR
- configure and run gunicorn (tested with gunicorn==21.2.0) as systemd daemon
cp conf/gunicorn/*.service /etc/systemd/system/
systemctl daemon-reload
systemctl enable ahmia.service
systemctl status ahmia.service
systemctl enable ahmia-onion.service
systemctl status ahmia-onion.service
systemctl restart gunicorn
systemctl edit nginx
[Unit]
After=network-online.target remote-fs.target nss-lookup.target ahmia.service ahmia-onion.service
Requires=ahmia.service ahmia-onion.service
systemctl daemon-reload
systemctl cat nginx
# EVERY WEEK, Tuesday 12:57
57 12 * * 2 cd /usr/local/lib/ahmia-site && venv/bin/python manage.py deleteonions >> weeklydelete.log 2>&1
Ahmia is licensed under the 3-clause BSD license.