移动端 | 加入收藏 | 设为首页 | 最新ss | 赞助本站 | RSS
 

freefq.comfree——免费、自由fq——翻墙

困在墙内,请发邮件到freefqcom#gmail.com获得最新免费翻墙方法!
您当前的位置:首页 > 网络翻墙技巧

V2Ray一周年记&V2Ray完全使用教程

时间:2016-08-24  来源:  作者: 条评论
讲的非常详细,
sudo vim /etc/init.d/v2ray #创建配置文件并粘贴下列内容   #!/bin/sh ### BEGIN INIT INFO # Provides:          v2ray # Required-Start:    $network $local_fs $remote_fs # Required-Stop:     $remote_fs # Default-Start:     2 3 4 5 # Default-Stop:      0 1 6 # Short-Description: socksv5 based proxy written by go. # Description:       v2ray is a socksv5 proxy written by go. Connection can be crypto by aes or #            des. this might help for people in China to corss GFW. ### END INIT INFO  # Author: Shell Xu <shell909090@gmail.com> # Modify: Isulew Li <netcookies@gmail.com>  # PATH should only include /usr/* if it runs after the mountnfs.sh script PATH=/sbin:/usr/sbin:/bin:/usr/bin   DESC=v2ray             # Introduce a short description here   NAME=v2ray             # Introduce the short server's name here   DAEMON=/usr/bin/v2ray  #这里改成v2ray程序的完整位置   PIDFILE=/var/run/$NAME.pid   LOGFILE=/var/log/$NAME.log   SCRIPTNAME=/etc/init.d/$NAME  DAEMON_OPTS="-config /etc/v2ray/config.json" #这里改成配置文件完整位置  # Exit if the package is not installed [ -x $DAEMON ] || exit 0  # Read configuration variable file if it is present [ -r /etc/default/$NAME ] && . /etc/default/$NAME  # Load the VERBOSE setting and other rcS variables . /lib/init/vars.sh  # Define LSB log_* functions. # Depend on lsb-base (>= 3.0-6) to ensure that this file is present. . /lib/lsb/init-functions  # # Function that starts the daemon/service # do_start()   {     # Return     #   0 if daemon has been started     #   1 if daemon was already running     #   2 if daemon could not be started     #   3 if configuration file not ready for daemon     start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null          || return 1     start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --background           --no-close -m -- $DAEMON_OPTS >> $LOGFILE 2>&1          || return 2     chmod -f 600 $LOGFILE     # Add code here, if necessary, that waits for the process to be ready     # to handle requests from services started subsequently which depend     # on this one.  As a last resort, sleep for some time. }  # # Function that stops the daemon/service # do_stop()   {     # Return     #   0 if daemon has been stopped     #   1 if daemon was already stopped     #   2 if daemon could not be stopped     #   other if a failure occurred     start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE     RETVAL="$?"     [ "$RETVAL" = 2 ] && return 2     # Wait for children to finish too if this is a daemon that forks     # and if the daemon is only ever run from this initscript.     # If the above conditions are not satisfied then add some other code     # that waits for the process to drop all resources that could be     # needed by services started subsequently.  A last resort is to     # sleep for some time.     start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON     [ "$?" = 2 ] && return 2     # Many daemons don't delete their pidfiles when they exit.     rm -f $PIDFILE     return "$RETVAL" }  # # Function that sends a SIGHUP to the daemon/service # do_reload() {       #     # If the daemon can reload its configuration without     # restarting (for example, when it is sent a SIGHUP),     # then implement that here.     #     start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE     return 0 }  case "$1" in     start)     [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME"     do_start     case "$?" in         0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;         2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;     esac   ;;   stop)     [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"     do_stop     case "$?" in         0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;         2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;     esac     ;;   status)        status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?        ;;   reload|force-reload)     #     # If do_reload() is not implemented then leave this commented out     # and leave 'force-reload' as an alias for 'restart'.     #     log_daemon_msg "Reloading $DESC" "$NAME"     do_reload     log_end_msg $?     ;;   restart|force-reload)     #     # If the "reload" option is implemented then remove the     # 'force-reload' alias     #     log_daemon_msg "Restarting $DESC" "$NAME"     do_stop     case "$?" in       0|1)         do_start         case "$?" in             0) log_end_msg 0 ;;             1) log_end_msg 1 ;; # Old process is still running             *) log_end_msg 1 ;; # Failed to start         esac         ;;       *)         # Failed to stop         log_end_msg 1         ;;     esac     ;;   *)     #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2     echo "Usage: $SCRIPTNAME {start|stop|status|reload|restart|force-reload}" >&2     exit 3     ;; esac 
在配置的/etc/init.d/v2ray中只需要修改两个地方就可以了,一个是主程序位置,一个是配置文件位置,都需要使用绝对位置。DAEMON=/usr/bin/v2ray这里填入主程序位置,假如自己的程序在/home/xxx/v2ray/v2ray中,需要 完整填入,这里的前一个v2ray为文件夹名,后一个v2ray为程序名。然后在DAEMON_OPTS="-config /etc/v2ray/config.json"这行后面的位置改成自己的配置文件位置,就变成了DAEMON_OPTS="-config /home/xxx/v2ray/vpoint_vmess_freedom.json
配置好保存后需要:
sudo chmod +x /etc/init.d/v2ray #更改权限   sudo update-rc.d v2ray defaults #设置开机启动   
官方的示例配置还告诉了如何使用shadowsocks协议以及各种其他协议使用方法。可以选择性的配置。

二、客户端的使用

这里主要就是从之前的下载v2ray服务端的网站,下载windows抑或是其他适合自己目前系统的客户端(客户端和服务端是一体的)。在配置中如果没其 他变动,配置文件中也就改个ip就能用了,原本Id也需要相同,但是如果服务端没有修改是默认的,那么客户端也无需修改。之后在浏览器也需要个扩展插件配 合,chrome的扩展omega或者firefox的autoproxy,其中配置成socks 127.0.0.1:1080就好了。
如果在服务端配置中还加上了shadowsocks的支持,那么也可以直接使用shadowsocks的客户端。

三、遇到什么问题?

1)vps硬盘被v2ray的日志占满了。tQJ免费翻墙网
/var/log/v2ray/error.log的日志文件过大,这个不确定是否是普遍性的问题,但是我确实遇到过,可以通过修改/etc/v2ray/config.json 中的
   "log" : {      "access": "/var/log/v2ray/access.log",      "error": "/var/log/v2ray/error.log", 
删除error,成为下列内容:
   "log" : {      "access": "/var/log/v2ray/access.log",      "": "/var/log/v2ray/error.log", 
修改保存后可以取消输出日志。我知道,这并不是一个好办法,不过可以暂时解决问题。

来源:https://www.v2ray.com/blog/2016/one-year.htmltQJ免费翻墙网

来顶一下
返回首页
返回首页
欢迎评论:免登录,输入验证码即可匿名评论 共有条评论
用户名: 密码:
验证码: 匿名发表

推荐资讯

Octohide VPN:快如闪电的免费VPN
Octohide VPN:快如闪
原子网络加速器 - 免费高速VPN 一键链接 方便快捷
原子网络加速器 - 免费
foxovpn绿狐VPN——即连即用、快速、安全
foxovpn绿狐VPN——即
Dubai VPN - Free, Fast & Secure VPN下载
Dubai VPN - Free, Fa
相关文章
栏目更新
栏目热门
墙外新闻
读者文摘

你可以访问真正的互联网了。You can access the real Internet.

管理员精中特别提醒:本网站域名、主机和管理员都在美国,且本站内容仅为非中国大陆网友服务。禁止中国大陆网友浏览本站!若中国大陆网友因错误操作打开本站网页,请立即关闭!中国大陆网友浏览本站存在法律风险,恳请立即关闭本站所有页面!对于您因浏览本站所遭遇的法律问题、安全问题和其他所有问题,本站均无法负责也概不负责。

特别警告:本站推荐各种免费科学上网软件、app和方法,不建议各位网友购买收费账号或服务。若您因付费购买而遭遇骗局,没有得到想要的服务,请把苦水往自己肚子里咽,本站无法承担也概不承担任何责任!

本站严正声明:各位翻墙的网友切勿将本站介绍的翻墙方法运用于违反当地法律法规的活动,本站对网友的遵纪守法行为表示支持,对网友的违法犯罪行为表示反对!

网站管理员定居美国,因此本站所推荐的翻墙软件及翻墙方法都未经测试,发布仅供网友测试和参考,但你懂的——翻墙软件或方法随时有可能失效,因此本站信息具有极强时效性,想要更多有效免费翻墙方法敬请阅读本站最新信息,建议收藏本站!本站为纯粹技术网站,支持科学与民主,支持宗教信仰自由,反对恐怖主义、邪教、伪科学与专制,不支持或反对任何极端主义的政治观点或宗教信仰。有注明出处的信息均为转载文章,转载信息仅供参考,并不表明本站支持其观点或行为。未注明出处的信息为本站原创,转载时也请注明来自本站。

鉴于各种免费翻墙软件甚至是收费翻墙软件可能存在的安全风险及个人隐私泄漏可能,本站提醒各位网友做好各方面的安全防护措施!本站无法对推荐的翻墙软件、应用或服务等进行全面而严格的安全测试,因此无法对其安全性做保证,无法对您因为安全问题或隐私泄漏等问题造成的任何损失承担任何责任!

S. Grand Ave.,Suite 3910,Los Angeles,CA 90071

知识共享许可协议
本作品采用知识共享署名-非商业性使用 4.0 国际许可协议进行许可。