用阿里云轻量VPS搭建V2ray和Trojan服务

点击数:626

背景:本人家里移动线路,1月份开了1个月阿里云轻量的vps,用起来还可以,但是为了 体验更快的科学上网速度(测速装逼),就买了两个机场,用了2个月,发现机场速度是要快些,但是各种不稳定,需要经常更换节点(后来用了Clash有很大改善,有机会专门写篇clash脚本配置的文章),但有时候还是会卡顿或者出现很多节点不可用,于是昨天又用回了阿里云轻量香港的vps, 发现还是阿里云用着稳,虽然只有30M带宽,但是很少断线,实测看油管和奈飞4K也没问题(我两次开通的VPS都能解锁奈飞,香港节点),每月24元人民币1T流量再也不用担心流量不够用了,以下是我在阿里云轻量服务器上搭建梯子的过程记录。

一、卸载阿里云盾和安骑士

本人选的是阿里云轻量LAMP的应用,开通后第一件事就是要删除vps上预装的监控,据说不删的话很容易被阿里给封掉。SSH登录后输入以下命令:

wget http://update.aegis.aliyun.com/download/uninstall.sh
chmod +x uninstall.sh
./uninstall.sh

wget http://update.aegis.aliyun.com/download/quartz_uninstall.sh
chmod +x quartz_uninstall.sh
./quartz_uninstall.sh

清理残留文件

pkill aliyun-service
rm -fr /etc/init.d/agentwatch /usr/sbin/aliyun-service
rm -rf /usr/local/aegis*

二、屏蔽阿里云盾IP地址

1,这里我查看了下阿里云轻量的vps并未安装iptables,因此首先安装iptables。

#先检查是否安装了iptables
service iptables status
#安装iptables
yum install -y iptables
#升级iptables
yum update iptables
#安装iptables-services
yum install iptables-services

#注册iptables服务
systemctl enable iptables.service
#开启服务
systemctl start iptables.service
#查看状态
systemctl status iptables.service

2,输入命令行屏蔽里云盾IP地址

iptables -I INPUT -s 140.205.225.183/32 -j DROP
iptables -I INPUT -s 140.205.225.206/32 -j DROP
iptables -I INPUT -s 140.205.225.205/32 -j DROP
iptables -I INPUT -s 140.205.225.195/32 -j DROP
iptables -I INPUT -s 140.205.225.204/32 -j DROP
iptables -I INPUT -s 140.205.201.0/28 -j DROP
iptables -I INPUT -s 140.205.201.16/29 -j DROP
iptables -I INPUT -s 140.205.201.32/28 -j DROP
iptables -I INPUT -s 140.205.225.192/29 -j DROP
iptables -I INPUT -s 140.205.225.200/30 -j DROP
iptables -I INPUT -s 140.205.225.184/29 -j DROP

#保存上述规则
service iptables save

# 重启防火墙
service iptables restart

三、使用一键脚本部署v2ray和trojan,这里可以参考我之前的文章

这里需要注意的是

1,安装trojan需要一个域名,而且要提前在自己的域名服务商或者DNS服务商(我的是cloudflare)将自己trojan专用三级域名绑定到阿里云轻量服务器的公网IP,这样才能正常解析安装。

2,安装trojan前要确保80和443端口不被占用,我的阿里云轻量服务因为提前预安装了lamp,所以80端口是在用的,一键安装trojan时提示80端口已经被http服务占用了,可以用命令查看http服务的PID号,然后用kill命令结束这个进程再次安装。

查看进程
ps aux
结束进程
kill xxx  #将xxx替换为查到的http进程的PID

3,trojan安装完成后,按照提示的链接去下载trojan-cli的压缩包,解压后在config文件里有trojan的三个重要参数,域名、端口、密钥。

 

点赞
  1. 钻网说道:

    春暖花开,下次再来!

  2. pornlist说道:

    This is a good blog, happy every day

  3. porn pics说道:

    Looks good!I like this!

  4. 择偶网说道:

    这个不错耶,我喜欢!

  5. James说道:

    What's up, the whole thing is going perfectly here and ofcourse every one is sharing information,
    that's in fact good, keep up writing.

  6. Alexis说道:

    I got this web page from my pal who informed me regarding this website and at the moment this
    time I am visiting this web page and reading very informative posts at this
    time.

  7. Raymond说道:

    Your method of telling all in this paragraph is genuinely nice, every one
    be capable of easily be aware of it, Thanks a lot.

  8. Ralph说道:

    Way cool! Some extremely valid points! I appreciate you penning this
    article plus the rest of the site is also very good.

  9. Diane说道:

    This text is invaluable. How can I find out more?

  10. Kathleen说道:

    I think that what you published made a bunch of sense.
    However, consider this, suppose you composed a catchier title?

    I ain't suggesting your content is not solid., but what if
    you added something that grabbed folk's attention? I
    mean 用阿里云轻量VPS搭建V2ray和Trojan服务 - 天天&笑笑的乐园 is
    kinda boring. You should look at Yahoo's home page and watch how
    they create post titles to grab people interested.

    You might add a related video or a related pic or two to get readers interested about everything've got to say.
    Just my opinion, it could make your posts a little
    bit more interesting.

  11. Frank说道:

    I was wondering if you ever considered changing the page layout of
    your blog? Its very well written; I love what youve got to say.
    But maybe you could a little more in the way of content so people could
    connect with it better. Youve got an awful lot of text for only having
    1 or two pictures. Maybe you could space
    it out better?

  12. Jesse说道:

    I'm not sure the place you are getting your information,
    but great topic. I needs to spend a while learning much more or figuring out more.

    Thank you for magnificent information I was on the lookout for
    this information for my mission.

  13. Stephanie说道:

    When I originally commented I clicked the "Notify me when new comments are added" checkbox and now each time a comment is added I get several emails
    with the same comment. Is there any way you
    can remove me from that service? Cheers!

  14. Rachel说道:

    If you are going for most excellent contents like myself, just pay a visit this web site every day since it presents quality
    contents, thanks

  15. Brian说道:

    Spot on with this write-up, I truly believe that this web site needs far more attention. I'll probably be back again to see more, thanks for the
    information!

  16. Melissa说道:

    I'm curious to find out what blog platform you're utilizing?

    I'm experiencing some minor security problems with my latest site and I would like to find something more risk-free.
    Do you have any recommendations?

  17. Eugene说道:

    Good day! I could have sworn I've been to this blog before but after looking at a few of
    the posts I realized it's new to me. Anyways, I'm definitely delighted I came across
    it and I'll be bookmarking it and checking back regularly!

  18. Steven说道:

    My brother suggested I might like this blog. He used to
    be totally right. This post truly made my day. You cann't believe just how so much
    time I had spent for this info! Thank you!

  19. Natalie说道:

    Everything is very open with a precise description of the issues.
    It was truly informative. Your website is very helpful.
    Thank you for sharing!

  20. Randy说道:

    Hey there just wanted to give you a quick heads up.
    The words in your content seem to be running off the screen in Safari.
    I'm not sure if this is a formatting issue or something to do with browser compatibility but I figured I'd post to let you know.
    The style and design look great though! Hope you get the problem fixed
    soon. Many thanks

  21. Daniel说道:

    Yes! Finally someone writes about Mary.

  22. Eric说道:

    Keep on writing, great job!

  23. Ronald说道:

    Hi, after reading this awesome paragraph i am as well glad to share my familiarity here with friends.

  24. Ann说道:

    Hi there, constantly i used to check weblog posts here in the
    early hours in the dawn, for the reason that i love to
    learn more and more.

  25. Ryan说道:

    Excellent post. Keep writing such kind of info on your
    blog. Im really impressed by your blog.
    Hey there, You've done an incredible job.
    I'll certainly digg it and personally suggest to my friends.

    I'm confident they'll be benefited from this site.

  26. Jessica说道:

    Hi, I do think this is a great blog. I stumbledupon it ;) I may come back once again since I book-marked it.

    Money and freedom is the greatest way to change, may you be rich and continue to guide others.

  27. Jane说道:

    This is the perfect blog for everyone who would like
    to find out about this topic. You realize a whole
    lot its almost hard to argue with you (not that I really will need to…HaHa).
    You certainly put a brand new spin on a subject that
    has been written about for decades. Great stuff, just wonderful!

  28. Stephanie说道:

    Do you have a spam issue on this blog; I also am a blogger, and I was wanting to know your situation;
    we have created some nice practices and we are looking to swap techniques
    with other folks, why not shoot me an e-mail if interested.

  29. shmoop.pro说道:

    WOW just what I was looking for. Came here by searching for 用阿里云轻量VPS搭建V2ray和Trojan服务天天&笑笑的乐园

  30. Christian说道:

    whoah this blog is wonderful i love reading your posts.
    Stay up the good work! You understand, many individuals are hunting round for this information, you can help them greatly.

  31. Vincent说道:

    Hey I know this is off topic but I was wondering if you
    knew of any widgets I could add to my blog that automatically tweet
    my newest twitter updates. I've been looking for a plug-in like this for quite
    some time and was hoping maybe you would have some experience with something like this.
    Please let me know if you run into anything. I truly enjoy reading your blog and I look
    forward to your new updates.

  32. Bruce说道:

    This design is incredible! You most certainly know
    how to keep a reader entertained. Between your
    wit and your videos, I was almost moved to start my own blog (well, almost...HaHa!) Wonderful job.
    I really loved what you had to say, and more than that, how you presented it.

    Too cool!

  33. Bradley说道:

    I'd like to find out more? I'd like to find out some additional information.

  34. Anthony说道:

    I'm truly enjoying the design and layout of your
    website. It's a very easy on the eyes which makes
    it much more enjoyable for me to come here and visit more often. Did you hire out a designer to create your theme?
    Excellent work!

  35. Nathan说道:

    I am actually glad to read this website posts which includes tons of helpful information,
    thanks for providing these kinds of information.

  36. Nicholas说道:

    What's up everyone, it's my first pay a quick visit at this site, and article is really fruitful designed for me,
    keep up posting these posts.

  37. Andrew说道:

    Pretty great post. I simply stumbled upon your weblog and wished to say that I have really
    enjoyed browsing your weblog posts. In any case I will be subscribing for your feed and I am hoping you write again soon!

  38. Anna说道:

    Thank you for the auspicious writeup. It in fact was a amusement account it.

    Look advanced to far added agreeable from you!
    However, how can we communicate?

  39. Juan说道:

    Magnificent web site. A lot of useful info here. I am sending it to several
    pals ans also sharing in delicious. And naturally, thanks for your effort!

  40. Rose说道:

    This piece of writing offers clear idea designed for the new visitors of blogging, that actually how to do blogging.

  41. Margaret说道:

    Thanks for every other informative site. The place
    else may I get that type of information written in such a perfect manner?
    I've a mission that I am just now operating on, and I've been on the look out for such information.

  42. Charles说道:

    I have been exploring for a little for any high quality articles or
    blog posts on this sort of space . Exploring in Yahoo I eventually
    stumbled upon this web site. Studying this information So i am glad to convey that I've a very
    excellent uncanny feeling I found out exactly what I needed.
    I so much for sure will make certain to do not put out
    of your mind this website and provides it a glance on a relentless basis.

  43. Mary说道:

    That is a good tip especially to those fresh to the blogosphere.
    Brief but very precise information… Many thanks
    for sharing this one. A must read post!

  44. Christopher说道:

    Thanks very nice blog!

  45. Karen说道:

    My partner and I stumbled over here different web page and thought I might
    as well check things out. I like what I see so now i'm following you.
    Look forward to finding out about your web page again.

  46. Brian说道:

    Remarkable things here. I'm very glad to peer
    your post. Thanks so much and I'm having a look forward to contact you.
    Will you kindly drop me a e-mail?

  47. Daniel说道:

    There's certainly a great deal to find out about this topic.
    I love all the points you have made.

  48. Jacqueline说道:

    I like the valuable information you provide in your articles.
    I will bookmark your blog and check again here frequently.

    I am quite certain I'll learn plenty of new stuff right here!
    Good luck for the next!

  49. Alice说道:

    Howdy! Do you use Twitter? I'd like to follow you if that would be ok.
    I'm definitely enjoying your blog and look forward to new updates.

  50. Alice说道:

    Heya! I'm at work browsing your blog from my new iphone 3gs!
    Just wanted to say I love reading through your blog and look forward to all your posts!

    Carry on the outstanding work!

  51. Hi there, I found your site by the use of Google even as searching for
    a similar subject, your site got here up,
    it appears great. I've bookmarked it in my google bookmarks.

    Hello there, simply turned into aware of your weblog thru Google,
    and found that it is really informative. I'm going to watch out for brussels.
    I'll appreciate if you happen to proceed this in future.

    Numerous other folks shall be benefited out of your writing.
    Cheers!

  52. guncelgiris.top说道:

    Keep on writing, great job!

  53. This is really interesting, You are a very
    skilled blogger. I have joined your rss feed and
    look forward to seeking more of your excellent post.
    Also, I've shared your web site in my social networks!

  54. My spouse and I stumbled over here coming from a different web page and
    thought I may as well check things out. I like what
    I see so now i am following you. Look forward to looking into
    your web page for a second time.

  55. Beverly说道:

    I have been surfing online greater than three hours as of late, but I never discovered any fascinating article like yours.
    It's beautiful price enough for me. In my opinion, if
    all website owners and bloggers made good content as you probably did, the internet shall be a lot more
    useful than ever before.

  56. Hey I know this is off topic but I was wondering if you knew of any widgets
    I could add to my blog that automatically tweet my newest twitter updates.
    I've been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something
    like this. Please let me know if you run into anything.

    I truly enjoy reading your blog and I look forward to your new updates.

  57. You should take part in a contest for one of the most useful websites on the net.
    I most certainly will highly recommend this website!

  58. My spouse and I stumbled over here coming from a
    different page and thought I might as well check things out.
    I like what I see so i am just following you.
    Look forward to checking out your web page repeatedly.

发表评论

电子邮件地址不会被公开。 必填项已用*标注