我在 virtualbox 中设置了 Ubuntu 14.04 虚拟机,我正在尝试按照这些说明进行操作。
https://serversforhackers.com/an-ansible-tutorial
当我进入模块部分并尝试使用此命令安装 nginx 时。在 /etc/ansible/hosts 中将“local”设置为“localhost”
ansible local -s -m shell -a 'apt-get install nginx'
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
localhost | FAILED => Missing become password
Run Code Online (Sandbox Code Playgroud)
我在谷歌上搜索了一种方法来解决这个问题,但我不明白我做错了什么。
这是服务器操作系统的全新安装,唯一的设置是在本教程中完成的。
我全新安装了 Ubuntu 14.04 服务器。我已经安装了 nginx、php 等....
server {
listen 80;
listen [::]:80;
server_name testone.local;
root /var/www/htmlone;
index index.html;
# pass the PHP scripts to FastCGI server listening on the php-fpm socket
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location /alias {
alias /var/www/htmlalias;
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
}
Run Code Online (Sandbox Code Playgroud)
如果我在/var/www/htmlone
php 中使用一个简单的 php 脚本,它会按预期执行。如果我在/var/www/htmlalias
其中使用相同的脚本,则不会按预期执行。如果我将 …