Add custom Httpd / nginx configuration for single domain but from SSH

rnc

Verified User
Joined
Jun 8, 2013
Messages
72
Hello
just like these toutrials

http://help.directadmin.com/item.php?id=2
http://help.directadmin.com/item.php?id=3

i like to do this from ssh
how could i do that

we have a special PHP software that we want to write a script to customize configuration based on account and domains for required configuration


and there are 3 other questions

1 - how we should make these changes for nginx_apache ( nginx as reverse proxy for apache ) ?
2 - how we could make changes ( from directadmin GUI or SSH ) but like above tutorials just addtional configuration
3- how we could override some setting like php-fpm child number and etc from directadmin GUI ( default is to add parameters not change default ones)
 
Custom nginx configuration: /usr/local/directadmin/data/users/user/domains/domain.com.cust_nginx
Custom apache configuration: /usr/local/directadmin/data/users/user/domains/domain.com.cust_httpd
Custom php-fpm configuration: /usr/local/directadmin/data/users/user/php/php-fpm55.conf.custom1
 
Another Ciustomization

Tahnks for previous response
that was correct and i saw same configuration as GUi on tht file as smtalk mentioned

but now there is need to another customization
but this time i need to cahnge somthing in default nginx configuration instead of addin

as you may know
nginx defaut log level for errors is "error"

this could cause lots of IO usage n servers taht may have normal errors like autentication trough htpasswd file

si iwanted to set error log for specefic domain to something more important link "crit"

thing taht i could set in custom httpd configuration is

error_log /var/log/nginx/domains/|DOMAIN|.|SUB|.error.log crit;

but this will add
error_log /var/log/nginx/domains/domain.com.sundomainname.error.log crit;
to user nginx configuration and not Replace the default
one

and as nginx always process all log file it will end have normal "error" level log instead of critical s

any suggestions ?>
 
Code:
cd /usr/local/directadmin/data/templates
mkdir -p custom
cp -pf nginx_server*.conf custom/

Now edit nginx_server*.conf files in /usr/local/directadmin/data/templates/custom/ and change the error_log line there. Run the following command after the changes to apply the templates to all of the customers on the server:
Code:
echo "action=rewrite&value=nginx" >> /usr/local/directadmin/data/task.queue
/usr/local/directadmin/dataskq d

Good luck! :)
 
Code:
cd /usr/local/directadmin/data/templates
mkdir -p custom
cp -pf nginx_server*.conf custom/

Now edit nginx_server*.conf files in /usr/local/directadmin/data/templates/custom/ and change the error_log line there. Run the following command after the changes to apply the templates to all of the customers on the server:
Code:
echo "action=rewrite&value=nginx" >> /usr/local/directadmin/data/task.queue
/usr/local/directadmin/dataskq d

Good luck! :)

Hello
yesd
this is a general way for whole server and users
is there any "IF" way that we could use to apply to only one domain ?
 
please help me

please teach step to step
my web server is nginx & php-fpm
I want the rulle set to users after create

location ~* \.$ {expires 365d;}
rewrite ^/([^theme]|history|timer) /index.php last;
rewrite_log off;

Please Write to me all Commands for problem , To be entered in SSH

tank ... :o :o
 
Custom nginx configuration: /usr/local/directadmin/data/users/user/domains/domain.com.cust_nginx
Custom apache configuration: /usr/local/directadmin/data/users/user/domains/domain.com.cust_httpd
Custom php-fpm configuration: /usr/local/directadmin/data/users/user/php/php-fpm55.conf.custom1

The command
nano /usr/local/directadmin/data/users/user/domains/domain.com.cust_nginx

And enter the

location ~* \.$ {expires 365d;}
rewrite ^/([^theme]|history|timer) /index.php last;
rewrite_log off;

Can not save

[ Error writing /usr/local/directadmin/data/users/user/domains/domain.com.cust ]
 
The command
nano /usr/local/directadmin/data/users/user/domains/domain.com.cust_nginx

And enter the

location ~* \.$ {expires 365d;}
rewrite ^/([^theme]|history|timer) /index.php last;
rewrite_log off;

Can not save

[ Error writing /usr/local/directadmin/data/users/user/domains/domain.com.cust ]

you have to change bold user with username of an existing host!
 
Back
Top