Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DocumentRoot / ServerRoot

Status
Not open for further replies.

DonP

IS-IT--Management
Jul 20, 2000
684
US
In order to get Apache working on my Windows NT standalone system, I find that ServerRoot needs to be set to the drive and folder where the Web sites are located rather than to the Apache directory. If I point it where it should go, Apache will not restart. As an experiment, I set both DocumentRoot and ServerRoot to the Apache directory and it also would not run. I don't see any permissions problems on the Apache folder and can find nothing in the documentation about this problem. What do I need to do?

Don [sig][/sig]
 
Does it give you any error messages when you try to restart it?

[sig][/sig]
 
Hi Gerald,

I'm stopping and starting Apache as a Windows NT service so the only error I get is that the service cannot be started. I've tried various combinations of paths but it seems to work only when both are pointed to the Websites folder.

Don [sig][/sig]
 
In case it will help solve the problem, here is my simple httpd.conf file. I am sure that I am doing something wrong that will be obvious to those who have configured Apache before. Since I can't load Apache without both ServerRoot and DocumentRoot pointing to my Web site directory, it can't find the logs or other things it needs to run. Thanks!

Don

[tt]<VirtualHost apache>
DocumentRoot C:/Apache/htdocs
ServerAdmin myemail@address.com
ServerName apache
</VirtualHost>

Options FollowSymLinks Includes Indexes ExecCGI
DefaultType text/html
DirectoryIndex index.html index.htm index.shtml default.htm default.shtml
AccessFileName .htaccess
ThreadsPerChild 50
MaxRequestsPerChild 0
KeepAliveTimeout 15
MaxKeepAliveRequests 100
KeepAlive On
Timeout 300
UseCanonicalName on
ServerSignature on
ServerName 127.0.0.1
ScoreBoardFile logs/apache_status
PidFile logs/httpd.pid
CustomLog logs/access.log common
LogFormat &quot;%{User-agent}i&quot; agent
LogFormat &quot;%{Referer}i -> %U&quot; referer
LogFormat &quot;%h %l %u %t \&quot;%r\&quot; %>s %b&quot; common
LogFormat &quot;%h %l %u %t \&quot;%r\&quot; %>s %b \&quot;%{Referer}i\&quot; \&quot;%{User-Agent}i\&quot;&quot; combined
LogLevel warn
ErrorLog logs/error.log
DocumentRoot G:/Websites
ServerRoot G:/Websites
AddHandler cgi-script .cgi
ServerAdmin myotheremail@address.com
hostnameLookups off
Port 80
ServerType standalone[/tt]
[sig][/sig]
 
Have you tried putting the Virtual Host delcaration at the end of the file rather than at the beginning? That is the first thing that catches my eye. Normally you should have all of the other configuration options first.

[sig][/sig]
 
Hi Gerald,

Yes, it is at the end now and it is working, though that did not seem to have anything to do with it. It was a good thought, though. Part of the problem was that I had the ServerRoot wrong. It should have been C:/Apache but I think I was trying one more folder under that (I'm not there right now so don't remember exactly what it was).

After trying and trying to get Perl working but instead keep getting the Forbidden errors, I reinstalled both Apache and Perl to the same drive, saving my configuration file and upgrading to the next version of Apache while I was at it. I read elsewhere on tek-tips that that sometimes makes a difference. Unfortunately, Perl refuses to work with Apache and I am not sure what else needs to be done. The log file indicates that CGI is disabled in that directory in spite the directives that should turn it on. Sorry again, I am not there so don't have it in front of me.

Don [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top