LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-18-2006, 08:29 PM   #1
karan101
Member
 
Registered: Aug 2004
Location: CANADA
Distribution: Fedora core4
Posts: 60

Rep: Reputation: 15
apache configuration


hello everyone
anybody can help me with configuring my apache server so I can have 2 servers on my machine... i.e I have 2 accounts "mike" and "al" (/home/mike/public_html) and my brother's account (/home/al/public_html). basically I want to have it like when i type www.localhost/~mike , my website comes up.right now when i do www.localhost I get the index page of apache saying that the webserver is working... Im runnig mandriva 2006 with Linux localhost 2.6.12-12mdk #1 Fri Sep 9 17:26:56 CEST 2005 x86_64 AMD Athlon(tm) 64 Processor 3200+ unknown GNU/Linux

thanx
Here is the httpd.conf

Code:
#
ServerRoot "/etc/httpd"



</IfModule>



PidFile /var/run/httpd.pid

Timeout 300


KeepAlive On


MaxKeepAliveRequests 100

KeepAliveTimeout 15

<IfModule prefork.c>
    StartServers 8
    MinSpareServers 5
    MaxSpareServers 20
    ServerLimit 256
    MaxClients 256
    MaxRequestsPerChild 4000
</IfModule>


<IfModule worker.c>
    StartServers 2
    MaxClients 150
    MinSpareThreads 25
    MaxSpareThreads 75 
    ThreadsPerChild 25
    MaxRequestsPerChild 0
</IfModule>


<IfModule perchild.c>
    NumServers 5
    StartThreads 5
    MinSpareThreads 5
    MaxSpareThreads 10
    MaxThreadsPerChild 20
    MaxRequestsPerChild 0
</IfModule>


<IfModule peruser.c>
    MinSpareServers 2
    MaxProcessors 10
    MaxClients 150
    MaxRequestsPerChild 100
    Multiplexer apache apache
    # Processor user group /home/user
    # chroot dir is optional:
    # Processor user group
</IfModule>



Listen 0.0.0.0:80


LoadModule access_module modules/mod_access.so
LoadModule auth_module modules/mod_auth.so
LoadModule auth_anon_module modules/mod_auth_anon.so
LoadModule auth_digest_module modules/mod_auth_digest.so

LoadModule include_module modules/mod_include.so

LoadModule log_config_module modules/mod_log_config.so

LoadModule logio_module modules/mod_logio.so
LoadModule env_module modules/mod_env.so
LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so
LoadModule usertrack_module modules/mod_usertrack.so
LoadModule setenvif_module modules/mod_setenvif.so

LoadModule mime_module modules/mod_mime.so

LoadModule status_module modules/mod_status.so
LoadModule autoindex_module modules/mod_autoindex.so

LoadModule info_module modules/mod_info.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule dir_module modules/mod_dir.so
LoadModule imap_module modules/mod_imap.so
LoadModule actions_module modules/mod_actions.so


LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so


Include modules.d/*.conf


Include conf.d/*.conf




User apache
Group apache


ServerAdmin root@localhost

UseCanonicalName Off


DocumentRoot "/var/www/html"


<Directory />
    Options -All -Multiviews
    AllowOverride None
    <IfModule mod_access.c>
	Order deny,allow
	Deny from all
    </IfModule>
</Directory>



<Directory "/var/www/html">


    Options -Indexes FollowSymLinks MultiViews


    AllowOverride None


    <IfModule mod_access.c>
	Order allow,deny
	Allow from all
    </IfModule>

</Directory>


<IfModule mod_include.c>
    <IfModule mod_dir.c>
	DirectoryIndex index.shtml
    </IfModule>
</IfModule>

<IfModule mod_dir.c>
    DirectoryIndex index.html index.html.var index.cgi index.pl index.htm Default.htm default.htm index.xml
</IfModule>


AccessFileName .htaccess


<IfModule mod_access.c>
    <Files ~ "^\.ht">
	Order allow,deny
	Deny from all
    </Files>
</IfModule>

##
<IfModule mod_mime.c>
    TypesConfig conf/mime.types
</IfModule>

#
DefaultType text/plain

#
<IfModule mod_mime_magic.c>
    MIMEMagicFile conf/magic
</IfModule>


HostnameLookups Off

#
ErrorLog logs/error_log

#
LogLevel warn

#
<IfModule mod_log_config.c>
    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
    LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" VLOG=%{VLOG}e" vhost

    <IfModule mod_logio.c>
	# You need to enable mod_logio.c to use %I and %O
	#LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </IfModule>

    # You need to enable mod_logio.c to use %I and %O
    #LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio

   
    CustomLog logs/access_log common

   
  
    CustomLog logs/access_log combined env=!VLOG

    CustomLog "|/usr/sbin/advxsplitlogfile-DIET" vhost env=VLOG

</IfModule>

#
ServerTokens OS

#
ServerSignature On

#
# Aliases: Add here as many aliases as you need (with no limit). The format is 
# Alias fakename realname
#
<IfModule mod_alias.c>
   
    Alias /icons/ "/var/www/icons/"
    Alias /error/ "/var/www/error/"

    
    ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
    ScriptAlias /protected-cgi-bin/ "/var/www/protected-cgi-bin/"
</IfModule>

<Directory "/var/www/icons">
    Options -Indexes MultiViews
    AllowOverride None
    <IfModule mod_access.c>
	Order allow,deny
    	Allow from all
    </IfModule>
</Directory>

<IfModule mod_cgid.c>
    
</IfModule>

#
<Directory "/var/www/cgi-bin">
    AllowOverride All
    Options ExecCGI
    <IfModule mod_access.c>
	Order allow,deny
	Allow from all
    </IfModule>
</Directory>

<Directory "/var/www/protected-cgi-bin">
    AllowOverride All
    Options ExecCGI
    <IfModule mod_access.c>
	Order deny,allow
	Deny from all
	Allow from 127.0.0.1
	#allow from .your_domain.com
    </IfModule>
</Directory>

##
<IfModule mod_autoindex.c>
    # FancyIndexing is whether you want fancy directory indexing or standard
    IndexOptions FancyIndexing VersionSort NameWidth=*

    # AddIcon* directives tell the server which icon to show for different
    # files or filename extensions.  These are only displayed for
    # FancyIndexed directories.
    AddIconByEncoding (CMP,/icons/compressed.png) x-compress x-gzip

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

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

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

    # DefaultIcon is which icon to show for files which do not have an icon
    # explicitly set.
    DefaultIcon /icons/unknown.png

   
    ReadmeName README.html
    HeaderName HEADER.html

    # IndexIgnore is a set of filenames which directory indexing should ignore
    # and not include in the listing.  Shell-style wildcarding is permitted.
    IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
</IfModule>

<IfModule mod_mime.c>
    AddLanguage ca .ca
    AddLanguage cs .cz .cs
    AddLanguage da .dk
    AddLanguage de .de
    AddLanguage el .el
    AddLanguage en .en
    AddLanguage eo .eo
    AddLanguage es .es
    AddLanguage et .et
    AddLanguage fr .fr
    AddLanguage he .he
    AddLanguage hr .hr
    AddLanguage it .it
    AddLanguage ja .ja
    AddLanguage ko .ko
    AddLanguage ltz .ltz
    AddLanguage nl .nl
    AddLanguage nn .nn
    AddLanguage no .no
    AddLanguage pl .po
    AddLanguage pt .pt
    AddLanguage pt-BR .pt-br
    AddLanguage ru .ru
    AddLanguage sv .sv
    AddLanguage zh-CN .zh-cn
    AddLanguage zh-TW .zh-tw

  
    <IfModule mod_negotiation.c>
	LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW
    </IfModule>

    
	ForceLanguagePriority Prefer Fallback
    </IfModule>

   
    AddCharset ISO-8859-1  .iso8859-1  .latin1
    AddCharset ISO-8859-2  .iso8859-2  .latin2 .cen
    AddCharset ISO-8859-3  .iso8859-3  .latin3
    AddCharset ISO-8859-4  .iso8859-4  .latin4
    AddCharset ISO-8859-5  .iso8859-5  .latin5 .cyr .iso-ru
    AddCharset ISO-8859-6  .iso8859-6  .latin6 .arb
    AddCharset ISO-8859-7  .iso8859-7  .latin7 .grk
    AddCharset ISO-8859-8  .iso8859-8  .latin8 .heb
    AddCharset ISO-8859-9  .iso8859-9  .latin9 .trk
    AddCharset ISO-2022-JP .iso2022-jp .jis
    AddCharset ISO-2022-KR .iso2022-kr .kis
    AddCharset ISO-2022-CN .iso2022-cn .cis
    AddCharset Big5        .Big5       .big5
    # For russian, more than one charset is used (depends on client, mostly):
    AddCharset WINDOWS-1251 .cp-1251   .win-1251
    AddCharset CP866       .cp866
    AddCharset KOI8-r      .koi8-r .koi8-ru
    AddCharset KOI8-ru     .koi8-uk .ua
    AddCharset ISO-10646-UCS-2 .ucs2
    AddCharset ISO-10646-UCS-4 .ucs4
    AddCharset UTF-8       .utf8

    
    AddCharset GB2312      .gb2312 .gb 
    AddCharset utf-7       .utf7
    AddCharset utf-8       .utf8
    AddCharset big5        .big5 .b5
    AddCharset EUC-TW      .euc-tw
    AddCharset EUC-JP      .euc-jp
    AddCharset EUC-KR      .euc-kr
    AddCharset shift_jis   .sjis

  
    AddDefaultCharset Off

   
   
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddType image/x-icon .ico

   
    AddHandler cgi-script .cgi

    


    AddHandler imap-file map

   
    AddHandler type-map var

   
    <IfModule mod_include.c>
	AddType text/html .shtml
	AddOutputFilter INCLUDES .shtml
    </IfModule>
</IfModule>


<IfModule mod_negotiation.c>
<IfModule mod_include.c>
    <Directory "/var/www/error">
        AllowOverride None
        Options IncludesNoExec
        AddOutputFilter Includes html
        AddHandler type-map var
        Order allow,deny
        Allow from all
        LanguagePriority en es de fr
        ForceLanguagePriority Prefer Fallback
    </Directory>
    ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
    ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
    ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
    ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
    ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
    ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
    ErrorDocument 410 /error/HTTP_GONE.html.var
    ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
    ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
    ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
    ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
    ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
    ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
    ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
    ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
    ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
    ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var
</IfModule>
</IfModule>


<IfModule mod_setenvif.c>
    # The following directives modify normal HTTP response behavior to
    # handle known problems with browser implementations.
    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

    # The following directive disables redirects on non-GET requests for
    # a directory that does not include the trailing slash.  This fixes a 
    # problem with Microsoft WebFolders which does not appropriately handle 
    # redirects for folders with DAV methods.
    # Same deal with Apple's DAV filesystem and Gnome VFS support for DAV.
    BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
    BrowserMatch "^WebDrive" redirect-carefully
    BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully
    BrowserMatch "^gnome-vfs" redirect-carefully
</IfModule>


<IfModule mod_status.c>
    <Location /server-status>
	SetHandler server-status
        <IfModule mod_access.c>
	    Order deny,allow
	    Deny from all
	    allow from 127.0.0.1
	    #Allow from .your_domain.com
        </IfModule>
    </Location>

  
    ExtendedStatus On
</IfModule>
#
<IfModule mod_info.c>
    <Location /server-info>
	SetHandler server-info
        <IfModule mod_access.c>
	    Order deny,allow
	    Deny from all
	    allow from 127.0.0.1
	    #Allow from .your_domain.com
        </IfModule>
    </Location>
</IfModule>

<IfModule mod_usertrack.c>
    # This is the default.
    CookieName Apache
</IfModule>

<Directory /var/www/html/addon-modules>
    Options Indexes FollowSymLinks
</Directory>

<Location /index.shtml>
    Options +Includes
</Location>

Include conf/fileprotector.conf


Include conf/webapps.d/*.conf


Include conf/vhosts.d/*.conf

Last edited by karan101; 05-18-2006 at 08:34 PM.
 
Old 05-19-2006, 12:32 AM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 272Reputation: 272Reputation: 272
Which version of apache are you running? 1.3, 2.0, or 2.2?

In 2.0, which I have installed, edit the file /etc/apache2/apache2.conf and about 2/3 of the way through the config file there's a line that says
Code:
#UserDir is now a module
UserDir public_html
UserDir disabled root

<Directory /home/*/public_html>
	AllowOverride FileInfo AuthConfig Limit
	Options Indexes SymLinksIfOwnerMatch IncludesNoExec
</Directory>
Make sure the line in bold is uncommented (i.e. no # sign in front)

Last edited by pljvaldez; 05-19-2006 at 12:38 PM.
 
Old 05-19-2006, 02:07 AM   #3
karan101
Member
 
Registered: Aug 2004
Location: CANADA
Distribution: Fedora core4
Posts: 60

Original Poster
Rep: Reputation: 15
ummm , I have apache 2.054 version and don't have apache2.conf file all I have is httpd.conf which I posted. Do you think I should modify httpd.conf file...?
thanks Mike

Last edited by karan101; 05-19-2006 at 02:40 AM.
 
Old 05-19-2006, 12:42 PM   #4
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 272Reputation: 272Reputation: 272
Uh, maybe??? My httpd.conf file basically is empty and just says "This file is here for backwards compatibility reasons, blah blah..." Sorry, but I've just started poking around with apache recently so I'm not sure how the old configurations worked. But I assume you'd have to add something like that to the main config file...
 
Old 05-19-2006, 01:00 PM   #5
karan101
Member
 
Registered: Aug 2004
Location: CANADA
Distribution: Fedora core4
Posts: 60

Original Poster
Rep: Reputation: 15
thanks pljvaldez.... Anybody else can help me on this...???
 
Old 05-21-2006, 08:16 AM   #6
Rindert
LQ Newbie
 
Registered: Jun 2005
Location: Roosendaal
Distribution: Kubuntu 6.10, amd64
Posts: 13

Rep: Reputation: 0
I'm not an apache expert in any way. But the httpd.conf is the old config file. I think is was becomming to large to be functional so the came up with seprate files for different parts of the configuration.
If your apache olny has the httpd.conf you can use all apache directives can use in other config files. So yes, you can use in your httpd.conf
Code:
#UserDir is now a module
UserDir public_html
UserDir disabled root

<Directory /home/*/public_html>
        AllowOverride FileInfo AuthConfig Limit
        Options Indexes SymLinksIfOwnerMatch IncludesNoExec
</Directory>
The new syle of config is only to make it easier to config. At the end internelly it becomes one config file again, using includes in the new 2.0 config style.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
apache configuration simcox1 Linux - Networking 14 10-25-2005 06:46 AM
Apache Configuration chimp Linux - Newbie 3 12-14-2004 06:24 PM
Apache 2 configuration kvtournh Linux - Newbie 1 11-13-2003 06:45 AM
Apache configuration help. cowboypete Mandriva 1 10-29-2003 09:38 AM
Apache 2 Configuration..... odgey Linux - Software 2 06-27-2003 03:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration