×


Directadmin Unable to write users httpd conf configuration

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.


[Couldn't delete the files in Linux? We are here to help you. ]


Conclusion

This article will guide you on how to fix the #error, Unable to write user's httpd.conf in Directadmin which occurs when we try to add a #domain in #DirectAdmin. 

The httpd. conf file is the main configuration file for the Apache web server. It's highly recommended to run Apache in standalone type for better performance and speed. ServerRoot "/etc/httpd" The option ServerRoot specifies the directory in which the configuration files of the Apache server lives.

Before you edit httpd.conf, you should first copy the original file to something like httpd.conf-old, for example. 

By creating a #backup, you can recover potential mistakes made while editing the new configuration file.