Web Server Configuration
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsWeb DesignWeb Server Configuration

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old August 16th, 2004, 01:48 PM
JeffX JeffX is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 2 JeffX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Apache, VirtualHosts and Logs

I'm new to Apache and am trying to set up logs, but I am unclear as to what goes where. I've put the directives in the VirtualHost containers.(Doesn't this override what is in the Main Server Configuration file?) It's Apache v. 1.3 (It comes bundled with Mac OS X). I've gotten the VirtualHost's to work, but when I try to enable logging, the server won"t start up. Here is the httpd.conf file. I've taken the commented stuff out for brevity. I know something is being left out or perhaps file paths are wrong. Also, if I put a text file in /Library/WebServer/Documents/Logs/error_log, will Apache write the error info there? Thanks in advance.

ServerType standalone

ServerRoot "/usr"

#LockFile "/private/var/run/httpd.lock"

PidFile "/private/var/run/httpd.pid"

ScoreBoardFile "/private/var/run/httpd.scoreboard"

#ResourceConfig conf/srm.conf
#AccessConfig conf/access.conf

Timeout 300

KeepAlive On

MaxKeepAliveRequests 100

KeepAliveTimeout 15

MinSpareServers 1
MaxSpareServers 5

StartServers 1

MaxClients 150

MaxRequestsPerChild 100000

#Listen 3000

#BindAddress *

mod_vhost_alias.so

LoadModule config_log_module libexec/httpd/mod_log_config.so
mod_mime_magic.so
LoadModule mime_module libexec/httpd/mod_mime.so
LoadModule negotiation_module libexec/httpd/mod_negotiation.so

LoadModule includes_module libexec/httpd/mod_include.so
LoadModule autoindex_module libexec/httpd/mod_autoindex.so
LoadModule dir_module libexec/httpd/mod_dir.so
LoadModule cgi_module libexec/httpd/mod_cgi.so
LoadModule asis_module libexec/httpd/mod_asis.so
LoadModule imap_module libexec/httpd/mod_imap.so
LoadModule action_module libexec/httpd/mod_actions.so
LoadModule userdir_module libexec/httpd/mod_userdir.so
LoadModule alias_module libexec/httpd/mod_alias.so
LoadModule rewrite_module libexec/httpd/mod_rewrite.so
LoadModule access_module libexec/httpd/mod_access.so
LoadModule auth_module libexec/httpd/mod_auth.so
mod_auth_anon.so
mod_auth_dbm.so
mod_cern_meta.so
LoadModule setenvif_module libexec/httpd/mod_setenvif.so
LoadModule hfs_apple_module libexec/httpd/mod_hfs_apple.so
LoadModule rendezvous_apple_module libexec/httpd/mod_rendezvous_apple.so

# [WHENEVER YOU CHANGE THE LOADMODULE SECTION ABOVE UPDATE THIS, TOO]
ClearModuleList
AddModule mod_log_config.c
#AddModule mod_mime_magic.c
AddModule mod_mime.c
AddModule mod_negotiation.c
#AddModule mod_status.c
#AddModule mod_info.
AddModule mod_include.c
AddModule mod_autoindex.c
AddModule mod_dir.c
AddModule mod_cgi.c
AddModule mod_asis.c
AddModule mod_imap.c
AddModule mod_actions.c
#AddModule mod_speling.c
AddModule mod_userdir.c
AddModule mod_alias.c
AddModule mod_rewrite.c
AddModule mod_access.c
AddModule mod_auth.c
#AddModule mod_auth_anon.c
#AddModule mod_auth_dbm.c
#AddModule mod_digest.c
#AddModule mod_proxy.c
#AddModule mod_cern_meta.c
#AddModule mod_expires.c
#AddModule mod_headers.c
#AddModule mod_usertrack.c
#AddModule mod_unique_id.c
AddModule mod_so.c
AddModule mod_setenvif.c
#AddModule mod_dav.c
#AddModule mod_ssl.c
#AddModule mod_perl.c
#AddModule mod_php4.c
AddModule mod_hfs_apple.c
AddModule mod_rendezvous_apple.c

#ExtendedStatus On

### Section 2: 'Main' server configuration

Port 80

User www
Group www

#ServerAdmin webmaster@example.com

#ServerName blaze

DocumentRoot "/Library/WebServer/Documents"

<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>

<Directory "/Library/WebServer/Documents">

Options Indexes FollowSymLinks MultiViews

AllowOverride None

Order allow,deny
Allow from all
</Directory>

<IfModule mod_userdir.c>
UserDir Sites
</IfModule>

#<Directory /home/*/Sites>
# AllowOverride FileInfo AuthConfig Limit
# Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
# <Limit GET POST OPTIONS PROPFIND>
# Order allow,deny
# Allow from all
# </Limit>
# <LimitExcept GET POST OPTIONS PROPFIND>
# Order deny,allow
# Deny from all
# </LimitExcept>
#</Directory>

<IfModule mod_dir.c>
DirectoryIndex index.html
</IfModule>

AccessFileName .htaccess

#
<Files ~ "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</Files>

#CacheNegotiatedDocs

UseCanonicalName On

#
<IfModule mod_mime.c>
TypesConfig /private/etc/httpd/mime.types
</IfModule>

#

DefaultType text/plain

#
<IfModule mod_mime_magic.c>
MIMEMagicFile /private/etc/httpd/magic
</IfModule>

HostnameLookups Off

ErrorLog "/Library/WebServer/Documents/Logs/error_log"

LogLevel warn

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

CustomLog "/Library/WebServer/Documents/Logs" combined

#CustomLog "/private/var/log/httpd/referer_log" referer
#CustomLog "/private/var/log/httpd/agent_log" agent

#CustomLog "/private/var/log/httpd/access_log" combined

ServerSignature On

<IfModule mod_alias.c>

Alias /icons/ "/usr/share/httpd/icons/"

<Directory "/usr/share/httpd/icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

Alias /manual/ "/Library/WebServer/Documents/manual/"

<Directory "/Library/WebServer/Documents/manual">
Options Indexes FollowSymlinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

ScriptAlias /cgi-bin/ "/Library/WebServer/CGI-Executables/"

<Directory "/Library/WebServer/CGI-Executables">
AllowOverride None
Options None
Order allow,deny Allow from all
</Directory>

</IfModule>

<IfModule mod_autoindex.c>

AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip

AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*

AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core

AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^

DefaultIcon /icons/unknown.gif

ReadmeName README
HeaderName HEADER

IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t

</IfModule>

<IfModule mod_mime.c>

AddEncoding x-compress Z
AddEncoding x-gzip gz tgz

<IfModule mod_negotiation.c>
LanguagePriority en da nl et fr de el it ja kr no pl pt pt-br ru ltz ca es s$
</IfModule>

AddType application/x-tar .tgz
AddType image/x-icon .ico

</IfModule>
# End of document types.

<IfModule mod_setenvif.c>

BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0

BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0

</IfModule>
# End of browser customization directives

### Section 3: Virtual Hosts

NameVirtualHost *:80

<VirtualHost *:80>
ServerName mycapehome.net
ServerAlias www.mycapehome.net
DocumentRoot /Library/WebServer/Documents
#ErrorLog /Library/WebServer/Documents/Logs/error_log
#CustomLog Library/WebServer/Documents/Logs/web_log "combined"
</VirtualHost>

<VirtualHost *:80>
ServerName dreyerhomes.com
ServerAlias www.dreyerhomes.com
DocumentRoot /Library/WebServer/Documents2
#ErrorLog /Library/WebServer/Documents2/Logs/error_log
#CustomLog /Library/WebServer/Documents2/Logs/web_log "combined"
</VirtualHost>


<IfModule mod_php4.c>
# If php is turned on, we repsect .php and .phps files.
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

# Since most users will want index.php to work we
# also automatically enable index.php
<IfModule mod_dir.c>
DirectoryIndex index.html index.php
</IfModule>
</IfModule>

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
</IfModule>

<IfModule mod_rendezvous_apple.c>
# Only the pages of users who have edited their
# default home pages will be advertised on Rendezvous.
RegisterUserSite customized-users
#RegisterUserSite all-users

# Rendezvous advertising for the primary site is off by default.
#RegisterDefaultSite
</IfModule>

Include /private/etc/httpd/users/*.conf

Reply With Quote
  #2  
Old August 16th, 2004, 02:18 PM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
What error are you getting? Try running "/path/to/httpd configtest" to see if it'll output an error for you.
__________________
Please don't PM me asking for solutions outside the scope of a thread.
Keeping all responses in a thread stands to help others who come along later,
which is after all what this forum's all about.

Reply With Quote
  #3  
Old August 16th, 2004, 04:58 PM
JeffX JeffX is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 2 JeffX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by dhouston
What error are you getting? Try running "/path/to/httpd configtest" to see if it'll output an error for you.

Thanks for replying, I'm also new to Terminal and am not sure what the path tohttpd is but below is what I tried;

Last login: Mon Aug 16 15:37:17 on console
Welcome to Darwin!
[Alethea:Volumes/Drive V/jeffreydreyer] jeffreyd% /etc/httpd/httpd.conf configtest
tcsh: /etc/httpd/httpd.conf: Permission denied.
[Alethea:Volumes/Drive V/jeffreydreyer] jeffreyd% sudo /etc/httpd/httpd.conf configtest
Password:
sudo: /etc/httpd/httpd.conf: command not found
[Alethea:Volumes/Drive V/jeffreydreyer] jeffreyd% sudo open /etc/httpd/httpd.conf configtest
2004-08-16 17:43:25.354 open[1835] LSOpenFromURLSpec() returned -10814 for application (null) path /etc/httpd/httpd.conf.
2004-08-16 17:43:25.355 open[1835] Couldn't open file: /etc/httpd/httpd.conf
[Alethea:Volumes/Drive V/jeffreydreyer] jeffreyd% sudo open /Library/Webserver/error_log
[Alethea:Volumes/Drive V/jeffreydreyer] jeffreyd% sudo open /Library/Webserver/error_log/error_log
[Alethea:Volumes/Drive V/jeffreydreyer] jeffreyd% sudo httpd configtest
Processing config directory: /private/etc/httpd/users/*.conf
fopen: Is a directory
httpd: could not open error log file /Library/WebServer/error_log.
[Alethea:Volumes/Drive V/jeffreydreyer] jeffreyd%

Reply With Quote
  #4  
Old August 17th, 2004, 07:13 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Looks like you've got a case issue. The directory you've created is /Library/Webserver. The directory you're referencing in your conf is /Library/WebServer (note the upper-case "s"). Try changing one or the other so that they match and see if that fixes the problem for you.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsWeb DesignWeb Server Configuration > Apache, VirtualHosts and Logs


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway