安裝nginx
yum -y install nginx
安裝tor
yum -y install tor
配置nginx
vi /etc/nginx/nginx.conf
server{
listen 80 default_server;
...
}
然後重啓nginx讓配置生效
Linux CentOS 7 下重啓服務不再通過 service 操作,而是通過 systemctl 操作。
查看:systemctl status nginx.service
啓動:systemctl start nginx.service
重啓:systemctl restart nginx.service
自啓:systemctl enable nginx.service
systemctl start nginx.service
然後試試配置是否生效
訪問 http://你的IP
如果可以訪問,則成功生效!
然後再來配置tor
vi /etc/tor/torrc
添加以下兩行
HiddenServiceDir /var/lib/tor/hidden_service/
HiddenServicePort 80 127.0.0.1:8080
保存好文件,然後啓動
systemctl start tor.service
進入tor查看.onion
cd /var/lib/tor/hidden_service/
cat hostname
然後就會看見
sbbdzlkpmwhiguvc.onion
最後使用tor瀏覽器訪問一下就可以看見網頁的內容