我想附上这段文字:
<Directory "/var/www/*">
Order allow,deny
Allow from all
AllowOverride All
</Directory>
Run Code Online (Sandbox Code Playgroud)
到文件 /etc/apache2/apache2.conf
我可以通过 SSH 访问,但我不知道如何使用 VIM。我想通过命令来做到这一点。
mkm*_*mkm 17
此语法称为“HERE 文档”:
sudo tee -a /tmp/file <<EOF
<Directory "/var/www/*">
Order allow,deny
Allow from all
AllowOverride All
</Directory>
EOF
Run Code Online (Sandbox Code Playgroud)
此解决方案比使用 ctrl-d 更好,因为它可以在 shell 脚本中使用。
Use:
nano /etc/apache2/apache2.conf
Run Code Online (Sandbox Code Playgroud)
(you may need to use sudo
)
This will give you a command line text editor that works much like normal text editors. Use the arrow keys to navigate. Backspace, enter, etc. work as normal.
要保存,请按Ctrl+O并使用Ctrl+X退出。如需帮助,请从 nano 内部按Ctrl+ G,或使用man nano
.
它应该是这样的: