Are you trying to fix the error 'Unable to write user’s httpd.conf' in Directadmin?
This guide is for you.
Sometimes, DirectAdmin users faces this error while creating a domain. This is probably because we tried to delete this domain before and there is a chance of existing files of this domain under "/var/spool/virtual".
Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to fix Directadmin relates errors.
In this context, we shall look into steps to troubleshoot this error and its fixes.
How to add Domains to DirectAdmin ?
Before we see how to remove the files from the directory, let us see how to add domains to the DirectAdmin server.
Here are a few steps to find the best fit to do the same.
Step 1: Set the main domain name
By default, no web site associates with our domain.
i. Initially, we sign in to the control panel at http:xxx.xxx.xxx.xxx//:2222 as the admin user.
ii. Then we switch to the User panel (link is near the top right of the screen)
iii. Click the "Add Another Domain" text link.
iv. Finally, enter the domain name into the box and click Submit.
Step 2: Create nameservers (optional)
a) Add at least one additional IP address to the server.
i. Initially, we sign in to DirectAdmin as the admin user, then select IP Manager from the menu
ii. To add an IP address, go to "IP" field -> "Add IP"
iii. Then, place a checkmark next to all the IP addresses and click the “Assign to [username]”
iv. Eventually, we can find the Admin username in the dropdown menu.
b) Create the nameservers.
i. Switch to the Reseller panel and click the Name Servers icon.
ii. If there are any nameservers in the list, checkmark them and click the "Delete Nameservers" button.
iii. Then, we place checkmarks next to any two IP addresses and click "Create Nameservers for" hence selecting the domain we want the nameservers for.
c) Tell DirectAdmin that these will be the primary nameservers.
i. We switch back to the Admin panel and click Admin Settings.
ii. Then make sure the NS1/NS2 fields are accurate, and then click "Save".
[Failed to add domains in DirectAdmin? We'd be happy to assist. ]
Nature of the error, Unable to write user's httpd.conf in Directadmin ?
When we try to create a domain in a server with the latest DirectAdmin with existing domains, we receive:
Unable to write user’s httpd.conf
Could not include user’s httpd file to the main httpd.conf
As we mentioned earlier, this might be because we tried to delete this domain before and there is a chance of existing files of this domain under "/var/spool/virtual".
In order to fix this error, we have to delete the existing domain files under the "/var/spool/virtual" directory. Once we remove the files, we can add the domains to the DirectAdmin server.
# cd /var/spool/virtual
We can use the rm command to delete these files.