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:WindowsSystem32, so use this:
ServerRoot ../../Apache
Error Message
Syntax error on line 39 of c:……. .conf/httpd.conf: ServerRoot must be a valid directory.

What I am trying to do
I am trying to run a new install of Apache under Windows 10.
Solution
Edit the Apache24confhttpd.conf file.
At line 39 and ensure that the path to the folder where your installation is. (i.e. where you unzipped the downloaded file).

Before – when we had an error
In my case, I extracted the downloaded file to the c:dev directory so the change needed is highlighted below.

- After the edit
How to test
Now try to run Apache again – by running the httpd.exe command from the command prompt. If you get a cursor sitting on the next line with no error, then you are okay, and can test it by opening a browser and going to: http://localhost
Rationale
- The default installation of Apache (2.4 in my example) expects that it is installed in the c:Apache24 directory.
- If you download the file and don’t extract it from the root of the c: drive then you will see this error.
- The SRVROOT shows “/Apache24” as the folder – whereas on Windows you would normally expect to see “c:Apache24” for a folder.
Request to visitors
Click “Like” if this helped and I’ll post more like this that may help you, or others in the future.
Feedback welcomed on style/format etc.
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:WindowsSystem32, so use this:
ServerRoot ../../Apache
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:WindowsSystem32, so use this:
ServerRoot ../../Apache
|
0 / 0 / 0 Регистрация: 24.05.2014 Сообщений: 12 |
|
|
1 |
|
|
18.04.2016, 19:05. Показов 7639. Ответов 3
При выполнении команды запуска в cmd апач не запускается. При выполнении команды httpd : Syntax error on line 36 of C:/Server/web/apache/conf/httpd.conf : ServerRoot must be a valid directory. Вот та самая строчка ServerRoot “C:/Server/web/apache”. При всем при этом не идет запись в логи. Что делать чтобы запустился не пойму . Прикрепляю на всякий файлик с настройками и ссылку где их брал. Помогите разобраться в чем ошибка.
__________________
0 |
|
Почетный модератор
16842 / 6720 / 880 Регистрация: 12.06.2012 Сообщений: 19,967 |
|
|
18.04.2016, 20:30 |
2 |
|
Кавычки поменяйте на нормальные
1 |
|
0 / 0 / 0 Регистрация: 24.05.2014 Сообщений: 12 |
|
|
19.04.2016, 17:59 [ТС] |
3 |
|
Эта проблема решилась. Спасибо. Появилась новая не запускается MySQL . пишет что служба не запустилась .Ошибок службе найти не удалось.
0 |
|
Почетный модератор
16842 / 6720 / 880 Регистрация: 12.06.2012 Сообщений: 19,967 |
|
|
19.04.2016, 21:34 |
4 |
|
смотрите в логах, mail.log или error.log в mail, смотря как у вас там
0 |