What is the difference between sites-enabled and sites-available directory?

前端 未结 3 1007
隐瞒了意图╮
隐瞒了意图╮ 2020-12-07 09:15

What is use of these two directories in apache2 and how can we do it?

3条回答
  •  死守一世寂寞
    2020-12-07 10:00

    You configure your site mysite by creating or editing the file mysite.conf in sites-available (you can also configure several sites in the same .conf file, if you prefer).

    After this, for publishing the site you must create the correspondent symlink in sites-enabled. In Ubuntu you can do it like this:

    a2ensite mysite (with sudo, if necessary; and without the final .conf)

    And then you must reload Apache:

    sudo service apache2 reload
    

    Later, if you want to modify the configuration, you only touch the mysite.conf in sites_available. Changes apply automatically in sites_enabled, through the symlink. Just remember reload Apache.

提交回复
热议问题