Closed shuangxi588 closed 6 years ago
use visudo and comment "Default requiretty" may help you ;-)
Thanks.
Thanks for your help, but I still have two questions.
@shuangxi588
user nginx;
worker_processes 1;
error_log /opt/nginx-admin/settings/log/error.log warn; pid /opt/nginx-admin/settings/nginx.pid;
and
<#if virtualHost.https == 1>
listen 443 ssl;
ssl_certificate /opt/nginx-admin/settings/ssl/${ virtualHost.sslCertificate.resourceIdentifierCertificate.hash };
ssl_certificate_key /opt/nginx-admin/settings/ssl/${ virtualHost.sslCertificate.resourceIdentifierCertificatePrivateKey.hash };
......
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_dhparam /opt/nginx-admin/settings/ssl/dhparam.pem;
<#else>
listen 80;
</#if>
OK,thanks very much.
@shuangxi588
Disable/Comment entire tty its not best way to do that.
You can add single user directive to disable tty when activated using:
Defaults:nginx-agent !requiretty
To use mariadb as database you can follow mysql steps in theory i guess (not tested yet):
create database nginx_admin; grant all privileges on nginx_admin.* to nginx_admin@'%' identified by 'password'; flush privileges;
NGINX_ADMIN_DB_DRIVER=mysql NGINX_ADMIN_DB_HOST=localhost NGINX_ADMIN_DB_PORT=3306 NGINX_ADMIN_DB_NAME=nginx_admin NGINX_ADMIN_DB_USERNAME=nginx_admin NGINX_ADMIN_DB_PASSWORD=password
service nginx-admin restart
Can you try and give some feedback ?
About changing default settings there is no plan to mixing folders yet or setting another folder as default because nginx-admin doesnt know about previous files (only nginx knows). There is a plan to add an import feature to nginx admin that resolve this kind of situation.
Added official support to mariadb. Added directive to avoid tty in nginx-admin-agent user script install. Will be released to the 2.0.2 with new documentation site
I already added user nginx-agent in sudoers file.
1.
tail -n 1 /etc/sudoers
nginx-agent ALL=(ALL) NOPASSWD:/usr/sbin/nginx,/usr/bin/pgrep nginx,/usr/bin/killall nginx
2.
su - nginx-agent
Last login: Mon Feb 26 14:30:45 CST 2018 on pts/3 su: warning: cannot change directory to /home/nginx-agent: No such file or directory -bash-4.2$ sudo nginx -t nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful -bash-4.2$ exit