Operating System - HP-UX
1821467 Members
2949 Online
109633 Solutions
New Discussion юеВ

Re: 'DocumentRoot must be a directory' display when Apache start

 
Kenneth_61
Frequent Advisor

'DocumentRoot must be a directory' display when Apache start

I had installed "HP-UX Apache-based Web Server' with v11.00 in D220 machine. Smooth installation .

When I start the Apache , it is ok. I can see the web site by http://192.168.1.2

So, I hope to change the location to my web which is /data/web/lyt. However, it display "DocumentRoot must be a directory" . It is a directory obviously. There are a lot of files in /data/web/lyt. It is the first time that I install this version Apache. Do Anyone know why ? I had set the 755 with the file rights. I do not know why it say that it is not a directory.

I had tried DocumentRoot /data/web/lyt
and "DocumentRoot /data/web/lyt" . Same problem .
ref:============================================
# cd /opt/hpws/apache/bin
# ./apachectl start
Syntax error on line 304 of /opt/hpws/apache/conf/httpd.conf:
DocumentRoot must be a directory
#

# DocumentRoot "/opt/hpws/apache/htdocs"
DocumentRoot /data/web/lyt





10 REPLIES 10
Kenneth_61
Frequent Advisor

Re: 'DocumentRoot must be a directory' display when Apache start

I had tried

DocumentRoot /data/web/lyt

and

DocumentRoot "/data/web/lyt" . Same problem .
Kenneth_61
Frequent Advisor

Re: 'DocumentRoot must be a directory' display when Apache start

See attach httpd.conf
Sridhar Bhaskarla
Honored Contributor

Re: 'DocumentRoot must be a directory' display when Apache start

Hi,

Can you do a 'cd /data/web/lyt' as the owner of the httpd processes (for ex., www).

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Michael Schulte zur Sur
Honored Contributor

Re: 'DocumentRoot must be a directory' display when Apache start

Hi,

it sounds like /data/web/lyt isn't of type diretory or like Sri said check the path down whether it is accessable.

greetings,

Michael
Michael Schulte zur Sur
Honored Contributor

Re: 'DocumentRoot must be a directory' display when Apache start

Hi again,

I have noticed something else. The lines are delimited by cr+lf. Did this happen while you transferred the file to itrc or does the original file on your machine have this too?
Check with vi to see if there are ^M at the end of the lines.

greetings,

Michael
Steven E. Protter
Exalted Contributor

Re: 'DocumentRoot must be a directory' display when Apache start

More than likely the httpd.conf file was corrupted in upload.

The error would be different if the http.conf file were on the apche server like it appears here.

The DocumentRoot directory must be accessible to the user that owns the apache binaries.

There could be a soft or hard link that is bothering apache as well, involving that directory.

Just for grins try another dirctory, restart apache and see what it says.

Note also,that apache will not work right if its scoreboard file is not local disk. All kinds of wild things will happen if you try and locate that file on nfs or samba shares.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Kenneth_61
Frequent Advisor

Re: 'DocumentRoot must be a directory' display when Apache start

Thanks for all. After reviewing all your reply, I find that it is due to the directory problem on /data/web/lyt. I can access this. But, the error is fixed if I create /data/web/testing. The /data/web/lyt is created by FTP FileZilla. I do not know why.

q1. I am stupid on UNIX. Can anyone tell me what is the command to remove all the files and subdirectories in a path ? I Cannot do it by "rmdir /data/web/lyt"

q2. Can you tell tell what is the file and lines which control the default open file rights. I do not want to be 777. I hope to create 755.
Sridhar Bhaskarla
Honored Contributor

Re: 'DocumentRoot must be a directory' display when Apache start

Hi,

Find the answers.

1. I am stupid on UNIX. Can anyone tell me what is the command to remove all the files and subdirectories in a path ? I Cannot do it by "rmdir /data/web/lyt"

A. 'rm -rf /data/web/lyt'. If there are files under the directory, you will have to remove them before you use 'rmdir'. However, I suggest you move the directory and delete it later. 'mv /data/web/lyt /data/web/lyt.old'.


q2. Can you tell tell what is the file and lines which control the default open file rights. I do not want to be 777. I hope to create 755.

A. It depends on what user you are using for. Usually it's 'www'. You can make it even 700 (Good practice) as long all the files are owned by www as that's how httpd processes run and access the files. Otherwise, make it 755.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Steven E. Protter
Exalted Contributor

Re: 'DocumentRoot must be a directory' display when Apache start

www can own the binaries
apache can own the binaries.

Depends on where you got apache.

I have the depot version of apache prepared for hpux by HP.

user is www
group is nobody

Apache is shipped less secure in Linux or by download from the website.

Try the commands Sri gave you to clear the directory or pick a new one.

umask can set default permissions for a user. in /etc/profile or .profile

Didnn't see that in Sri's answer. I must be sleepy.

Good Luck.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Sam McKnight
Frequent Advisor

Re: 'DocumentRoot must be a directory' display when Apache start

Be sure you use the version of apache available from hp. Friday, I installed the full apache suite on my workstation. After downloading the software depot, it took about 15 minutes to have apache up and running in place of the older version.

Regarding the command rmdir: If you have trouble with a unix command, look up the man page. Near the bottom of a man page, you will be referred to other commands that have similar functionality, like rm. I think you were wanting rmdir to do what rm -R will do. However, rm -R can be a dangerous command if used carelessly.

Sam McKnight