httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Griffiths" <n...@adam-griffiths.co.uk>
Subject [users@httpd] starting httpd as a non-root user
Date Wed, 05 Nov 2003 11:46:54 GMT
Hi,
I have been running apache httpd for over three years on a server provided
to me by an ISP. The server automatically starts httpd from it's /etc/rc.

I have a login, but not root access, I can kill the httpd process (killall
httpd) and I would like to be able to start it again, without rebooting my
server and having /etc/rc do the job. The reason for this is that I need to
do some debugging and I would like to be able to stop and start httpd at
will from my non-root login account. However try as I might I can't start
http at  non-root.

I am logging in using ssh, with my non-root account and attempting to start
httpd, here is an example of what happens:

[...]$ httpd -X -D SSL -D NONROOT &
[1] 3548
[...]$
[1]+  Exit 1                  httpd -X -D SSL -D NONROOT
[...]$

httpd exits! but no errors appear in the error log.

I would be very grateful for any suggestions. My httpd.conf is below.

Kind Regards

Adam

###################################
# httpd.conf
ServerType standalone
ServerRoot /usr/local/etc/httpd


  LockFile /var/lock/httpd.lock
  PidFile /var/run/httpd.pid
  ScoreBoardFile /var/run/httpd.scoreboard

 #ResourceConfig /usr/local/etc/httpd/conf/srm.conf
 #AccessConfig /usr/local/etc/httpd/conf/access.conf
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 5
MaxSpareServers 10
StartServers 5
MaxClients 30
MaxRequestsPerChild 3000


# Dynamic Shared Object (DSO) support.
# Please respect the order below.

#LoadModule bandwidth_module /usr/lib/apache/mod_bandwidth.so
#mod_status - performance considerations
#LoadModule status_module /usr/lib/apache/mod_status.so
LoadModule includes_module /usr/lib/apache/mod_include.so
LoadModule autoindex_module /usr/lib/apache/mod_autoindex.so
#LoadModule asis_module /usr/lib/apache/mod_asis.so
#LoadModule imap_module /usr/lib/apache/mod_imap.so
#LoadModule action_module /usr/lib/apache/mod_actions.so
#LoadModule speling_module /usr/lib/apache/mod_speling.so
#LoadModule rewrite_module /usr/lib/apache/mod_rewrite.so
#LoadModule anon_auth_module /usr/lib/apache/mod_auth_anon.so
#LoadModule db_auth_module /usr/lib/apache/mod_auth_db.so
#LoadModule dbm_auth_module /usr/lib/apache/mod_auth_dbm.so
#LoadModule mysql_auth_module /usr/lib/apache/mod_auth_mysql.so
#LoadModule auth_pgsql_module /usr/lib/apache/mod_auth_pgsql.so

#LoadModule cern_meta_module /usr/lib/apache/mod_cern_meta.so

#LoadModule unique_id_module /usr/lib/apache/mod_unique_id.so
LoadModule perl_module /usr/lib/apache/libperl.so
#LoadModule php3_module /usr/lib/apache/libphp3.so
#LoadModule php4_module /opt/php-4.1.1/lib/apache/libphp4.so
#LoadModule dav_module /usr/lib/apache/libdav.so
LoadModule ssl_module /usr/lib/apache/libssl.so
#LoadModule python_module /usr/lib/apache/mod_python.so


#  Reconstruction of the complete module list from all available modules
#  (static and shared ones) to achieve correct module execution order.
#  [WHENEVER YOU CHANGE THE LOADMODULE SECTION ABOVE UPDATE THIS, TOO]
ClearModuleList
#AddModule mod_mmap_static.c
AddModule mod_vhost_alias.c
#AddModule mod_bandwidth.c
AddModule mod_env.c
AddModule mod_log_config.c
AddModule mod_log_agent.c
AddModule mod_log_referer.c
#AddModule mod_mime_magic.c
AddModule mod_mime.c
AddModule mod_negotiation.c
#AddModule mod_status.c
#This module provides a comprehensive overview of the server configuration
including all installed modules and directives in the configuration files.
#AddModule mod_info.c
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_db.c
#AddModule mod_auth_any.c
#AddModule mod_auth_dbm.c
#AddModule auth_ldap.c
#AddModule mod_auth_mysql.c
#AddModule mod_auth_pgsql.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_example.c
#AddModule mod_unique_id.c
#AddModule mod_frontpage.c

AddModule mod_so.c
AddModule mod_setenvif.c
AddModule mod_perl.c
#AddModule mod_php3.c
#AddModule mod_php4.c
#AddModule mod_dav.c
#AddModule mod_roaming.c
AddModule mod_ssl.c
#AddModule mod_put.c
#AddModule mod_python.c



PerlSetEnv PERL5PATH
/usr/local/lib/perl5/site_perl:/usr/local/lib/perl5/site_perl/i386-linux-thr
ead-multi


<Perl>
use lib '/usr/local/lib/perl5/site_perl';
use lib '/usr/local/lib/perl5/site_perl/i386-linux-thread-multi';
</Perl>

#########################
# AxKit
#########################

#PerlModule Apache::DBI
PerlModule AxKit

##Appache Directives
##Apparently not nesesary for AxKit 1.6 and later
#AddType text/xml .xsp
#AddType text/xml .xml
#AddType text/xml .xsl

#AddHandler axkit .xml
#AddHandler axkit .xsp
#AddHandler axkit .dkb

##AxAddStyleMap
##This is one of the more important directives. It is responsible for
##mapping module stylesheet MIME types to stylesheet processor modules (the
##reason we do this is to make it easy to switch out different modules for
##the same functionality, for example different XSLT processors).

#AxAddStyleMap text/xsl Apache::AxKit::Language::LibXSLT
#AxAddStyleMap application/x-xsp Apache::AxKit::Language::XSP
#AxAddStyleMap application/x-xpathscript
Apache::AxKit::Language::XPathScript

#AxNoCache On
AxDebugLevel 10
#AxLogDeclines Off
#AxCacheDir /usr/local/axcache
#AxGzipOutput Off

##AxAddXSPTaglib
##XSP supports two types of tag libraries. The simplest type to understand
##is merely an XSLT or XPathScript (or other transformation language)
##stylesheet that transforms custom tags into the "raw" XSP tag form.
##However there is another kind, that is faster, and these taglibs
##transform
##the custom tags into pure code which then gets compiled. These taglibs
##must be loaded into the server using the AxAddXSPTaglib configuration
##directive.
#AxAddXSPTaglib AxKit::XSP::Util
#AxAddXSPTaglib AxKit::XSP::Param
#AxAddXSPTaglib AxKit::XSP::Cookie
#AxAddXSPTaglib AxKit::XSP::ESQL
#AxAddXSPTaglib AxKit::XSP::WebUtils
#AxAddXSPTaglib AxKit::XSP::AttrParam
#AxAddXSPTaglib AxKit::XSP::CharsetConv
#AxAddXSPTaglib AxKit::XSP::Sendmail
#AxAddXSPTaglib GCT::XSP::Shopping
#AxAddXSPTaglib GCT::XSP::Encrypt
#AxAddXSPTaglib GCT::XSP::GCForm
#AxAddXSPTaglib GCT::XSP::GCValidate


#PerlSetVar AxXPSInterpolate 1

####################
#End AxKit
####################

SSLEngine off

<IfDefine !NONROOT>
    Port 80
    Listen 212.69.201.109:80
</IfDefine>

<IfDefine NONROOT>
    Port 1234
    Listen 212.69.201.109:1234
</IfDefine>


<IfDefine SSL>
Listen 212.69.201.109:443
</IfDefine>

<IfDefine !NONROOT>
    User web
    Group web
</IfDefine>

ServerAdmin me@my.domain
ServerName my.domain
DocumentRoot /home/httpd/docs

UseCanonicalName On
TypesConfig /usr/local/etc/httpd/conf/mime.types
DefaultType text/plain

<IfModule mod_mime_magic.c>
    MIMEMagicFile /usr/local/etc/httpd/conf/magic
</IfModule>

ServerSignature On

Alias /icons/ "/home/httpd/icons/"

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

IndexOptions FancyIndexing

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

AddEncoding x-compress Z
AddEncoding x-gzip gz

AddLanguage en .en
AddLanguage fr .fr
AddLanguage de .de
AddLanguage da .da
AddLanguage el .el
AddLanguage it .it

LanguagePriority en fr de

AddType application/x-httpd-php3 .php3
AddType application/x-httpd-php3-source .phps
AddType application/x-httpd-php .php .php4
AddType application/x-httpd-php-source .phps

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

<IfDefine SSL>
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl    .crl
</IfDefine>

<IfModule mod_ssl.c>
SSLPassPhraseDialog  builtin
SSLSessionCache         dbm:/var/log/httpd/ssl_scache
SSLSessionCacheTimeout  300
SSLMutex  file:/var/log/httpd/ssl_mutex
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
#LOG MOVE

<IfDefine !NONROOT>
   SSLLog /var/log/httpd/ssl_engine_log
</IfDefine>

<IfDefine NONROOT>
   SSLLog /www/logs/errors/ssl_engine_log
</IfDefine>


SSLLogLevel error
</IfModule>

NameVirtualHost 212.69.201.109

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot /home/httpd/docs

#
# Each directory to which Apache has access, can be configured with respect

# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# permissions.
#
<Directory />
    Options FollowSymLinks Indexes
    AllowOverride All
</Directory>

#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#

#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory /home/httpd/docs>

#
# This may also be "None", "All", or any combination of "Indexes",
# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
    Options Indexes FollowSymLinks

#
# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo",
# "AuthConfig", and "Limit"
#
    AllowOverride All

#
# Controls who can get stuff from this server.
#
    Order allow,deny
    Allow from all
</Directory>

#
# UserDir: The name of the directory which is appended onto a user's home
# directory if a ~user request is received.
#
#UserDir public_html

#
# Control access to UserDir directories.  The following is an example
# for a site where these directories are restricted to read-only.
#
#<Directory /*/public_html>
#    AllowOverride FileInfo AuthConfig Limit
#    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
#    <Limit GET POST OPTIONS PROPFIND>
#        Order allow,deny
#        Allow from all
#    </Limit>
#    <Limit PUT DELETE PATCH PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
#        Order deny,allow
#        Deny from all
#    </Limit>
#</Directory>

#
# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index.  Separate multiple entries with spaces.
#
DirectoryIndex index.html index.htm index.xml index.xsp

#
# AccessFileName: The name of the file to look for in each directory
# for access control information.
#
AccessFileName .htaccess

#
# The following lines prevent .htaccess files from being viewed by
# Web clients.  Since .htaccess files often contain authorization
# information, access is disallowed for security reasons.  Comment
# these lines out if you want Web visitors to see the contents of
# .htaccess files.  If you change the AccessFileName directive above,
# be sure to make the corresponding changes here.
#
<Files .htaccess>
    Order allow,deny
    Deny from all
</Files>

HostnameLookups Off

#
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
#LOG MOVE

<IfDefine !NONROOT>
   ErrorLog  /var/log/httpd/error_log
</IfDefine>

<IfDefine NONROOT>
   ErrorLog  /www/logs/errors/error_log
</IfDefine>




#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn

#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
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

#
# The location and format of the access logfile (Common Logfile Format).
# If you do not define any access logfiles within a <VirtualHost>
# container, they will be logged here.  Contrariwise, if you *do*
# define per-<VirtualHost> access logfiles, transactions will be
# logged therein and *not* in this file.
#
#CustomLog /var/log/httpd/access_log common

#
# If you would like to have agent and referer logfiles, uncomment the
# following directives.
#
#CustomLog /var/log/httpd/referer_log referer
#CustomLog /var/log/httpd/agent_log agent

#
# If you prefer a single logfile with access, agent, and referer information
# (Combined Logfile Format) you can use the following directive.
#
#CustomLog /var/log/httpd/access_log combined

#
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the realname directory are treated as applications and
# run by the server when requested rather than as documents sent to the
client.
# The same rules about trailing "/" apply to ScriptAlias directives as to
# Alias.
#
ScriptAlias /cgi-bin/ "/home/httpd/cgi-bin/"

#
# "/usr/apps/apache/cgi-bin" should be changed to whatever your
ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "/home/httpd/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>

#
# AddType allows you to tweak mime.types without actually editing it, or to
# make certain files to be certain types.
#

#
# AddHandler allows you to map certain file extensions to "handlers",
# actions unrelated to filetype. These can be either built into the server
# or added with the Action command (see below)
#
# If you want to use server side includes, or CGI outside
# ScriptAliased directories, uncomment the following lines.
#
# To use CGI scripts:
#
AddHandler cgi-script .cgi .pl

#
# To use server-parsed HTML files
#
#AddType text/html .shtml
#AddHandler server-parsed .shtml

#
# Uncomment the following line to enable Apache's send-asis HTTP file
# feature
#
#AddHandler send-as-is asis

#
# If you wish to use server-parsed imagemap files, use
#
#AddHandler imap-file map

#
# To enable type maps, you might want to use
#
#AddHandler type-map var

# javascript
#AddHandler javascript-html .jshtml
#AddHandler javascript-script .ssjs

#
# Action lets you define media types that will execute a script whenever
# a matching file is called. This eliminates the need for repeated URL
# pathnames for oft-used CGI file processors.
# Format: Action media/type /cgi-script/location
# Format: Action handler-name /cgi-script/location
#

#
# MetaDir: specifies the name of the directory in which Apache can find
# meta information files. These files contain additional HTTP headers
# to include when sending the document
#
#MetaDir .web

#
# MetaSuffix: specifies the file name suffix for the file containing the
# meta information.
#
#MetaSuffix .meta

#
# Customizable error response (Apache style)
#  these come in three flavors
#
#    1) plain text
#ErrorDocument 500 "The server made a boo boo.
#  n.b.  the (") marks it as text, it does not get output
#
#    2) local redirects
#ErrorDocument 404 /missing.html
#  to redirect to local URL /missing.html
#ErrorDocument 404 /cgi-bin/missing_handler.pl
ErrorDocument 404 "The page you are looking for does not exist"

#  N.B.: You can redirect to a script or a document using
server-side-includes.
#
#    3) external redirects
#ErrorDocument 402 http://some.other_server.com/subscription_info.html
#  N.B.: Many of the environment variables associated with the original
#  request will *not* be available to such a script.


<IfDefine SSL>
    # Insert SSL enabled virtual hosts within
    # this <Ifdefine> ... </IfDefine> section.

</IfDefine>


# Standard non-SSL enabled virtual hosts

#first Virtual host is the default

########
#default
########
<VirtualHost 212.69.201.109>
    ServerName holding.my.doamin
    DocumentRoot /www/vhtdocs/holding/
</VirtualHost>

## ... etc more virual hosts here




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message