Set it up iptables so the server can run without sudo
This commit is contained in:
parent
0750c4afe3
commit
8ca27d3df2
|
@ -7,10 +7,12 @@ sudo apt-get -y install iptables-persistent
|
||||||
|
|
||||||
mkdir -p ~/go
|
mkdir -p ~/go
|
||||||
|
|
||||||
cat "export PATH=$PATH:/usr/lib/go-1.10/bin" >> ~/.bashrc
|
echo "export PATH=$PATH:/usr/lib/go-1.10/bin" >> ~/.bashrc
|
||||||
cat "export GOPATH=~/go" >> ~/.bashrc
|
echo "export GOPATH=~/go" >> ~/.bashrc
|
||||||
|
|
||||||
|
sudo cp rules.v4 /etc/iptables/rules.v4
|
||||||
|
|
||||||
source ~/.bashrc
|
source ~/.bashrc
|
||||||
go get -u gopkg.in/russross/blackfriday.v2
|
go get -u gopkg.in/russross/blackfriday.v2
|
||||||
go get -u https://github.com/shurcooL/github_flavored_markdown
|
go get -u github.com/shurcooL/github_flavored_markdown
|
||||||
go get -u github.com/sevlyar/go-daemon
|
go get -u github.com/sevlyar/go-daemon
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
# Generated by iptables-save v1.6.0 on Fri Sep 28 01:39:23 2018
|
||||||
|
*nat
|
||||||
|
:PREROUTING ACCEPT [0:0]
|
||||||
|
:INPUT ACCEPT [1:60]
|
||||||
|
:OUTPUT ACCEPT [2:120]
|
||||||
|
:POSTROUTING ACCEPT [2:120]
|
||||||
|
-A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8000
|
||||||
|
COMMIT
|
||||||
|
# Completed on Fri Sep 28 01:39:23 2018
|
||||||
|
# Generated by iptables-save v1.6.0 on Fri Sep 28 01:39:23 2018
|
||||||
|
*filter
|
||||||
|
:INPUT ACCEPT [4281:16446101]
|
||||||
|
:FORWARD ACCEPT [0:0]
|
||||||
|
:OUTPUT ACCEPT [3022:338342]
|
||||||
|
COMMIT
|
||||||
|
# Completed on Fri Sep 28 01:39:23 2018
|
Loading…
Reference in New Issue