sudo apt install postgresql nodejs npm python3-pip apache2 apache2-dev libapache2-mod-wsgi-py3 libssl1.0-dev
- Login as postgres user:
sudo -i -u postgres
- Open postgres shell:
psql
- Create database and user:
CREATE DATABASE your_db_name;
CREATE USER your_user WITH PASSWORD ‘your_password’;
GRANT ALL PRIVILEGES ON DATABASE your_db_name TO your_user;
- Add extension for fulltext search:
\c your_db_name
CREATE EXTENSION pg_trgm;
\q
- You may need to change local connections from peer to md5 in postgres config file (with vim or your prefered text editor):
sudo vim /etc/postgresql/10/pg_hba.conf
Note that the path the pg_hba.conf may vary based on your postgres version.
Fill in the database info in text-pair config: sudo vim /etc/text-pair/config/global_settings.ini
sudo mkdir /var/www/html/text-pair/
sudo chown -R $(whoami) /var/www/html/text-pair/
sudo a2enmod rewrite
sudo vim /etc/apache2/apache2.conf
Change AllowOverride from None to All
Add the following at the bottom of the file (to execute the wsgi search script):
Include /etc/text-pair/*conf
- Restart Apache:
sudo apachectl graceful
If you get a syntax error for the Include directive in Apache, replace that line with:
IncludeOptional /etc/text-pair/*conf
Run the following script at the root of the text-pair folder:
sh install.sh