httpdocs

Well-Known Member
Mar 9, 2018
59
9
83
United States
cPanel Access Level
Root Administrator
I had a problem
When I enter "/scripts/rebuildhttpdconf" I get an Error.

Initial configuration generation failed with the following message:

The “/usr/local/apache/bin/httpd -DSSL -t -f /usr/local/apache/conf/httpd.conf.work.7f3ce1df.cfgcheck -C Include "/usr/local/apache/conf.modules.d/*.conf"” command (process 18108) reported error number 1 when it ended.
httpd: Syntax error in -C/-c directive: Include/IncludeOptional: Could not open directory /usr/local/apache/conf.modules.d: No such file or directory

Rebuilding configuration without any local modifications.

Failed to generate a syntactically correct Apache configuration.
Bad configuration file located at /usr/local/apache/conf/httpd.conf.work.7f3ce1df
Error:
The “/usr/local/apache/bin/httpd -DSSL -t -f /usr/local/apache/conf/httpd.conf.work.7f3ce1df.cfgcheck -C Include "/usr/local/apache/conf.modules.d/*.conf"” command (process 18151) reported error number 1 when it ended.
httpd: Syntax error in -C/-c directive: Include/IncludeOptional: Could not open directory /usr/local/apache/conf.modules.d: No such file or directory

Server is run with litespeed and cloudlinux 7.7
No changes can be made to Apache Configuration.
I cannot switch from Lightspeed to Apache.
Cannot Create Subdomain or any changes to httpd.conf


any idea?
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,269
313
Houston
Code:
httpd: Syntax error in -C/-c directive: Include/IncludeOptional: Could not open directory /usr/local/apache/conf.modules.d: No such file or directory
Does the directory listed in the error exist?
 

httpdocs

Well-Known Member
Mar 9, 2018
59
9
83
United States
cPanel Access Level
Root Administrator
Code:
httpd: Syntax error in -C/-c directive: Include/IncludeOptional: Could not open directory /usr/local/apache/conf.modules.d: No such file or directory
Does the directory listed in the error exist?
No
But by creating it, the problem doesn't go away.
This directory does not exist on any of the servers and the error is not received.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,269
313
Houston
This isn't a standard directory - it's being included in your configuration somewhere and because it doesn't exist and the expected include isn't present it's causing an issue. If you go to WHM>>Server Configuration>>Apache Configuration -> Include editor - Do you see any includes that reference this path?

The standard path for this should be /etc/apache2/conf.modules.d/
 

httpdocs

Well-Known Member
Mar 9, 2018
59
9
83
United States
cPanel Access Level
Root Administrator
This isn't a standard directory - it's being included in your configuration somewhere and because it doesn't exist and the expected include isn't present it's causing an issue. If you go to WHM>>Server Configuration>>Apache Configuration -> Include editor - Do you see any includes that reference this path?

The standard path for this should be /etc/apache2/conf.modules.d/
Code:
Sorry, you cannot update the include files at this time. Your Apache configuration file currently has a syntax error.
Error:

The “/usr/local/apache/bin/httpd -DSSL -t -f /usr/local/apache/conf/httpd.conf -C Include "/usr/local/apache/conf.modules.d/*.conf"” command (process 75568) reported error number 1 when it ended. httpd_ls_bak: Syntax error in -C/-c directive: Could not open config directory /usr/local/apache/conf.modules.d: No such file or directory
 

Attachments

httpdocs

Well-Known Member
Mar 9, 2018
59
9
83
United States
cPanel Access Level
Root Administrator
Can you show me the output of the following:

Code:
stat /usr/local/apache/conf/httpd.conf
Includes are located at: /etc/apache2/conf.d/includes
Code:
File: ‘/usr/local/apache/conf/httpd.conf’

  Size: 5430091         Blocks: 10608      IO Block: 4096   regular file

Device: 802h/2050d      Inode: 11678992    Links: 1

Access: (0600/-rw-------)  Uid: (    0/    root)   Gid: (    0/    root)

Access: 2019-09-23 15:15:50.229069966 +0330

Modify: 2019-09-23 15:15:50.261071019 +0330

Change: 2019-09-23 15:15:50.261071019 +0330

Birth: -
 

httpdocs

Well-Known Member
Mar 9, 2018
59
9
83
United States
cPanel Access Level
Root Administrator
Code:
File: ‘/usr/local/apache/conf/httpd.conf’

  Size: 5430091         Blocks: 10608      IO Block: 4096   regular file

Device: 802h/2050d      Inode: 11678992    Links: 1

Access: (0600/-rw-------)  Uid: (    0/    root)   Gid: (    0/    root)

Access: 2019-09-23 15:15:50.229069966 +0330

Modify: 2019-09-23 15:15:50.261071019 +0330

Change: 2019-09-23 15:15:50.261071019 +0330

Birth: -
i changed chmod to 0777 but problem is still
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,269
313
Houston
600 is the correct permissions:


Code:
[[email protected] includes]# stat /etc/apache2/conf/httpd.conf
  File: ‘/etc/apache2/conf/httpd.conf’
  Size: 250678        Blocks: 496        IO Block: 4096   regular file
Device: fd01h/64769d    Inode: 796858      Links: 1
Access: (0600/-rw-------)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2019-09-23 14:32:58.474083848 -0500
Modify: 2019-09-23 14:32:58.021083948 -0500
Change: 2019-09-23 14:32:58.113083927 -0500
 Birth: -
The apache conf should NOT be 777 what I was looking for was a symlink to /etc/apache2/conf/httpd.conf
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,269
313
Houston
@httpdocs


I'd open a ticket to have them take a look at the configuration - instructions to do so are located in my signature. If you do open a ticket please add the Ticket ID to this thread.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,269
313
Houston
I see, so, the issue i believe would lie in the templates for apache - for some reason it's referencing the old path at /usr/local/apache/ not /etc/apache2/conf.modules.d.


If you search in the templates for the following what is the output?

Code:
grep -ir "conf.modules.d" /var/cpanel/templates/
 

httpdocs

Well-Known Member
Mar 9, 2018
59
9
83
United States
cPanel Access Level
Root Administrator
I see, so, the issue i believe would lie in the templates for apache - for some reason it's referencing the old path at /usr/local/apache/ not /etc/apache2/conf.modules.d.


If you search in the templates for the following what is the output?

Code:
grep -ir "conf.modules.d" /var/cpanel/templates/
Thank you for your cooperation
command result:
/var/cpanel/templates/apache2_4/ea4_main.default:Include "[% paths.dir_base %]/conf.modules.d/*.conf"
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,269
313
Houston
Do you have anything that references /usr/local/apache there as well? The output you're showing is expected. Ultimately the issue is, is that the incorrect path is being referenced in the apache conf - you might want to move the conf files located at /etc/apache2/conf/ and then rebuild the configuration and check if it still references the old path.
 

httpdocs

Well-Known Member
Mar 9, 2018
59
9
83
United States
cPanel Access Level
Root Administrator
Do you have anything that references /usr/local/apache there as well? The output you're showing is expected. Ultimately the issue is, is that the incorrect path is being referenced in the apache conf - you might want to move the conf files located at /etc/apache2/conf/ and then rebuild the configuration and check if it still references the old path.
i moved all included files into conf directory to old directory and rebuild httpdconf but problem is still


-rw------- 1 root root 5434906 Sep 16 18:59 httpd.conf
-rw------- 1 root root 501937 Sep 19 16:43 httpd.conf.datastore
-rw-r--r-- 1 root root 13064 Sep 19 16:43 magic
-rw-r--r-- 1 root root 61184 Oct 17 2018 mime.types