--- title: 建站记录(一)甲骨文永久免费服务器基础配置 tags: [] id: '1465' categories: - - 运维 date: 2022-02-17 16:05:05 --- ## 第一步 申请服务器 [https://zhuanlan.zhihu.com/p/352736372](https://zhuanlan.zhihu.com/p/352736372) ## 第二步 配置开机启动脚本 * 保存下面的脚本文件至 /root/iptab.sh * **设置权限** chmod 755 iptab.sh * DROP的行根据需要进行配置,目的是保护关键端口不暴露公网 * 下面脚本可以解决http无法访问的问题 ```shell #!/bin/bash /usr/sbin/iptables -P INPUT ACCEPT /usr/sbin/iptables -P FORWARD ACCEPT /usr/sbin/iptables -P OUTPUT ACCEPT /usr/sbin/iptables -F /usr/sbin/iptables -A INPUT ! -s 127.0.0.1 -p tcp --dport 54321 -j DROP /usr/sbin/iptables -A INPUT ! -s 127.0.0.1 -p tcp --dport 8888 -j DROP /usr/sbin/iptables -A INPUT ! -s 127.0.0.1 -p tcp --dport 5080 -j DROP ``` * nano /etc/rc.local * 编辑成下面的形式 ```shell #!/bin/sh -e ## rc.local #start script /root/iptab.sh #end script echo "added sucessfully!" > /tmp/added_script.log exit 0 ``` * 下面的方法启动顺序似乎不对,放弃 * **把脚本放置到启动目录下** cp iptab.sh /etc/init.d/ * **进入启动目录** cd /etc/init.d/ * **将脚本添加到启动脚本** update-rc.d iptab.sh defaults 90 * 如果要移除脚本:update-rc.d -f iptab.sh remove ## 第三步 安装宝塔面板 [https://pangwu86.com/posts/2992442120/](https://pangwu86.com/posts/2992442120/) ## 第四步 开启BBR ```shell wget -N --no-check-certificate "https://raw.githubusercontent.com/chiakge/Linux-NetSpeed/master/tcp.sh" && chmod +x tcp.sh && ./tcp.sh ```