twistd一行服务器的方法,搭建DNS、Web文件服务器
来源:互联网 发布:联合利华二级销售 知乎 编辑:程序博客网 时间:2024/05/23 19:16
More twistd Examples
twistdships with many commands that make it easy to spin up simple services with zero
lines of code. Here are some examples:
twistd web --port 8080 --path .
Run an HTTP server on port 8080, serving both static and dynamic content out of
the current working directory. Visit http://localhost:8080to see the directory listing.
twistd dns -v -p 5553 --hosts-file=hosts
Run a DNS server on port 5553, resolving domains out of a file called hostsin the
format of /etc/hosts.
For example, say you’d like to run your own Twisted DNS resolver and are also
trying to cut back on social media. Create a hostsfile that resolves facebook.com,
twitter.com, and reddit.comto localhost, 127.0.0.1:
127.0.0.1 facebook.com
127.0.0.1 twitter.com
127.0.0.1 reddit.com
Then run your twistdDNS resolver, configure your operating system to try that
resolver first, and effectively disable your ability to view those sites.
A quick command-line way to prove that the resolver is working is to use the dig
DNS lookup utility. First, query the default resolver, then query the twistd resolver:
$ dig +short twitter.com
199.59.150.7
199.59.148.10
199.59.150.39
$ dig @localhost -p 5553 +short twitter.com
127.0.0.1
sudo twistd conch -p tcp:2222
Run an sshserver on port 2222. sshkeys must be set up independently.
twistd mail -E -H localhost -d localhost=emails
Run an ESMTP POP3 server, accepting email for localhostand saving it to the emails
directory.
I don’t know about you, but I get pretty excited by the networking power of these simple
twistdone-liners.
twistdships with many commands that make it easy to spin up simple services with zero
lines of code. Here are some examples:
twistd web --port 8080 --path .
Run an HTTP server on port 8080, serving both static and dynamic content out of
the current working directory. Visit http://localhost:8080to see the directory listing.
twistd dns -v -p 5553 --hosts-file=hosts
Run a DNS server on port 5553, resolving domains out of a file called hostsin the
format of /etc/hosts.
For example, say you’d like to run your own Twisted DNS resolver and are also
trying to cut back on social media. Create a hostsfile that resolves facebook.com,
twitter.com, and reddit.comto localhost, 127.0.0.1:
127.0.0.1 facebook.com
127.0.0.1 twitter.com
127.0.0.1 reddit.com
Then run your twistdDNS resolver, configure your operating system to try that
resolver first, and effectively disable your ability to view those sites.
A quick command-line way to prove that the resolver is working is to use the dig
DNS lookup utility. First, query the default resolver, then query the twistd resolver:
$ dig +short twitter.com
199.59.150.7
199.59.148.10
199.59.150.39
$ dig @localhost -p 5553 +short twitter.com
127.0.0.1
sudo twistd conch -p tcp:2222
Run an sshserver on port 2222. sshkeys must be set up independently.
twistd mail -E -H localhost -d localhost=emails
Run an ESMTP POP3 server, accepting email for localhostand saving it to the emails
directory.
I don’t know about you, but I get pretty excited by the networking power of these simple
twistdone-liners.
0 0
- twistd一行服务器的方法,搭建DNS、Web文件服务器
- twistd工具搭建mail服务器
- DNS服务器的搭建
- 文件服务器与web服务器分离的的
- DNS主从服务器的搭建
- DNS域名解析服务器的搭建
- 主从DNS服务器的搭建
- 文件服务器与web服务器是两台机器的解决方案
- 局域网文件服务器的搭建
- FastDFS 文件服务器的搭建
- 搭建linux下apache web服务器 dns服务器
- CentOS6服务管理之DNS-主从DNS服务器的搭建
- centos6.5环境DNS-本地DNS服务器bind的搭建
- DNS服务器的搭建(二)
- linux DNS服务器的搭建(bind)
- Linux下DNS服务器的搭建
- Centos6环境下DNS服务器的搭建
- 简单的dns主从服务器搭建实验
- [shell]常用语句
- 开源ffmpeg项目记录
- HDU 5410 CRB and His Birthday(完全背包)——多校练习10
- 集合的遍历
- [Daily150820]I,java
- twistd一行服务器的方法,搭建DNS、Web文件服务器
- 146. Binary Tree Postorder Traversal
- 面向对象与面向过程的编程思想比较
- Windows Server AppFabric Caching
- ImageView与手势识别
- CRB and String(HDUOJ--5414
- poj 3233 矩阵快速幂
- css基础精华02
- css基础精华03