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

后端 未结 14 1207
星月不相逢
星月不相逢 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:12

    If you use an actuall version there is a "setup_xampp.bat/.sh" script in the root directory. The path has to be absolute but the script changes all needed paths to your current location.

    0 讨论(0)
  • 2020-12-13 07:14

    I checked the line 35 of xampp/apache/conf/httpd.conf and it was:

    ServerRoot "/xampp/apache"

    Which doesn't exist. ...

    Create the directory, or change the path to the directory that contains your hypertext documents.

    0 讨论(0)
  • 2020-12-13 07:15

    Use the drive letter with forward slashes to get started (c:/apache/...).

    0 讨论(0)
  • 2020-12-13 07:15

    Make sure your ServerRoot in httpd.conf points correctly to the Apache path. Otherwise you will see this message for every further module.

    Examples:

    • /etc/apache2/apache2 for Linux
    • "C:\Program Files\Apache24" for Windows
    0 讨论(0)
  • 2020-12-13 07:17
    1. Navigate to your XAMPP directory, you will find a folder called apache, open it, then copy its path, my path is "D:\Hacking Tools 2\Programs\XAMPP V2\apache"
    2. Open up apache\conf\httpd.conf with any text editor
    3. Scroll down until line 30-40
    4. You will find a code like this: ServerRoot "xampp\apache"
    5. Now, change it to be the apache directory, as I said in Step #1, my path is "D:\Hacking Tools 2\Programs\XAMPP V2\apache", so, my code will be ServerRoot "D:\Hacking Tools 2\Programs\XAMPP V2\apache"
    6. It should look somehow like this: ServerRoot "D:\XAMPP\apache"
    7. Now go back to the XAMPP main directory and run xampp_start.exe

    It worked for me, if it doesn't work for you, just comment with the error value after opening the xampp_start.exe

    0 讨论(0)
  • 2020-12-13 07:18

    I would think that ServerRoot needs to be absolute. Use something like "/apache/docroot"

    0 讨论(0)
提交回复
热议问题