9

Phuks Installation

Ubuntu 16.04

  1. curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -

  2. sudo apt-get install -y nodejs

  3. 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

  4. sudo apt-get install libmysqlclient-dev

  5. install pyenv - $curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash

  6. 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

  1. pyenv install 3.5.5

  2. git clone https://phab.phuks.co/source/throat.git

  3. cd throat

  4. pyenv virtualenv 3.5.5 app

  5. pyenv local app

  6. pip install -r requirements.txt

  7. npm -v

  8. npm install

  9. npm run build

  10. cp example.config.py config.py

  11. sudo nano config.py(change sql user and password and database)

a. change websocket_server = to ''(if redis is running on local host)

  1. mysql -u root -p

  2. create database phuks;

  3. exit

  4. mysql -u root -p

  5. SET GLOBAL sql_mode='';

  6. exit

  7. sudo apt-get install nginx

  8. cd scripts

  9. python install.py

a. redis-server

  1. gunicorn --worker-class eventlet -w 1 --bind 0.0.0.0 wsgi:app

  2. attempt site access with the ip of your machine/vm :8000 if the site loads continue with next steps.

  3. cd /etc/nginx/sites-available

  4. sudo mv default default.bak

  5. sudo nano default

  6. server { listen 80; servername serverdomainorIP;

    location / { include proxyparams; proxypass http://hostorip; } }

this should be your nginx config for default

  1. sudo nginx -t

  2. sudo service nginx restart

  3. 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

Phuks Installation Ubuntu 16.04 1. curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash - 2. sudo apt-get install -y nodejs 3. 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 4. sudo apt-get install libmysqlclient-dev 5. install pyenv - $curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash 6. 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 7. pyenv install 3.5.5 8. git clone https://phab.phuks.co/source/throat.git 9. cd throat 10. pyenv virtualenv 3.5.5 app 11. pyenv local app 12. pip install -r requirements.txt 13. npm -v 14. npm install 15. npm run build 16. cp example.config.py config.py 17. sudo nano config.py(change sql user and password and database) a. change websocket_server = to ''(if redis is running on local host) 18. mysql -u root -p 19. create database phuks; 20. exit 21. mysql -u root -p 22. SET GLOBAL sql_mode=''; 23. exit 24. sudo apt-get install nginx 25. cd scripts 26. python install.py a. redis-server 27. gunicorn --worker-class eventlet -w 1 --bind 0.0.0.0 wsgi:app 28. attempt site access with the ip of your machine/vm :8000 if the site loads continue with next steps. 29. cd /etc/nginx/sites-available 30. sudo mv default default.bak 31. sudo nano default 32. server { listen 80; server_name server_domain_or_IP; location / { include proxy_params; proxy_pass http://host_or_ip; } } this should be your nginx config for default 33. sudo nginx -t 34. sudo service nginx restart 35. Login with admin:adminadmin ENABLE CHAT nginx config server { server_name HOSTNAMEHERE; access_log /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

4 comments

[–] pmyb2 [OP] 1 points (+1|-0)

This was a long time coming, and still probably sucks but its another improvement over the last attempt.

[–] JoeKerr 0 points (+0|-0)

Good work soldier!