Adding new domain cause remove httpd.conf lines

lamletoi

Verified User
Joined
Oct 9, 2014
Messages
12
Dear all,

I dont know why my directadmin server have a very strange behavor.
I just added new domain from admin > User level.
After that, this domain can be show but some of my configuration lines in /usr/local/directadmin/data/users/admin/httpd.conf have been deleted without reason.

I have to do:
Code:
chattr +i /usr/local/directadmin/data/users/admin/httpd.conf

But it is not a good way.
I also tried to use
Code:
chattr [B]+a[/B] /usr/local/directadmin/data/users/admin/httpd.conf
But i can not adding new domain.

Somebody can tell me how i can handle this ?

Thanks
 
Hello,

DirectAdmin Allows Admin to insert extra httpd.conf code that a User may require. To access the control page for this functionality, go to Admin Panel -> Admin Settings -> Customize Httpd Configurations.

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

Thanks but it is not relevant to my case.

I have a httpd.conf with owner of admin.This configuration have vhost for other hosts.
When i login with admin , adding new domain then some vhost will be removed.

Code:
[root@vps ~]# chattr -a  /usr/local/directadmin/data/users/admin/httpd.conf
[B]Before adding new domain[/B]
[root@vps ~]# ls -lah /usr/local/directadmin/data/users/admin/httpd.conf
-rw-r----- 1 diradmin admin [COLOR=#ff0000]14K[/COLOR] Dec 16 02:42 /usr/local/directadmin/data/users/admin/httpd.conf
[B]After adding new domain[/B]
[root@vps ~]# ls -lah /usr/local/directadmin/data/users/admin/httpd.conf
-rw-r----- 1 diradmin admin[COLOR=#ff0000] 7.5K[/COLOR] Dec 16 02:51 /usr/local/directadmin/data/users/admin/httpd.conf

So, some of my domains hosted with admin will not work.

Thanks
 
Last edited:
You should use directadmin interface to add/remove domains. You should not directly modify /usr/local/directadmin/data/users/admin/httpd.conf. The file gets rewritten every time you add or remove domains, Directadmin uses data stored in: /usr/local/directadmin/data/users/admin/domains.list and /usr/local/directadmin/data/users/admin/domains/.

Do you see all the domains in a list at user level? If you don't see any of them, it would mean you did not add them properly or you're missing important files from /usr/local/directadmin/data/users/admin/domains/ and domains in /usr/local/directadmin/data/users/admin/domains.list.

Try and recover corrupted data with:

Code:
/usr/local/directadmin/scripts/fix_da_user.sh admin admin domain.com

Run it with every single domain you have at admin's account (missing or existing).
 
Thank you so much Alex.
Everything is clear now.
But how do you work with SSL ?
I have to put a 443 vhost for some domains manually to httpd.conf.
how can i handle this ?

Thanks
 
SSL should be enabled:

1. per package or per user bases at reseller level
2. per domain bases at user level
 
Back
Top