安装
1. 将压缩包下载到/var/www/目录中并解压
wget https://github.com/SSilence/selfoss/releases/download/2.15/selfoss-2.15.zip
2. 给相应的文件夹权限
chmod 775 data/cache data/favicons data/logs data/thumbnails data/sqlite public/ controllers/
3. 创建并修改应用配置文件
https://selfoss.aditu.de/docs/administration/options/
cp defaults.in config.in 按照官网修改相应信息
4. 为应用创建nginx配置
cd /etc/nginx/conf.d/ sudo editor selfoss.conf
其中selfoss内容如下:
server { listen 0.0.0.0:80; listen 443 ssl; server_name localhost; root /var/www/selfoss/; access_log /var/log/nginx/rss.access.log; error_log /var/log/nginx/rss.error.log; location ~* \ (gif|jpg|png) { expires 30d; } location ~ ^/favicons/.*$ { try_files $uri /data/$uri; } location ~ ^/thumbnails/.*$ { try_files $uri /data/$uri; } location ~* ^/(data\/logs|data\/sqlite|config\.ini|\.ht) { deny all; } location / { index index.php index.html index.htm; try_files $uri /public/$uri /index.php$is_args$args; } location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }
5. 配置php
在php7.2中 5.1 cd /etc/php/7.2/fpm sudo editor php.ini 修改 cgi.fix_pathinfo=1 为cgi.fix_pathinfo=0 5.2 cd /etc/php/7.2/fpm/pool.d sudo editor www.conf 修改listen为listen = 127.0.0.1:9000 否则报502错误
6. 重启php-fpm
sudo systemctl restart php7.2-fpm.sevice sudo systemctl enable php7.2-fpm.sevice
7. 用户权限
sudo chown -R www-data:www-data /var/www/selfoss/
8. 重启nginx
sudo systemctl restart nainx.service sudo systemctl enable nginx.service
9. 定时更新源
sudo crontab -e 添加:*/30 * * * * /usr/bin/curl -Ls 'http://rss.yourdomain.com/update' >/dev/null sudo systemctl start cron
10. 登录
访问https://your_selfoss_url.com/password,获取哈希后的密码,填入到ini中,登录即可
设置代理
在/selfoss/spouts/rss/feed.php 中为rss feed模块设置代理
参考:https://github.com/fossar/selfoss/issues/871
在154行左右
@$this->feed->set_feed_url(htmlspecialchars_decode($params[‘url’]));
@$this->feed->set_autodiscovery_level( SIMPLEPIE_LOCATOR_AUTODISCOVERY | SIMPLEPIE_LOCATOR_LOCAL_EXTENSION | SIMPLEPIE_LOCATOR_LOCAL_BODY);
$this->feed->set_useragent(\helpers\WebClient::getUserAgent(array(‘SimplePie/’.SIMPLEPIE_VERSION)));
下面添加
$this->feed->set_curl_options(array(CURLOPT_PROXY => ‘localhost:9050‘, CURLOPT_PROXYTYPE => ‘CURLPROXY_SOCKS5’));
问题解决
遗留问题
nginx跨域不生效