Problem with ServerRoot apache_nginx

Adibsaber

New member
Joined
Nov 12, 2022
Messages
3
Hello

After i installed new clean DA server with latest version of services from custombuild, i got this issue but before that i could use apache_nginx as web server without any problem. There are no custom configuration for httpd. On 2 different servers i test it and got same result. What can i do about it?

-- Unit nginx.service has begun starting up.
Sep 07 19:21:06 server.site.com nginx[8164]: nginx: [emerg] unknown directive "ServerRoot" in /usr/local/directadmin/data/users/admin/nginx.conf:16
Sep 07 19:21:06 server.site.com nginx[8164]: nginx: configuration file /etc/nginx/nginx.conf test failed
Sep 07 19:21:06 server.site.com systemd[1]: nginx.service: control process exited, code=exited status=1
Sep 07 19:21:06 server.site.com systemd[1]: Failed to start The nginx HTTP and reverse proxy server.

If i remove this line from each domain's nginx config, it will be resolve but after a few minutes if i restart the service still getting same issue and sites won't work anymore.


I'll be glad if you can help me in this way.
 
Yes, Same issue but i installed clean DA with apache_nginx still same problem. Before latest version of nginx i didn't have same issue.
 
Hello,

What do you have in /usr/local/directadmin/data/users/admin/nginx.conf then?

I guess you've added a custom Apache-style code as admin in DirectAdmin for a domain into NGINX section. Check the Custom HTTPD Configurations page in DirectAdmin. And dive into sub-pages there.
 
Hello

Problem is that i didn't set any customize configuration, after build all with custom build, it generated by server itself. Main issue is with
ServerRoot /etc/httpd

If i remove this line for each domain and restart nginx then it will works fine but if i reboot the server or restart nginx after a few minutes, it will generate this line once again automaticaly or if i build web server once again. I tried it on a new server with clean DA either but still getting same issue. It's the first time i'm getting this error.

Is there any solution to fix this issue? because i think this happened after latest update of nginx.


Best Regards
 
as i see - there must be section "Server" and inside it must be "root", and you have "server root" looks like customized template
/usr/local/directadmin/data/templates/custom/nginx** or in /usr/local/directadmin/data/ stuck some task that runs rewrites config, or another customized with cron script do some manipulations. Check all this paths and procesees and cron log. Because DA didn't rewrite confs untill something changed in webserver config (added/removed domain, subdomain, pointer,php_version) and after you removed this line it must stay till something will push DA to change it, or it changed by someone else :(
 
Is there any solution to fix this issue? because i think this happened after latest update of nginx.

Running nginx on all servers of my own, and got it on some servers of my customers. We don't have the issue.

If your license includes for DA support, I'd suggest opening a ticket with them. Otherwise you might do some debug.

By default when a new server is installed the admin does not own any domain, and the nginx.conf for admin should not contain any server information. So if you still need a help here, let us help you. We will need to see the content of the file. It's OK if you mask your real names and IPs.
 
Back
Top