LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-04-2007, 11:21 AM   #1
metalenkist
Member
 
Registered: Aug 2005
Distribution: OpenSuse 11.1
Posts: 36

Rep: Reputation: 15
Question Apche 2, Vhosts and subdomains


At first my excuse for upcoming badly misspelled word and absuse of the english grammar

Well I got some serious problems with subdoains and I don't know where to start with debugging.

My subdain point to my main domain now and that wasn't really the plan as you can see to my apache conf below. I don't get any errors so where should I start searching for solving my problems.

Already thanks in advance.

Code:
NameVirtualHost *:80

<VirtualHost *:80>
    ServerAdmin info@leonweemen.nl
    DocumentRoot /var/www/html/
    ServerName www.leonweemen.nl
    ErrorLog logs/leonweemen.nl_www-error_log
    CustomLog logs/leonweemen.nl_www-access_log common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin weemen@leonweemen.nl
    DocumentRoot /var/www/html/etenisweten/html/
    ServerName etenisweten.leonweemen.nl
    ErrorLog logs/leonweemen.nl_etenisweten_log
    CustomLog logs/leonweemen.nl_etenisweten-access_log common
</VirtualHost>
Code:
[root@leonweemen conf]# httpd -S
VirtualHost configuration:
80.60.146.97:*         is a NameVirtualHost
         default server www.leonweemen.nl (/etc/httpd/conf.d/system-config-httpd.conf:346)
         port * namevhost www.leonweemen.nl (/etc/httpd/conf.d/system-config-httpd.conf:346)
wildcard NameVirtualHosts and _default_ servers:
_default_:443          www.leonweemen.nl (/etc/httpd/conf.d/ssl.conf:81)
*:*                    www.leonweemen.nl (/etc/httpd/conf.d/system-config-httpd.conf:315)
*:80                   is a NameVirtualHost
         default server www.leonweemen.nl (/etc/httpd/conf/httpd.conf:993)
         port 80 namevhost www.leonweemen.nl (/etc/httpd/conf/httpd.conf:993)
         port 80 namevhost etenisweten.leonweemen.nl (/etc/httpd/conf/httpd.conf:1001)
Syntax OK
[root@leonweemen conf]#
PS: I don't run a DNS server, my DNS records are managed by a hosting provider.
 
Old 04-04-2007, 11:43 AM   #2
fourchannel
Member
 
Registered: Jul 2006
Location: Tuscaloosa, AL - USA
Distribution: Gentoo
Posts: 30

Rep: Reputation: 15
I'm not really sure what exactly is the problem, but here is some parts of my config files that I think are relavent. Hopefully you can derive what you need from them.

Notice how my ServerName is commented out in the apache2.conf. I had to do this to get the virtual hosts to work right. Each of the virtual hosts does have a ServerName however.

apache2.conf
Code:
ServerRoot "/etc/apache2"

# My virtual hosts I need to access from inside my own network, and from the outside.
# Ports 81-84 are for the internal access.

listen 80
listen 81
listen 82
listen 83
listen 84

#ServerName schism.ath.cx
ServerTokens Minor
DirectorySlash On

# Include the virtual host configurations:
Include /etc/apache2/sites-enabled/[^.#]*
These two files below are the complete configs to 2 of my virtual hosts. 1 has password protection, the other does not. Stuff that has been ****** is info that is needed in the log file, but I don't want shown to the whole internet. Replace the ******* with your info where need be.

sites-available/lith
Code:
NameVirtualHost lith.ath.cx:80
<VirtualHost lith.ath.cx:80>
        ServerName lith.ath.cx.
        ServerAdmin webmaster@localhost

        DocumentRoot **************************
        <Directory ***************************>
                Options Indexes -FollowSymLinks MultiViews
                IndexOptions +FancyIndexing +FoldersFirst +IgnoreCase +NameWidth=* +SuppressDescription -IconsAreLinks
                AllowOverride None
                Order allow,deny
                allow from all
                # This directive allows us to have apache2's default start page
                # in /apache2-default/, but still have / go to the right place
                # Commented out for Ubuntu
                #RedirectMatch ^/$ /apache2-default/

###########################################################
#                  PASSWORD LOCATION disabled for port 80 on lith
###########################################################

#               AuthType Basic
#               Authname "Restricted"
#               AuthUserFile *************************************
#               Require valid-user
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/access.log combined
        ServerSignature On

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>
sites-available/arael
Code:
NameVirtualHost arael.ath.cx:80
<VirtualHost arael.ath.cx:80 arael.ath.cx:81>
        ServerName arael.ath.cx.
        ServerAdmin ***********************

        DocumentRoot *************************************
        <Directory *************************************>
                Options Indexes +FollowSymLinks MultiViews
                IndexOptions +FancyIndexing +FoldersFirst +IgnoreCase +NameWidth=* +SuppressDescription -IconsAreLinks
                AllowOverride None
                Order allow,deny
                allow from all
                # This directive allows us to have apache2's default start page
                # in /apache2-default/, but still have / go to the right place
                # Commented out for Ubuntu
                #RedirectMatch ^/$ /apache2-default/

###########################################################
#                  PASSWORD LOCATION
###########################################################

                AuthType Basic
                Authname "Restricted"
                AuthUserFile *************************************
                Require valid-user
        </Directory>








        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/access.log combined
        ServerSignature On

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>

Also, dont forget that you need to make sure that your symlinks are inorder.

This is a directory listing of /etc/apache2/sites-available
Code:
root@lith.ath.cx 11:38 sites-available]# ls -Flah
total 40K
drwxr-xr-x  2 root root 4.0K Mar 31 12:00 ./
drwxr-xr-x  8 root root 4.0K Oct  2  2006 ../
-r--r--r--  1 root root 1.7K Feb  8 15:31 arael
-r--r--r--  1 root root 1.8K May  6  2006 fissure
-r--r--r--  1 root root 1.7K Mar 18 21:57 leliel
-r--r--r--  1 root root 1.7K Jan 27 16:21 lith
-r--r--r--  1 root root 1.8K Mar 31 12:08 machina
-r--r--r--  1 root root 1.7K Apr 21  2006 matariel
-r--r--r--  1 root root  143 Feb 25 21:15 pool.ntp.org
-r--r--r--  1 root root 1.7K Apr 21  2006 schism
And this is /etc/apache2/sites-enabled
Code:
root@lith.ath.cx 11:39 sites-enabled]# ls -Flah
total 8.0K
drwxr-xr-x  2 root root 4.0K Mar 31 12:11 ./
drwxr-xr-x  8 root root 4.0K Oct  2  2006 ../
lrwxrwxrwx  1 root root   33 Jan 27 16:29 080-lith -> /etc/apache2/sites-available/lith
lrwxrwxrwx  1 root root   41 Feb 25 21:17 080-pool.ntp.org -> /etc/apache2/sites-available/pool.ntp.org
lrwxrwxrwx  1 root root   34 Apr  8  2006 081-arael -> /etc/apache2/sites-available/arael
lrwxrwxrwx  1 root root   36 Apr  8  2006 082-fissure -> /etc/apache2/sites-available/fissure
lrwxrwxrwx  1 root root   35 Apr  8  2006 083-leliel -> /etc/apache2/sites-available/leliel
lrwxrwxrwx  1 root root   36 Mar 31 12:11 084-machina -> /etc/apache2/sites-available/machina
Hopefully this will be helpful to you. Let me know if this doesn't get you anywhere.

Last edited by fourchannel; 04-04-2007 at 11:47 AM.
 
Old 04-04-2007, 12:07 PM   #3
metalenkist
Member
 
Registered: Aug 2005
Distribution: OpenSuse 11.1
Posts: 36

Original Poster
Rep: Reputation: 15
Thnx but it didn't work.
To avoid problems with symlinks I changed the directory path but with no luck.

I don't think that apache doesn't do anything at all with those vhosting code
cause if I take a other subdomain which can't be found in config files like (leon.leonweemen.nl),
the respons is exactly the same.

You might have noticed that webpage is responding differently on www.leonweemen.nl then subdomain.leonweemen.nl.
that's is a flash issue don't worry about that

Btw what I forgot to tell in my first post
I'm using apache 2 on Fedora Core 5, I don't that it really matters but you never know.
 
Old 04-04-2007, 01:03 PM   #4
fourchannel
Member
 
Registered: Jul 2006
Location: Tuscaloosa, AL - USA
Distribution: Gentoo
Posts: 30

Rep: Reputation: 15
Oh, subdomains.

You will need to run a DNS server on your main domain if you want the subdomains to work. If your subdomains are accessable to the internet you're ok, but if not you will need to setup some kind of router aswell.

Unfortunately, I don't know hardly anything about the specific software.

But for a DNS server: BIND (one possibility)
 
Old 04-04-2007, 03:02 PM   #5
metalenkist
Member
 
Registered: Aug 2005
Distribution: OpenSuse 11.1
Posts: 36

Original Poster
Rep: Reputation: 15
[root@leonweemen ~]# host etenisweten.leonweemen.nl
etenisweten.leonweemen.nl has address 80.60.146.97

looks fine so that isn't really the problem or did I
misunderstand you?
 
Old 04-06-2007, 09:31 AM   #6
fourchannel
Member
 
Registered: Jul 2006
Location: Tuscaloosa, AL - USA
Distribution: Gentoo
Posts: 30

Rep: Reputation: 15
hmm... Would it be a problem for you to post your apache2.conf file? And also, any other relavant configs... Such as virtual servers.

And, do you run a DHCP server? That might be need to be configured to get your server to respond to your different domain names correctly.

And one final thing: Do all your domains/subdomains resolve to the same ip address, or do they all resolve to the same server?
 
Old 04-06-2007, 10:08 AM   #7
metalenkist
Member
 
Registered: Aug 2005
Distribution: OpenSuse 11.1
Posts: 36

Original Poster
Rep: Reputation: 15
Well I posted my http.conf (see below), I'm not running a DHCP server we've all static ipadresses at home. All ports that the server needs are setup at my router, incoming traffic for my server is routed to my server.

All domains point to same ipadress.


my http conf:
Code:
### Section 1: Global Environment

ServerTokens OS
ServerRoot "/etc/httpd"
PidFile run/httpd.pid
Timeout 120
KeepAlive Off
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>

Listen 192.168.0.7:80

LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authn_alias_module modules/mod_authn_alias.so
LoadModule authn_anon_module modules/mod_authn_anon.so
LoadModule authn_dbm_module modules/mod_authn_dbm.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule authz_owner_module modules/mod_authz_owner.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_dbm_module modules/mod_authz_dbm.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule ldap_module modules/mod_ldap.so
LoadModule authnz_ldap_module modules/mod_authnz_ldap.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 ext_filter_module modules/mod_ext_filter.so
LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule expires_module modules/mod_expires.so
LoadModule deflate_module modules/mod_deflate.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 dav_module modules/mod_dav.so
LoadModule status_module modules/mod_status.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule info_module modules/mod_info.so
LoadModule dav_fs_module modules/mod_dav_fs.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 actions_module modules/mod_actions.so
LoadModule speling_module modules/mod_speling.so
LoadModule userdir_module modules/mod_userdir.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule cache_module modules/mod_cache.so
LoadModule suexec_module modules/mod_suexec.so
LoadModule disk_cache_module modules/mod_disk_cache.so
LoadModule file_cache_module modules/mod_file_cache.so
LoadModule mem_cache_module modules/mod_mem_cache.so
LoadModule cgi_module modules/mod_cgi.so

# The following modules are not loaded by default:

#LoadModule cern_meta_module modules/mod_cern_meta.so
#LoadModule asis_module modules/mod_asis.so


# Load config files from the config directory "/etc/httpd/conf.d".
Include conf.d/*.conf

#ExtendedStatus On

User apache
Group apache

### Section 2: 'Main' server configuration

ServerAdmin root@localhost

#
#ServerName www.leonweemen.nl:80

UseCanonicalName Off

DocumentRoot "/var/www/html"

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

<Directory "/var/www/html">
    Options -Indexes -FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

#
# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received.
# See also: http://httpd.apache.org/docs/misc/FAQ.html#forbidden
#
<IfModule mod_userdir.c>
    #
    # UserDir is disabled by default since it can confirm the presence
    # of a username on the system (depending on home directory
    # permissions).
    #
    UserDir disable

    #
    # To enable requests to /~user/ to serve the user's public_html
    # directory, remove the "UserDir disable" line above, and uncomment
    # the following line instead:
    # 
    #UserDir public_html

</IfModule>
DirectoryIndex index.html index.html.var
AccessFileName .htaccess
<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>

TypesConfig /etc/mime.types

DefaultType text/plain

<IfModule mod_mime_magic.c>
#   MIMEMagicFile /usr/share/magic.mime
    MIMEMagicFile conf/magic
</IfModule>


# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off

#
# EnableMMAP: Control whether memory-mapping is used to deliver
# files (assuming that the underlying OS supports it).
# The default is on; turn this off if you serve from NFS-mounted 
# filesystems.  On some systems, turning it off (regardless of
# filesystem) can improve performance; for details, please see
# http://httpd.apache.org/docs/2.2/mod/core.html#enablemmap
#
#EnableMMAP off

#
# EnableSendfile: Control whether the sendfile kernel support is 
# used to deliver files (assuming that the OS supports it). 
# The default is on; turn this off if you serve from NFS-mounted 
# filesystems.  Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#enablesendfile
#
#EnableSendfile 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.
#
ErrorLog logs/error_log

#
# 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

# "combinedio" includes actual counts of actual bytes received (%I) and sent (%O); this
# requires the mod_logio module to be loaded.
#LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio

#
# 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 logs/access_log common

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

#
# For a single logfile with access, agent, and referer information
# (Combined Logfile Format), use the following directive:
#
CustomLog logs/access_log combined

#
# Optionally add a line containing the server version and virtual host
# name to server-generated pages (internal error documents, FTP directory
# listings, mod_status and mod_info output etc., but not CGI generated
# documents or custom error documents).
# Set to "EMail" to also include a mailto: link to the ServerAdmin.
# Set to one of:  On | Off | EMail
#
ServerSignature On

#
# Aliases: Add here as many aliases as you need (with no limit). The format is 
# Alias fakename realname
#
# Note that if you include a trailing / on fakename then the server will
# require it to be present in the URL.  So "/icons" isn't aliased in this
# example, only "/icons/".  If the fakename is slash-terminated, then the 
# realname must also be slash terminated, and if the fakename omits the 
# trailing slash, the realname must also omit it.
#
# We include the /icons/ alias for FancyIndexed directory listings.  If you
# do not use FancyIndexing, you may comment this out.
#
Alias /icons/ "/var/www/icons/"

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

#
# WebDAV module configuration section.
# 
<IfModule mod_dav_fs.c>
    # Location of the WebDAV lock database.
    DAVLockDB /var/lib/dav/lockdb
</IfModule>

#
# 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/ "/var/www/cgi-bin/"

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

#
# Redirect allows you to tell clients about documents which used to exist in
# your server's namespace, but do not anymore. This allows you to tell the
# clients where to look for the relocated document.
# Example:
# Redirect permanent /foo http://www.example.com/bar

#
# Directives controlling the display of server-generated directory listings.
#

#
# IndexOptions: Controls the appearance of server-generated directory
# listings.
#
IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable

#
# 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.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 is which icon to show for files which do not have an icon
# explicitly set.
#
DefaultIcon /icons/unknown.gif

#
# AddDescription allows you to place a short description after a file in
# server-generated indexes.  These are only displayed for FancyIndexed
# directories.
# Format: AddDescription "description" filename
#
#AddDescription "GZIP compressed document" .gz
#AddDescription "tar archive" .tar
#AddDescription "GZIP compressed tar archive" .tgz

#
# ReadmeName is the name of the README file the server will look for by
# default, and append to directory listings.
#
# HeaderName is the name of a file which should be prepended to
# directory indexes. 
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

#
# DefaultLanguage and AddLanguage allows you to specify the language of 
# a document. You can then use content negotiation to give a browser a 
# file in a language the user can understand.
#
# Specify a default language. This means that all data
# going out without a specific language tag (see below) will 
# be marked with this one. You probably do NOT want to set
# this unless you are sure it is correct for all cases.
#
# * It is generally better to not mark a page as 
# * being a certain language than marking it with the wrong
# * language!
#
# DefaultLanguage nl
#
# Note 1: The suffix does not have to be the same as the language
# keyword --- those with documents in Polish (whose net-standard
# language code is pl) may wish to use "AddLanguage pl .po" to
# avoid the ambiguity with the common suffix for perl scripts.
#
# Note 2: The example entries below illustrate that in some cases 
# the two character 'Language' abbreviation is not identical to 
# the two character 'Country' code for its country,
# E.g. 'Danmark/dk' versus 'Danish/da'.
#
# Note 3: In the case of 'ltz' we violate the RFC by using a three char
# specifier. There is 'work in progress' to fix this and get
# the reference data for rfc1766 cleaned up.
#
# Catalan (ca) - Croatian (hr) - Czech (cs) - Danish (da) - Dutch (nl)
# English (en) - Esperanto (eo) - Estonian (et) - French (fr) - German (de)
# Greek-Modern (el) - Hebrew (he) - Italian (it) - Japanese (ja)
# Korean (ko) - Luxembourgeois* (ltz) - Norwegian Nynorsk (nn)
# Norwegian (no) - Polish (pl) - Portugese (pt)
# Brazilian Portuguese (pt-BR) - Russian (ru) - Swedish (sv)
# Simplified Chinese (zh-CN) - Spanish (es) - Traditional Chinese (zh-TW)
#
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

#
# LanguagePriority allows you to give precedence to some languages
# in case of a tie during content negotiation.
#
# Just list the languages in decreasing order of preference. We have
# more or less alphabetized them here. You probably want to change this.
#
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

#
# ForceLanguagePriority allows you to serve a result page rather than
# MULTIPLE CHOICES (Prefer) [in case of a tie] or NOT ACCEPTABLE (Fallback)
# [in case no accepted languages matched the available variants]
#
ForceLanguagePriority Prefer Fallback

#
# Specify a default charset for all content served; this enables
# interpretation of all content as UTF-8 by default.  To use the 
# default browser choice (ISO-8859-1), or to allow the META tags
# in HTML content to override this choice, comment out this
# directive:
#
AddDefaultCharset UTF-8

#
# AddType allows you to add to or override the MIME configuration
# file mime.types for specific file types.
#
#AddType application/x-tar .tgz

#
# AddEncoding allows you to have certain browsers uncompress
# information on the fly. Note: Not all browsers support this.
# Despite the name similarity, the following Add* directives have nothing
# to do with the FancyIndexing customization directives above.
#
#AddEncoding x-compress .Z
#AddEncoding x-gzip .gz .tgz

# If the AddEncoding directives above are commented-out, then you
# probably should define those extensions to indicate media types:
#
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz

#
# 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 directive (see below)
#
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
#AddHandler cgi-script .cgi

#
# For files that include their own HTTP headers:
#
#AddHandler send-as-is asis

#
# For type maps (negotiated resources):
# (This is enabled by default to allow the Apache "It Worked" page
#  to be distributed in multiple languages.)
#
AddHandler type-map var

#
# Filters allow you to process content before it is sent to the client.
#
# To parse .shtml files for server-side includes (SSI):
# (You will also need to add "Includes" to the "Options" directive.)
#
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml

#
# 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
#

#
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
#
# Some examples:
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://www.example.com/subscription_info.html
#

#
# Putting this all together, we can internationalize error responses.
#
# We use Alias to redirect any /error/HTTP_<error>.html.var response to
# our collection of by-error message multi-language collections.  We use 
# includes to substitute the appropriate text.
#
# You can modify the messages' appearance without changing any of the
# default HTTP_<error>.html.var files by adding the line:
#
#   Alias /error/include/ "/your/include/path/"
#
# which allows you to create your own set of files by starting with the
# /var/www/error/include/ files and
# copying them to /your/include/path/, even on a per-VirtualHost basis.
#

Alias /error/ "/var/www/error/"

<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>

#
# 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 "MS FrontPage" redirect-carefully
BrowserMatch "^WebDrive" redirect-carefully
BrowserMatch "^WebDAVFS/1.[0123]" redirect-carefully
BrowserMatch "^gnome-vfs/1.0" redirect-carefully
BrowserMatch "^XML Spy" redirect-carefully
BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully

#
# Allow server status reports generated by mod_status,
# with the URL of http://servername/server-status
# Change the ".example.com" to match your domain to enable.
#
#<Location /server-status>
#    SetHandler server-status
#    Order deny,allow
#    Deny from all
#    Allow from .example.com
#</Location>

#
# Allow remote server configuration reports, with the URL of
#  http://servername/server-info (requires that mod_info.c be loaded).
# Change the ".example.com" to match your domain to enable.
#
#<Location /server-info>
#    SetHandler server-info
#    Order deny,allow
#    Deny from all
#    Allow from .example.com
#</Location>

#
# Proxy Server directives. Uncomment the following lines to
# enable the proxy server:
#
#<IfModule mod_proxy.c>
#ProxyRequests On
#
#<Proxy *>
#    Order deny,allow
#    Deny from all
#    Allow from .example.com
#</Proxy>

#
# Enable/disable the handling of HTTP/1.1 "Via:" headers.
# ("Full" adds the server version; "Block" removes all outgoing Via: headers)
# Set to one of: Off | On | Full | Block
#
#ProxyVia On

#
# To enable a cache of proxied content, uncomment the following lines.
# See http://httpd.apache.org/docs/2.2/mod/mod_cache.html for more details.
#
#<IfModule mod_disk_cache.c>
#   CacheEnable disk /
#   CacheRoot "/var/cache/mod_proxy"
#</IfModule>
#

#</IfModule>
# End of proxy directives.

### Section 3: Virtual Hosts
#
# VirtualHost: If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at 
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
#NameVirtualHost *:80
#
# NOTE: NameVirtualHost cannot be used without a port specifier 
# (e.g. :80) if mod_ssl is being used, due to the nature of the
# SSL protocol.
#

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *:80>
#    ServerAdmin webmaster@dummy-host.example.com
#    DocumentRoot /www/docs/dummy-host.example.com
#    ServerName dummy-host.example.com
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>

NameVirtualHost *:80

<VirtualHost *:80>
    ServerAdmin info@leonweemen.nl
    DocumentRoot /var/www/html/
    ServerName www.leonweemen.nl
    ErrorLog logs/leonweemen.nl_www-error_log
    CustomLog logs/leonweemen.nl_www-access_log common
</VirtualHost>

<VirtualHost *:80> 
    ServerAdmin weemen@leonweemen.nl
    DocumentRoot /var/www/html/overig/quotes/ 
    ServerName etenisweten.leonweemen.nl 
    ErrorLog logs/leonweemen.nl_etenisweten_log 
    CustomLog logs/leonweemen.nl_etenisweten-access_log common 
</VirtualHost>
 
Old 04-06-2007, 01:14 PM   #8
fourchannel
Member
 
Registered: Jul 2006
Location: Tuscaloosa, AL - USA
Distribution: Gentoo
Posts: 30

Rep: Reputation: 15
I just thought about it, but could you look at your /etc/hosts file?

I had to setup mine like this in order to get the virtual servers to work.

/etc/hosts -- This is not the complete file, but only the important part.
Code:
192.168.254.62  lith.ath.cx     lith    arael.ath.cx    fissure.ath.cx  leliel.ath.cx   machina.ath.cx
You might need to setup your server something like this...

The internal ip address of my server is 192.168.254.62

The first listing, lith.ath.cx, is the name of the server itself. The following *.ath.cx names are the virtual servers i have running.

the different domains that I registered all point to my own server. Even though you have your domain provider setup the addresses, you might try setting up your /etc/hosts file to look something like mine, and make your virtual servers to match the layout of the ones I posted, and see if that doesn't fix your problem.

This is an example of how I would setup the /etc/hosts file for your virtual servers.

Code:
192.168.0.7         leonweemen.nl        etenisweten.leonweemen.nl

And I would modify your virtual hosts to look something like this...
Code:
NameVirtualHost leonweemen.nl:80
<VirtualHost leonweemen.nl:80 www.leonweemen.nl:80>
    ServerAdmin info@leonweemen.nl
    DocumentRoot /var/www/html/
    ServerName leonweemen.nl
    ErrorLog logs/leonweemen.nl_www-error_log
    CustomLog logs/leonweemen.nl_www-access_log common
</VirtualHost>


 NameVirtualHost etenisweten.leonweemen.nl:80
<VirtualHost etenisweten.leonweemen.nl:80 www.etenisweten.leonweemen.nl:80> 
    ServerAdmin weemen@leonweemen.nl
    DocumentRoot /var/www/html/overig/quotes/ 
    ServerName etenisweten.leonweemen.nl 
    ErrorLog logs/leonweemen.nl_etenisweten_log 
    CustomLog logs/leonweemen.nl_etenisweten-access_log common 
</VirtualHost>
Let me know how that goes.
 
Old 04-06-2007, 03:28 PM   #9
metalenkist
Member
 
Registered: Aug 2005
Distribution: OpenSuse 11.1
Posts: 36

Original Poster
Rep: Reputation: 15
Thank you thank you thank you It works, you're a hero!!

apache gives errors but that's ok, I'm going try to fix that myself

I edited my hostfile at first, then tested it, it didn't work.
Then I altered my httpd.conf and that worked woohoo



you make me a happy man!!
 
Old 04-07-2007, 12:57 AM   #10
fourchannel
Member
 
Registered: Jul 2006
Location: Tuscaloosa, AL - USA
Distribution: Gentoo
Posts: 30

Rep: Reputation: 15
Glad I could be of help.

=D
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
apche 2 htaccess just_for_fun Linux - Server 3 03-10-2007 01:13 PM
Apche not found Echo Kilo Linux - Software 3 05-31-2005 02:03 PM
Subdomains & Apache Vhosts Big Brad Linux - Newbie 8 01-28-2004 09:36 PM
Networking questions : Setting up domains/vhosts/subdomains/IPs etc. Belize Linux - Networking 1 09-16-2003 03:39 AM
Apche & PHP p0rky Linux - Software 4 05-31-2003 03:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:03 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
Open Source Consulting | Domain Registration