项目作者: krlex

项目描述 :
Installation Wordpress for CentOS, Fedora, Ubuntu, Debian
高级语言: PHP
项目地址: git://github.com/krlex/wordpress-box-nginx.git
创建时间: 2019-10-18T16:49:28Z
项目社区:https://github.com/krlex/wordpress-box-nginx

开源协议:

下载


WordPress + Nginx Ansible Playbook

Ansible playbook and roles for installing WordPress + Nginx + PHP + Postfix server

Requirements

  • Ansible 2.0.0 or newer
  • Ubuntu 18.04 (installed on your web server or virtual machine)

Instructions:

1. Configure your web server for ssh

Allow connections from your development machine to the web server over ssh. This is essential for ansible to work, so make sure to configure your remote or local server to allow connections via ssh. You may find ssh-copy-id helpful.

You can skip the step below if you’re not using vagrant and replace 10.1.10.10 with your websever’s IP address, but make sure you’re able to SSH into your web server before continuing.

If you’re using vagrant add these lines to your Vagrantfile:

  1. config.vm.network :forwarded_port, guest: 80, host: 4567
  2. config.vm.network "private_network", ip: "10.1.10.10"

This allows a connection to the machine over ssh on the specified IP address. "10.1.100.10" can be swapped out for a different IP, but make sure it matches whatever is set in your ansible inventory file.

Run vagrant ssh-config to see where your key is stored, and create or update your host machine’s ~/.ssh/config file. It should looks something like this with your IdentityFile switched out:

  1. Host 10.1.10.10
  2. StrictHostKeyChecking no
  3. UserKnownHostsFile /dev/null
  4. IdentitiesOnly yes
  5. User vagrant
  6. IdentityFile /Users/joshua/Boxes/bento/ubuntu-16.04/.vagrant/machines/default/virtualbox/private_key
  7. PasswordAuthentication no

Verify that you’re able to ssh into the machine:

ssh vagrant@10.1.10.10

2. Clone the repository

  1. $ git clone https://github.com/tucsonlabs/ansible-wordpress-nginx-playbook.git
  2. $ cd /wordpress-nginx

3. Run the playbook

This tells ansible to use the inventory file we’ve called “hosts”. If you’re using vagrant you can run the same command as above but exclude the username and sudo prompt:

  1. $ ansible-playbook -i inventory/localhost playbook.yml -c local

5. Finish the install

Open your web browser and navigate to http://10.1.10.10 (or your webserver’s IP) to finish the WordPress installation.