Apache could not be started - ServerRoot must be a valid directory and Unable to find the specified module

后端 未结 14 1256
星月不相逢
星月不相逢 2020-12-13 06:54

I\'m using xampp portable server and I\'m having some trouble with Apache http server, it says \"ServerRoot must be a valid directory\"

Command line output:

14条回答
  •  春和景丽
    2020-12-13 07:32

    If you open an editor and jump to the exact line shown in the error message (within the file httpd.conf), this is what you'd see:

    #LoadModule access_compat_module modules/mod_access_compat.so
    LoadModule actions_module modules/mod_actions.so
    LoadModule alias_module modules/mod_alias.so
    LoadModule allowmethods_module modules/mod_allowmethods.so
    LoadModule asis_module modules/mod_asis.so
    LoadModule auth_basic_module modules/mod_auth_basic.so
    #LoadModule auth_digest_module modules/mod_auth_digest.so
    #LoadModule auth_form_module modules/mod_auth_form.so
    

    The paths to the modules, e.g. modules/mod_actions.so, are all stated relatively, and they are relative to the value set by ServerRoot. ServerRoot is defined at the top of httpd.conf (ctrl-F for ServerRoot ").

    ServerRoot is usually set absolutely, which would be K:/../../../xampp/apache/ in your post.

    But it can also be set relatively, relative to the working directory (cf.). If the working directory is the Apache bin folder, then use this line in your httpd.conf:

    ServerRoot ../
    

    If the working directory is the Apache folder, then this would suffice:

    ServerRoot .
    

    If the working directory is the C: folder (one folder above the Apache folder), then use this:

    ServerRoot Apache
    

    For apache services, the working directory would be C:\Windows\System32, so use this:

    ServerRoot ../../Apache
    

提交回复
热议问题