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

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.

主站蜘蛛池模板: 钦州市| 平乐县| 平潭县| 安福县| 余姚市| 荔浦县| 炎陵县| 江油市| 大理市| 汽车| 南和县| 西乌珠穆沁旗| 邵阳县| 禹州市| 伊金霍洛旗| 四子王旗| 甘谷县| 修文县| 溆浦县| 通化市| 中超| 蒙城县| 镇巴县| 江都市| 武川县| 道孚县| 松江区| 澄城县| 庐江县| 拉萨市| 灌云县| 永清县| 临沭县| 陇西县| 托克托县| 汨罗市| 五莲县| 揭西县| 宁强县| 手机| 徐水县|