Nginx Domain Pointer not working

Fysioski

Verified User
Joined
Mar 25, 2012
Messages
11
Hello all, we just updates directadmin to 1.4.3 with custombuild 2.0. So far so good and works perfect after some tuning. Now we found out that the domain pointer do not work. Is there anyone who knows how to get the domainpointer to work with NGINX? The subdomains work fine but the pointers not! We tried to restart NGINX and PHP-FPM but still no luck.
 
Hello,

Thank you for the report. A temporary fix is:
Code:
cd /usr/local/directadmin/data/templates
mkdir -p custom
cp -p nginx_server*conf custom/
perl -pi -e 's/server_name \|DOMAIN\| www.\|DOMAIN\|/server_name \|DOMAIN\| www.\|DOMAIN\| \|SERVER_ALIASES\|/' custom/nginx_server*conf
echo "action=rewrite&value=nginx" >> /usr/local/directadmin/data/task.queue
/usr/local/directadmin/dataskq d
/etc/init.d/nginx restart
 
More bugs in Templates Nginx

We have found more bugs in the NginX templates. If choosen the option in options.conf to use Nginx not all settings of the nginx are loaded. In the directadmin.conf the standard path to the ssl cert is wrong and pointing to apache folder and not to the nginx folder. Please correct in the template.

Standard the is:
apachelogdir=/var/log/httpd/domains
apacheconf=/etc/httpd/conf/httpd.conf
apacheips=/etc/httpd/conf/ips.conf
apachemimetypes=/etc/mime.types
+++++
apachecert=/etc/httpd/conf/ssl.crt/server.crt
apachekey=/etc/httpd/conf/ssl.key/server.key
+++++
apache_public_html=0

it should point to (but please have a look for the names: it says apache while it should be nginx):
apachecert=/etc/nginx/ssl.crt/server.crt
apachekey=/etc/nginx/ssl.key/server.key

There is no section to correct the paths for the nginx server. Maybe it is possible to create a section in the directadmin.conf and options.conf for the nginx so we can tune it to the max. We have it running like a charm now but took a long time to figure it out.
 
Hello,

Hmm.. thanks for the info.
I wouldn't really say that it's really a template bug.. but rather just the need for a change to the directadmin.conf as part of the conversion.
Probably could be a check in the ./build nginx somewhere.. at the same time nginx=1 is set.

John
 
Look like that the service isn't restarted if a vhost is addes or a pointer. We have to manually restart php-fpm and NGINX in order to get the new domain (vohost) active. Would be nice if one has added a vhost it also restarts the nginx and php-fpm.
 
Hello,

The restart commands added to the task.queue don't change much.
The function call looks for action=httpd and does a direct swap with action=nginx.

After adding a domain or a pointer, can you quickly cat the task.queue contents, so we can see if it's being added?
Code:
cat /usr/local/directadmin/data/task.queue
ensure you see a restart in there.
The task.queue should be removed every minute at seconds x:00, so be sure to run the cat very quickly. (eg: wait for :01 before adding the domain via DA)

Also check:
/var/log/directadmin/system.log

as we'd be looking for something like this just after the addition of the domain/pointer:
Code:
2013:03:26-03:25:02: nginx restarted
If the task.queue is full of data, then it might not be getting processed:
http://help.directadmin.com/item.php?id=107

John
 
Hello,

The restart commands added to the task.queue don't change much.
The function call looks for action=httpd and does a direct swap with action=nginx.

After adding a domain or a pointer, can you quickly cat the task.queue contents, so we can see if it's being added?
Code:
cat /usr/local/directadmin/data/task.queue
ensure you see a restart in there.
The task.queue should be removed every minute at seconds x:00, so be sure to run the cat very quickly. (eg: wait for :01 before adding the domain via DA)

Also check:
/var/log/directadmin/system.log

as we'd be looking for something like this just after the addition of the domain/pointer:
Code:
2013:03:26-03:25:02: nginx restarted
If the task.queue is full of data, then it might not be getting processed:
http://help.directadmin.com/item.php?id=107

John

The task.queue is filled with "nginx reload" and it is also deleted after a few secs so that is fine but is does not execute at all. When we manually /etc/init.d/nginx reload is works fine. Must be something not correct in the conf. There is also no entry in de system.log. What do we do wrong? Is the task.queue filled by a script we can edit?
 
We also found an other bug in the system. When a new user is added to DA the /etc/nginx/directadmin-vhosts.conf is filled with 3 entries in stead of one. When then add a subdomain there will be an other (duplicated) lined as well. We found the error because the nginx was not restarted by DA. There was an error: nginx: [warn] conflicting server name: Conflicting servername in include /usr/local/directadmin/data/users/user2/nginx.conf;
include /usr/local/directadmin/data/users/user2/nginx.conf; include /usr/local/directadmin/data/users/user2/nginx.conf;

The /etc/nginx/directadmin-vhosts.conf look like this:
include /usr/local/directadmin/data/users/user1/nginx.conf;
include /usr/local/directadmin/data/users/user2/nginx.conf;
include /usr/local/directadmin/data/users/user2/nginx.conf;
include /usr/local/directadmin/data/users/user2/nginx.conf;

Is there a solution to this?
 
Are you using the latest pre-release DA binaries?
I believe this was fixed about a week ago.

Let me know if not.
Confirm the timestamp on the binaries:
Code:
./directadmin o
John
 
We also found an other bug in the system. When a new user is added to DA the /etc/nginx/directadmin-vhosts.conf is filled with 3 entries in stead of one. When then add a subdomain there will be an other (duplicated) lined as well. We found the error because the nginx was not restarted by DA. There was an error: nginx: [warn] conflicting server name: Conflicting servername in include /usr/local/directadmin/data/users/user2/nginx.conf;
include /usr/local/directadmin/data/users/user2/nginx.conf; include /usr/local/directadmin/data/users/user2/nginx.conf;

The /etc/nginx/directadmin-vhosts.conf look like this:
include /usr/local/directadmin/data/users/user1/nginx.conf;
include /usr/local/directadmin/data/users/user2/nginx.conf;
include /usr/local/directadmin/data/users/user2/nginx.conf;
include /usr/local/directadmin/data/users/user2/nginx.conf;

Is there a solution to this?
this is happening to me now and directadmin/cb2 was installed last week, making nginx really hard to use. even harder is the conf files use same name for every user.
if possible following nginx directory setup would help.
 
this is happening to me now and directadmin/cb2 was installed last week, making nginx really hard to use. even harder is the conf files use same name for every user.
if possible following nginx directory setup would help.

Please install the latest pre-release of DA and these problems should disappear.
 
I don't think I can.
my license is through datashack and I don't have an id I can use here for that.

lic says Wholesale Internet, Inc.
 
Last edited:
You can ask DataShack or DirectAdmin support for a link to pre-release binaries, just send them the OS you are running on the server and they will provide you update instructions.
 
DA helped me out I just have not had a chance to test yet to see if its still an issue.
 
Back
Top