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

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.

主站蜘蛛池模板: 嘉定区| 锡林浩特市| 陇西县| 南溪县| 井陉县| 临邑县| 隆昌县| 南丹县| 军事| 宁夏| 安顺市| 龙江县| 公安县| 赣州市| 诏安县| 宾阳县| 麻阳| 辽阳市| 象州县| 新干县| 淳安县| 葵青区| 光山县| 平湖市| 奈曼旗| 容城县| 阳高县| 乐亭县| 南宫市| 巴楚县| 华阴市| 正安县| 广昌县| 阿图什市| 山西省| 湟源县| 诸城市| 广汉市| 珲春市| 辽源市| 临夏市|