Default apache httpd.conf

j0eyv

New member
Joined
Feb 19, 2011
Messages
12
Hello,

I have a problem with my webserver. Images in a sub-dir are not available. When i check the httpd error_log i found out this error:

Code:
[error] [client xx.xx.xx.xx] File does not exist: /var/www/html/joey

I found out that the DocumentRoot setting in the httpd.conf file is wrong. This should be something like /home/user/domain/public_html/.

Can somebody check his directadmin server (httpd.conf) file to see what the document root should be?
 
Check templates:

virtual_host2.conf
virtual_host2_secure.conf
virtual_host2_secure_sub.conf
virtual_host2_sub.conf

in /usr/local/directadmin/data/templates/custom and /usr/local/directadmin/data/templates

Perhaps, they are customized badly.

Then check: Httpd.conf Customization for your domain. Perhaps document_root is re-defined there.
 
In the template files there's also /var/www/html as the documentroot. Can someone copy some configuration of his httpd.conf file?
 
I just net this (but the correct) line from your httpd config file.

DocumentRoot "/var/www/html"

that one should link to /home/xxx/public_html/ or something like that.
 
I don't understand the last post? I'm totally confused about what to do.
 
That is the full path that is in the httpd.conf (DocumentRoot). The httpd.conf is located in /etc/httpd/conf. So the webserver tries to open the files from /var/www/html but the files are /home/username/domains/domain.com/public_html

So i need the correct settings for the httpd.conf. This issue is for all users! I guess it should be something like /home/%username%/domains/domain.com/public_html ?? What do you guys have configured in the httpd.conf file as DocumentRoot?
 
In normal situation that should not happen. You either miss something or templates on your server are messed.

With default configs and templates all regular virtual hosts have document root like this:

/home/<username>/domains/<domain>public_html

There are two ways to go:

1. Hire somebody from these forums.
2. Follow our instructions and post here, what you're asked about.


Did you check templates, I've posted above?

virtual_host2.conf
virtual_host2_secure.conf
virtual_host2_secure_sub.conf
virtual_host2_sub.conf

in /usr/local/directadmin/data/templates/custom/ and /usr/local/directadmin/data/templates/

If some of them have /var/www/html, post here it's name and full path to it, and even full content.


P.S. The httpd.conf located in /etc/httpd/conf in most cases is used without any customizations.
 
In normal situation that should not happen. You either miss something or templates on your server are messed.

With default configs and templates all regular virtual hosts have document root like this:

/home/<username>/domains/<domain>public_html

There are two ways to go:

1. Hire somebody from these forums.
2. Follow our instructions and post here, what you're asked about.


Did you check templates, I've posted above?

virtual_host2.conf
virtual_host2_secure.conf
virtual_host2_secure_sub.conf
virtual_host2_sub.conf

in /usr/local/directadmin/data/templates/custom/ and /usr/local/directadmin/data/templates/

If some of them have /var/www/html, post here it's name and full path to it, and even full content.


P.S. The httpd.conf located in /etc/httpd/conf in most cases is used without any customizations.

DocumentRoot looks like this in my virtual_host2.conf. All the other conf files you mentioned have the same document root but private_html and such a things. I cannot see /var/www/html anywhere in those config files.

My custom template directory is empty.

|?DOCROOT=`HOME`/domains/`DOMAIN`/public_html|

In this file i see a wrong documentroot: DocumentRoot "/var/www/html"
/usr/local/directadmin/data/templates/httpd.conf
 
is perfectly normal that the file /etc/httpd/conf/httpd.conf have document root in /var/www/html.

The error you see is cause someone tryed to see a page using the IP instead the host.

The users httpd.conf is in /usr/local/directadmin/data/users/USERNAME/httpd.conf

Regards
 
This is in my user httpd.conf

Code:
# Auto generated apache config file by DirectAdmin version 1.37.0
# Modifying this file is not recommended as any changes you make will be
# overwritten when the user makes any changes to his/her website

# Frontpage requires these parameters in every httpd.conf file or else
# it won't work.
ServerRoot /etc/httpd
 
for sure is the issue, in that file there is the configuration for every domain of any user present in that directory.

Those file are generated automatically from directadmin basing on the virtual_host2.conf template

had you check just one user or all?

Are all empty? If yes, there is something wrong in template i think.
 
Some users have the correct settings in their httpd.conf file. This is the virtual_host2.conf file.

Code:
|?DOCROOT=`HOME`/domains/`DOMAIN`/public_html|
|?OPEN_BASEDIR_PATH=`HOME`/:/tmp:/var/tmp:/usr/local/lib/php/|
<VirtualHost |IP|:80 |MULTI_IP|>
|CUSTOM|
|?CGI=ScriptAlias /cgi-bin/ `DOCROOT`/cgi-bin/|
	ServerName www.|DOMAIN|
	ServerAlias www.|DOMAIN| |DOMAIN| |SERVER_ALIASES|
	ServerAdmin |ADMIN|
	DocumentRoot |DOCROOT|
	|CGI|

	|USECANONICALNAME|

	SuexecUserGroup |USER| |GROUP|
	CustomLog /var/log/httpd/domains/|DOMAIN|.bytes bytes
	CustomLog /var/log/httpd/domains/|DOMAIN|.log combined
	ErrorLog /var/log/httpd/domains/|DOMAIN|.error.log

	<Directory |DOCROOT|>
		Options +Includes -Indexes
|*if CLI="1"|
		php_admin_flag engine |PHP|
		<IfModule !mod_php6.c>
			php_admin_flag safe_mode |SAFE_MODE|
		</IfModule>
		php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f |USER|@|DOMAIN|'
|*endif|
|*if OPEN_BASEDIR="ON"|
		php_admin_value open_basedir |OPEN_BASEDIR_PATH|
|*endif|
|*if SUPHP="1"|
                suPHP_Engine |PHP|
		suPHP_UserGroup |USER| |GROUP|
|*endif|
	</Directory>
|HANDLERS|
|MIMETYPES|

</VirtualHost>
 
have you tryed to rewrite confs? try this for debug mode

Code:
echo "action=rewrite&value=httpd" >> /usr/local/directadmin/data/task.queue
/usr/local/directadmin/dataskq d800

Check if give any error, and, if rewrite the confs correctly.

Regards
 
Problem is solved by filling the httpd.conf with the settings an other used has. I changed all usernames/domains to the faulty user ones.
 
well, yes, but for new added domain you should solve the source of the problem, if not, everytime you add a domain you will have fit the files manually.

And, btw, everytime a change is made to a domain configuration the httpd.conf is rewritten automatically, so, be sure that everything is working, try to add a new user with a new domain (example.com for example) and check if http.conf is created correctly.

Regards
 
Back
Top