官术网_书友最值得收藏!

Configuring the web server

In order for the web server to deploy the web app, we need to add the required roles to the web server, as we did with the database server:

knife node run_list add web00 "role[base_server]"
knife node run_list add web00 "role[web_server]"

Now, we can execute chef-client on the web host (again making sure to use sudo so that it has permission to do its work):

[jewart]% knife ssh 'name:web00' -x ubuntu 'sudo chef-client'

At this point, our web server will be in the following state:

  • The following required packages will be installed:
    • Python 2.7 and development libraries
    • The PostgreSQL client development libraries
    • Git
  • The directories our application needs to run are created
  • A virtualenv tool, which is based on the system Python 2.7 is created
  • Our application has been checked out from GitHub
  • A configuration file in /opt/webapp/src/config.py is created by Chef
  • Supervisord is configured to run our application and starts the server.py daemon

Now, you should be able to visit your newly installed web application at the following URL:

http://your-new-ec2-instance-hostname:8080

If you don't see your application, make sure that each of the preceding steps was successful.

主站蜘蛛池模板: 军事| 海宁市| 仁怀市| 祁东县| 丰城市| 吉安市| 项城市| 连城县| 无棣县| 嵊州市| 札达县| 靖安县| 外汇| 绥化市| 健康| 晋宁县| 双牌县| 芮城县| 大荔县| 肇源县| 金阳县| 黄山市| 阿合奇县| 赣州市| 成安县| 孟州市| 西乡县| 义马市| 虹口区| 禹州市| 东源县| 景谷| 酉阳| 彩票| 天峻县| 西安市| 庄河市| 周宁县| 阿城市| 宜春市| 榆社县|