---------------------------nginx的安装和配置--------------------------------------------------------------------------------
//安装nginx from nginx.org
wget http://nginx.org/keys/nginx_signing.key
sudo apt-key add nginx_signing.key //For Debian/Ubuntu
vim /etc/apt/sources.list//加入
deb http://nginx.org/packages/ubuntu/ Codename nginx
deb-src http://nginx.org/packages/ubuntu/ Codename nginx
//Version Codename Supported Platforms 其他系统和版本从http://nginx.org/en/linux_packages.html#distributions查看
//12.04 precise x86_64, i386
//14.04 trusty x86_64, i386, aarch64/arm64
//16.04 xenial x86_64, i386, ppc64el
vim /etc/nginx/nginx.conf//修改nginx配置文件,加入server选项
//nginx.conf文件结构,main->http>server->location
server {
listen 10129;
server_name 168.235.85.242;#自己PC的ip或者服务器的域名,通过168.235.85.242:10129访问
charset utf-8; # 避免中文乱码
root /var/www; # 存放文件的目录
auth_basic "input you user name and password"; # 登录提示
auth_basic_user_file /var/nginx/conf/vhost/nginx_passwd; #登陆者用户名和密码以文件的形式存放
location / {
autoindex on; # 索引
autoindex_exact_size on; # 显示文件大小
autoindex_localtime on; # 显示文件时间
}
//登陆者用户名和密码的文件配置方法
sudo vim /var/nginxpasswd
//加入用户名和密码
onerous:password1//userName:Password
user2:pass2
user3:pass3
//对文件的用户进行加密,例如
htpasswd /var/nginxpasswd onerous
nginx -s reload //成功启动nginx后,文件放入/var/www ,例如test.zip,通过 168.235.85.242/test.zip即可下载文件
常见错误
1.错误nginx: [warn] conflicting server name "localhost" on 0.0.0.0:80, ignored
解决方法:删除/etc/nginx/sites-enabled下的default文件,然后nginx -s reload
2.error pid /var/run/nginx.pid can't
-------------------------------------------------------------------------------------------------------------------------------------
安装transmission
sudo apt-get install transmission
sudo apt-get install transmission-daemon transmission-cli
sudo service transmission-daemon stop
vim /etc/transmission-daemon/settings.json 将"rpc-whitelist-enabled": true,这一句中的true改为false,)
transmission-daemon -t -u your_username -v your_password -w /var/www -g /etc/transmission-daemon///设置用户和密码,your_username和your_password改为自己想设置的账号和密码,/var/www即为上面nginx 的root目录
//transmission-daemon -t -u onerous -v password1 -w /var/www -g /etc/transmission-daemon
设置下载目录的访问权限
chmod -R 777 /var/www
添加执行权限即可
//chmod -R 777 /var/lib/transmission-daemon/info/settings.json
chmod -R 777/etc/transmission-daemon/settings.json
sudo service transmission-daemon start
浏览器访问http://your_ip:9091/transmission/web/输入账号密码即可
-------------------shdowsock配置文件(IPV6与多端口)---------------------------------------------------
{
"server":"::",
"local_address": "127.0.0.1",
"local_port":1080,
"port_password":{
"10128":"shadow0128r",
"9001":"password1",
"9002":"password2",
"9003":"password3",
"9004":"password4"
},
"timeout":300,
"method":"aes-256-cfb",
"fast_open": false
}
//安装nginx from nginx.org
wget http://nginx.org/keys/nginx_signing.key
sudo apt-key add nginx_signing.key //For Debian/Ubuntu
vim /etc/apt/sources.list//加入
deb http://nginx.org/packages/ubuntu/ Codename nginx
deb-src http://nginx.org/packages/ubuntu/ Codename nginx
//Version Codename Supported Platforms 其他系统和版本从http://nginx.org/en/linux_packages.html#distributions查看
//12.04 precise x86_64, i386
//14.04 trusty x86_64, i386, aarch64/arm64
//16.04 xenial x86_64, i386, ppc64el
vim /etc/nginx/nginx.conf//修改nginx配置文件,加入server选项
//nginx.conf文件结构,main->http>server->location
server {
listen 10129;
server_name 168.235.85.242;#自己PC的ip或者服务器的域名,通过168.235.85.242:10129访问
charset utf-8; # 避免中文乱码
root /var/www; # 存放文件的目录
auth_basic "input you user name and password"; # 登录提示
auth_basic_user_file /var/nginx/conf/vhost/nginx_passwd; #登陆者用户名和密码以文件的形式存放
location / {
autoindex on; # 索引
autoindex_exact_size on; # 显示文件大小
autoindex_localtime on; # 显示文件时间
}
//登陆者用户名和密码的文件配置方法
sudo vim /var/nginxpasswd
//加入用户名和密码
onerous:password1//userName:Password
user2:pass2
user3:pass3
//对文件的用户进行加密,例如
htpasswd /var/nginxpasswd onerous
nginx -s reload //成功启动nginx后,文件放入/var/www ,例如test.zip,通过 168.235.85.242/test.zip即可下载文件
常见错误
1.错误nginx: [warn] conflicting server name "localhost" on 0.0.0.0:80, ignored
解决方法:删除/etc/nginx/sites-enabled下的default文件,然后nginx -s reload
2.error pid /var/run/nginx.pid can't
-------------------------------------------------------------------------------------------------------------------------------------
安装transmission
sudo apt-get install transmission
sudo apt-get install transmission-daemon transmission-cli
sudo service transmission-daemon stop
vim /etc/transmission-daemon/settings.json 将"rpc-whitelist-enabled": true,这一句中的true改为false,)
transmission-daemon -t -u your_username -v your_password -w /var/www -g /etc/transmission-daemon///设置用户和密码,your_username和your_password改为自己想设置的账号和密码,/var/www即为上面nginx 的root目录
//transmission-daemon -t -u onerous -v password1 -w /var/www -g /etc/transmission-daemon
设置下载目录的访问权限
chmod -R 777 /var/www
添加执行权限即可
//chmod -R 777 /var/lib/transmission-daemon/info/settings.json
chmod -R 777/etc/transmission-daemon/settings.json
sudo service transmission-daemon start
浏览器访问http://your_ip:9091/transmission/web/输入账号密码即可
-------------------shdowsock配置文件(IPV6与多端口)---------------------------------------------------
{
"server":"::",
"local_address": "127.0.0.1",
"local_port":1080,
"port_password":{
"10128":"shadow0128r",
"9001":"password1",
"9002":"password2",
"9003":"password3",
"9004":"password4"
},
"timeout":300,
"method":"aes-256-cfb",
"fast_open": false
}