# 安装 themismin ## 添加数据库 mysql -hlocalhost -uroot -p CREATE DATABASE themismin; create user 'themismin'@'%' identified by 'themismin'; GRANT ALL PRIVILEGES ON themismin.* TO 'themismin'@'%'; show grants for'themismin'@'%'; FLUSH PRIVILEGES; exit ## 添加项目文件 cd /var/www/ git clone git@git.coding.net:ThemisMin/themismin.git cd themismin/htdoc/ composer install -vvv composer run-script post-root-package-install composer run-script post-create-project-cmd composer run-script post-install-cmd vim .env composer run-script post-install-cmd php artisan migrate --seed php artisan spider:site-init ## 设置项目用户 cd /var/www/themismin useradd -s /sbin/nologin -g nginx themismin usermod -s /bin/bash themismin sh release_prod.sh ## 设置项目任务 crontab -u themismin -e
# 安装 friso 分词 cd /opt/ git clone https://git.oschina.net/lionsoul/friso.git cd /opt/friso/src/ make make install cp /usr/lib/libfriso.so /usr/lib64/ ## 使用 friso friso -init /opt/friso/friso.ini
# 安装 scws 分词 cd /opt/ wget http://www.xunsearch.com/scws/down/scws-1.2.3.tar.bz2 tar xvjf scws-1.2.3.tar.bz2 cd scws-1.2.3/ ./configure --enable-namerule --prefix=/usr/local/scws make make install /usr/local/scws/bin/scws -h ## 添加词典 cd /opt/ wget http://www.xunsearch.com/scws/down/scws-dict-chs-utf8.tar.bz2 tar xvjf scws-dict-chs-utf8.tar.bz2 mv dict.utf8.xdb /usr/local/scws/etc/ ## 安装 php-scws 扩展 cd /opt/scws-1.2.3/phpext/ phpize ./configure --help ./configure --with-scws=/usr/local/scws make make install cd /etc/php-zts.d/ vim 40-scws.ini cp 40-scws.ini /etc/php.d/ php -m systemctl restart php-fpm