PDA

View Full Version : Troubles with httpd.conf



IPaddress
01-11-2011, 05:50 AM
Hi!

I'm having this problem:

For some reason, from time to time my client complains that he gets "500 internal server error" when he tries to have access to his site.
This problem is caused by httpd.conf file, that adds a wrong path to the docuemntroot location.

Is always the same, here an example:

It changes the following lines

DocumentRoot /home/username/domains/domain.com/public_html/subdomain/subdomain_user/web//subdomain_user
ScriptAlias /cgi-bin/ /home/username/domains/domain.com/public_html/subdomain/subdomain_user/web/cgi-bin//subdomain_user

<Directory /home/username/domains/domain.com/public_html/subdomain/subdomain_user/web//subdomain_user>

As you can see, it adds the subdomain_user to the end of the line, and then is when the site shows 500 error.
Any idea on how to solve this?

Thanks a lot!

scsi
01-11-2011, 06:06 AM
Have you touched the template files?

zEitEr
01-11-2011, 10:02 AM
Check Custom Httpd Configurations for the specified domain (vhost).

IPaddress
01-13-2011, 09:53 AM
Have you touched the template files?

wich template files are you talking about?


Check Custom Httpd Configurations for the specified domain (vhost).

I checked them, and there is where the problem beggins.
Without any reason, the httpd.conf file for the domain changes and breaks the site

zEitEr
01-13-2011, 10:01 AM
Do you have modified templates:


/usr/local/directadmin/data/templates/custom/virtual_host2.conf
/usr/local/directadmin/data/templates/custom/virtual_host2_secure.conf
/usr/local/directadmin/data/templates/custom/virtual_host2_secure_sub.conf
/usr/local/directadmin/data/templates/custom/virtual_host2_sub.conf
/usr/local/directadmin/data/templates/custom/virtual_host.conf
/usr/local/directadmin/data/templates/custom/virtual_host_secure.conf
/usr/local/directadmin/data/templates/custom/virtual_host_secure_sub.conf
/usr/local/directadmin/data/templates/custom/virtual_host_sub.conf


What exactly did you check?

Directadmin Admin Login -> Add Custom Httpd Configurations -> Select a certain domain

Is there any code in top text area box (called Httpd.conf Customization for)? Are there any tockens?

nobaloney
01-13-2011, 03:42 PM
Remember also that changed user-specific httpd.conf files will be changed by DirectAdmin. So either move the templates to the custom subdirectory and change them there, or make your changes to the user-specific httpd.conf files (if you must) then chattr them immutable so DirectAdmin can't change them.

Or make all your changes in the custom httpd configuration section of the admin login, if that works for you.

Jeff

IPaddress
02-02-2011, 07:04 AM
Jeff:

Could you be more specific with your answer?
I couldn't find the files that you refer to, so I can't check what you are saying.

Thanks a lot for your answers everyone!

nobaloney
02-02-2011, 11:24 AM
Actually I mis-wrote. There's no custom directory for the user-specific httpd.conf files; you need to chattr them immutable if you don't want DirectAdmin to change them.

The user-specific httpd.conf files can be found this way:

# ls -al /usr/local/directadmin/data/users/*/httpd.conf
You can make limited changes through the custom httpd configurastion section of the admin login.

Jeff