Site does not exist error for a2ensite

后端 未结 10 1778
心在旅途
心在旅途 2020-12-12 10:04

I have cmsplus.dev under /etc/apache2/sites-available with the following code,


    ServerAdmin master@serv         


        
10条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-12 10:19

    You probably updated your Ubuntu installation and one of the updates included the upgrade of Apache to version 2.4.x

    In Apache 2.4.x the vhost configuration files, located in the /etc/apache2/sites-available directory, must have the .conf extension.

    Using terminal (mv command), rename all your existing configuration files and add the .conf extension to all of them.

    mv /etc/apache2/sites-available/cmsplus.dev /etc/apache2/sites-available/cmsplus.dev.conf
    

    If you get a "Permission denied" error, then add "sudo " in front of your terminal commands.

    You do not need to make any other changes to the configuration files.

    Enable the vhost(s):

    a2ensite cmsplus.dev.conf
    

    And then reload Apache:

    service apache2 reload
    

    Your sites should be up and running now.


    UPDATE: As mentioned here, a Linux distribution that you installed changed the configuration to Include *.conf only. Therefore it has nothing to do with Apache 2.2 or 2.4

提交回复
热议问题