linux – 如何启用UFW
作者:互联网
使用VPN和CLI的新功能.做了一些搜索,但仍然有一些混乱.在DigitalOcean上设置一个新站点,Ubuntu 16.04.2.完成LAMP设置过程并在设置过程后收到Apache成功页面.决定我会尝试使用Nginx而不是Apache来安装LEMP.我开始使用sudo apt-get install nginx输出
Errors were encountered while processing:
nginx-core
nginx
E: Sub-process /usr/bin/dpkg returned an error code (1)
看起来Nginx已正确安装,因为当前站点显示“welcome to nginx”页面,但在处理时显示错误.当我继续设置过程来调整防火墙时,我正在输入sudo ufw app list然后返回,
Available applications:
Apache
Apache Full
Apache Secure
Nginx Full
Nginx HTTP
Nginx HTTPS
OpenSSH
要允许HTTP配置文件,我使用sudo ufw允许’Nginx HTTP’并使用sudo ufw状态进行验证
状态输出正在显示
Status: inactive
我已经尝试过sudo systemctl enable ufw了
Synchronizing state of ufw.service with SysV init with /lib/systemd/systemd-sysv-install...
Executing /lib/systemd/systemd-sysv-install enable ufw
并仍然导致
Status: inactive
对此有任何帮助表示赞赏.
解决方法:
尝试
ufw enable
并通过再次运行确认它正在工作
ufw status
并确保通过运行ufw allow ssh将ssh添加到允许的应用程序中,而不是将自己锁定在开箱即用状态.
标签:nginx,linux,ufw,ubuntu-16-04,digital-ocean 来源: https://codeday.me/bug/20190611/1217168.html