Phuks Installation
Ubuntu 16.04
curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo apt-get install git python3 mysql-server redis-server libboost-python-dev python3-pip wget libffi-dev libexiv2-dev make build-essential libssl-dev zlib1g-dev libbz2-dev libsqlite3-dev
sudo apt-get install libmysqlclient-dev
install pyenv - $curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
add to bash -
a. echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.bashrc
b. echo 'eval "$(pyenv init -)"' >> ~/.bashrc
c. echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
d. source ~/.bashrc
pyenv install 3.5.5
git clone https://phab.phuks.co/source/throat.git
cd throat
pyenv virtualenv 3.5.5 app
pyenv local app
pip install -r requirements.txt
npm -v
npm install
npm run build
cp example.config.py config.py
sudo nano config.py(change sql user and password and database)
a. change websocket_server = to ''(if redis is running on local host)
mysql -u root -p
create database phuks;
exit
mysql -u root -p
SET GLOBAL sql_mode='';
exit
sudo apt-get install nginx
cd scripts
python install.py
a. redis-server
gunicorn --worker-class eventlet -w 1 --bind 0.0.0.0 wsgi:app
attempt site access with the ip of your machine/vm :8000 if the site loads continue with next steps.
cd /etc/nginx/sites-available
sudo mv default default.bak
sudo nano default
server { listen 80; servername serverdomainorIP;
location / { include proxyparams; proxypass http://hostorip; } }
this should be your nginx config for default
sudo nginx -t
sudo service nginx restart
Login with admin:adminadmin
ENABLE CHAT nginx config
server { servername HOSTNAMEHERE; accesslog /var/log/nginx/poalco.log;
location /socket.io/ {
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://127.0.0.1:8000/socket.io/;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Fix Thumbs & Stor
In config.py change
THUMBNAILS_HOST = "/static/thumbs/"
STORAGE_HOST = "/static/stor/"
create stor & thumbs folders in throat
ENABLE EMOJIS
backup the database - mysqldump –u root -p databasename > /databasename.db
create a new one - mysql -u root -p create database poaldatabase;
mysql -u root -p SET GLOBAL sql_mode='';
open the backup database in text editor find and replace - utf6mb4 with utf8mb4 and latin1 with utf8mb4
mysql –u root -p databasename < databasename.db
This was a long time coming, and still probably sucks but its another improvement over the last attempt.