|
Home > Archive > Apache Server configuration support > August 2006 > Virtual Hosts for ports
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Virtual Hosts for ports
|
|
| subrato 2006-08-14, 1:23 pm |
| Hi,
Not sure if this is the right place for this question. I have a
linux (Suse 10.1) server and I have multiple sites that I need to put
on it. This box is not going to host sites externally as this is just
development box. But as I have many php sites and testing needs to be
done before anything is uploaded to the live box, I was wondering how I
set the sites up on that box. With windows box, I am about to access
sites using http://win-dev:1000/ and http://win-dev:1002/ I would like
to use the same for the linux box i.e. http://linux-box:1004/ Right now
I am not sure what all files need to be configured for it. I was
looking through http.conf and it said to add the virtual section in
separate file and use include statements. Also using the interface I
have added the ports that I need the webserver to listen on. But
whenever I type in http://linux-dev:1004/ it takes me to the same
default apache webpage instead to the directory it should point to. Can
anyone give me step by step examples of it .
Thanks in advance
Subrato
| |
| Davide Bianchi 2006-08-14, 1:23 pm |
| On 2006-08-14, subrato <mukherjeesubrato@gmail.com> wrote:
> set the sites up on that box. With windows box, I am about to access
> sites using http://win-dev:1000/ and http://win-dev:1002/ I would like
> to use the same for the linux box i.e. http://linux-box:1004/
You can do it using multiple "Listen" directives to have Apache listening
on multiple ports, and then use VirtualHosts to 'bind' each V.H. with
a different port, but why make things complicated? You can use
Virtual Hosts and use a different 'hostname' for every different site
on port 80, so you'll have 'http://site1.linux-box', 'http://site2.linux-box'
and so on.
The only thing you need is a way to 'resolve' the names into the IP of
the machine, this couldbe a fully-fledged DNS server or an hacked HOSTS
file in your machine.
See the documentation about Virtual Hosts
Davide
--
If at first you don't succeed, get a job with Microsoft.
-- Gareth Barnard
| |
| subrato 2006-08-14, 7:24 pm |
| I have followed your instructions on it and I was able to hack the
HOSTS file. But even now it points to default DocumentRoot i.e
/srv/www/htdocs I have put my websites under /home/websites/ and I want
them to point it to the respective directories. In the VirtualHost
section I did put an entry for DocumentRoot pointing to
/home/websites/firstsite and /home/websites/secondsite. How do I get it
to point to that folder when I type in http://firstsite.linux-box/ and
http://secondsite.linux-box/
Thanks for your help
Subrato
Davide Bianchi wrote:
> On 2006-08-14, subrato <mukherjeesubrato@gmail.com> wrote:
>
> You can do it using multiple "Listen" directives to have Apache listening
> on multiple ports, and then use VirtualHosts to 'bind' each V.H. with
> a different port, but why make things complicated? You can use
> Virtual Hosts and use a different 'hostname' for every different site
> on port 80, so you'll have 'http://site1.linux-box', 'http://site2.linux-box'
> and so on.
>
> The only thing you need is a way to 'resolve' the names into the IP of
> the machine, this couldbe a fully-fledged DNS server or an hacked HOSTS
> file in your machine.
>
> See the documentation about Virtual Hosts
>
> Davide
>
> --
> If at first you don't succeed, get a job with Microsoft.
> -- Gareth Barnard
| |
| Davide Bianchi 2006-08-14, 7:24 pm |
| On 2006-08-14, subrato <mukherjeesubrato@gmail.com> wrote:
> I have followed your instructions on it and I was able to hack the
> HOSTS file.
Good, so now ping firstsite.linux-box and ping secondsite.linux-box
should bot resolve in the linux ip address, right?
> them to point it to the respective directories. In the VirtualHost
> section I did put an entry for DocumentRoot pointing to
> /home/websites/firstsite and /home/websites/secondsite.
Would be nice if you could post such configuration, otherwise is quite
difficult to know if you've done something correct or not.
In a pinch you should have something like
NameVirtualHost *:80
<VirtualHost *:80>
ServerName firstsite.linux-box
DocumentRoot /where/you/want/it
<Directory /where/you/want/it>
...other directives
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName secondsite.linux-box
DocumentRoot /where/you/want/it/2
<Directory /where/you/want/it/2>
...other directives
</Directory>
</VirtualHost>
Davide
--
If JavaScript is walking alone late at night through a bad part of town
with a pocket full of $20 bills, ActiveX is dropping your trousers in the
middle of the yard of a maximum-security prison, bending over, and yelling
'Come and get it, boys!' --Adam
| |
|
| subrato wrote:
> I have followed your instructions on it and I was able to hack the
> HOSTS file. But even now it points to default DocumentRoot i.e
> /srv/www/htdocs I have put my websites under /home/websites/ and I want
> them to point it to the respective directories. In the VirtualHost
> section I did put an entry for DocumentRoot pointing to
> /home/websites/firstsite and /home/websites/secondsite. How do I get it
> to point to that folder when I type in http://firstsite.linux-box/ and
> http://secondsite.linux-box/
> Thanks for your help
> Subrato
>
Did you restart the webserver after changing your conf file ?
| |
| subrato 2006-08-16, 1:28 pm |
| Hi David,
I have been following the instructions you have posted.
Even though I changed it from http://linux-dev:4848/ to
http://xyz.linux-dev/ it was still pointing to default site
Here is the httpd.conf file along with include file which I have used.
Can you let me know what am I missing in here. Thanks for the help
httpd.conf
#
# /etc/apache2/httpd.conf
#
# This is the main Apache server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs-2.2/> for detailed information
about
# the directives.
# Based upon the default apache configuration file that ships with
apache,
# which is based upon the NCSA server configuration files originally by
Rob
# McCool. This file was knocked together by Peter Poeml
<poeml+apache@suse.de>.
# If possible, avoid changes to this file. It does mainly contain
Include
# statements and global settings that can/should be overridden in the
# configuration of your virtual hosts.
# Overview of include files, chronologically:
#
# httpd.conf
# |
# |-- uid.conf . . . . . . . . . . . . . . UserID/GroupID to run
under
# |-- server-tuning.conf . . . . . . . . . sizing of the server (how
many processes to start, ...)
# |-- sysconfig.d/loadmodule.conf . . . . . [*] load these modules
# |-- listen.conf . . . . . . . . . . . . . IP adresses / ports to
listen on
# |-- mod_log_config.conf . . . . . . . . . define logging formats
# |-- sysconfig.d/global.conf . . . . . . . [*] server-wide general
settings
# |-- mod_status.conf . . . . . . . . . . . restrict access to
mod_status (server monitoring)
# |-- mod_info.conf . . . . . . . . . . . . restrict access to
mod_info
# |-- mod_usertrack.conf . . . . . . . . . defaults for cookie-based
user tracking
# |-- mod_autoindex-defaults.conf . . . . . defaults for displaying
of server-generated directory listings
# |-- mod_mime-defaults.conf . . . . . . . defaults for mod_mime
configuration
# |-- errors.conf . . . . . . . . . . . . . customize error responses
# |-- ssl-global.conf . . . . . . . . . . . SSL conf that applies to
default server _and all_ virtual hosts
# |
# |-- default-server.conf . . . . . . . . . set up the default server
that replies to non-virtual-host requests
# | |--mod_userdir.conf . . . . . . . . enable UserDir (if
mod_userdir is loaded)
# | `--conf.d/apache2-manual?conf . . . add the docs ('?' = if
installed)
# |
# |-- sysconfig.d/include.conf . . . . . . [*] your include files
# | (for each file to be
included here, put its name
# | into APACHE_INCLUDE_*
in /etc/sysconfig/apache2)
# |
# `-- vhosts.d/ . . . . . . . . . . . . . . for each virtual host,
place one file here
# `-- *.conf . . . . . . . . . . . . . (*.conf is
automatically included)
#
#
# Files marked [*] are created from sysconfig upon server restart:
instead of
# these files, you edit /etc/sysconfig/apache2
# Filesystem layout:
#
# /etc/apache2/
# |-- charset.conv . . . . . . . . . . . . for mod_auth_ldap
# |-- conf.d/
# | |-- apache2-manual.conf . . . . . . . conf that comes with
apache2-doc
# | |-- mod_php4.conf . . . . . . . . . . (example) conf that comes
with apache2-mod_php4
# | `-- ... . . . . . . . . . . . . . . . other configuration added
by packages
# |-- default-server.conf
# |-- errors.conf
# |-- httpd.conf . . . . . . . . . . . . . top level configuration
file
# |-- listen.conf
# |-- magic
# |-- mime.types -> ../mime.types
# |-- mod_autoindex-defaults.conf
# |-- mod_info.conf
# |-- mod_log_config.conf
# |-- mod_mime-defaults.conf
# |-- mod_perl-startup.pl
# |-- mod_status.conf
# |-- mod_userdir.conf
# |-- mod_usertrack.conf
# |-- server-tuning.conf
# |-- ssl-global.conf
# |-- ssl.crl/ . . . . . . . . . . . . . . PEM-encoded X.509
Certificate Revocation Lists (CRL)
# |-- ssl.crt/ . . . . . . . . . . . . . . PEM-encoded X.509
Certificates
# |-- ssl.csr/ . . . . . . . . . . . . . . PEM-encoded X.509
Certificate Signing Requests
# |-- ssl.key/ . . . . . . . . . . . . . . PEM-encoded RSA Private
Keys
# |-- ssl.prm/ . . . . . . . . . . . . . . public DSA Parameter
Files
# |-- sysconfig.d/ . . . . . . . . . . . . files that are created
from /etc/sysconfig/apache2
# | |-- global.conf
# | |-- include.conf
# | `-- loadmodule.conf
# |-- uid.conf
# `-- vhosts.d/ . . . . . . . . . . . . . . put your virtual host
configuration (*.conf) here
# |-- vhost-ssl.template
# `-- vhost.template
### Global Environment
########################################
##############
#
# The directives in this section affect the overall operation of
Apache,
# such as the number of concurrent requests.
# run under this user/group id
Include /etc/apache2/uid.conf
# - how many server processes to start (server pool regulation)
# - usage of KeepAlive
Include /etc/apache2/server-tuning.conf
# 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 /var/log/apache2/error_log
# generated from APACHE_MODULES in /etc/sysconfig/apache2
Include /etc/apache2/sysconfig.d/loadmodule.conf
# IP addresses / ports to listen on
Include /etc/apache2/listen.conf
# predefined logging formats
Include /etc/apache2/mod_log_config.conf
# generated from global settings in /etc/sysconfig/apache2
Include /etc/apache2/sysconfig.d/global.conf
# optional mod_status, mod_info
Include /etc/apache2/mod_status.conf
Include /etc/apache2/mod_info.conf
# optional cookie-based user tracking
# read the documentation before using it!!
Include /etc/apache2/mod_usertrack.conf
# configuration of server-generated directory listings
Include /etc/apache2/mod_autoindex-defaults.conf
# associate MIME types with filename extensions
TypesConfig /etc/apache2/mime.types
DefaultType text/plain
Include /etc/apache2/mod_mime-defaults.conf
# set up (customizable) error responses
Include /etc/apache2/errors.conf
# global (server-wide) SSL configuration, that is not specific to
# any virtual host
Include /etc/apache2/ssl-global.conf
# forbid access to the entire filesystem by default
<Directory />
Options None
AllowOverride None
Order deny,allow
Deny from all
</Directory>
# use .htaccess files for overriding,
AccessFileName .htaccess
# and never show them
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>
# List of resources to look for when the client requests a directory
DirectoryIndex index.html index.html.var
### 'Main' server configuration
########################################
#####
#
# The directives in this section set up the values used by the 'main'
# server, which responds to any requests that aren't handled by a
# <VirtualHost> definition. These values also provide defaults for
# any <VirtualHost> containers you may define later in the file.
#
# All of these directives may appear inside <VirtualHost> containers,
# in which case these default settings will be overridden for the
# virtual host being defined.
#
Include /etc/apache2/default-server.conf
# Another way to include your own files
#
# The file below is generated from /etc/sysconfig/apache2,
# include arbitrary files as named in APACHE_CONF_INCLUDE_FILES and
# APACHE_CONF_INCLUDE_DIRS
Include /etc/apache2/sysconfig.d/include.conf
### Virtual server configuration
########################################
####
#
# 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.
#
Include /etc/apache2/vhosts.d/*.conf
# Note: instead of adding your own configuration here, consider
# adding it in your own file (/etc/apache2/httpd.conf.local)
# putting its name into APACHE_CONF_INCLUDE_FILES in
# /etc/sysconfig/apache2 -- this will make system updates
# easier 
httpd.conf.local --> this file I used for including the VirtualHost
Info as the httpd.conf said its better practice..
NameVirtualHost *:80
Listen 80
<VirtualHost *:80>
DocumentRoot /home/websites/xyz/www
<Directory /home/websites/xyz/www>
</Directory>
ServerName xyz.linux-dev
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /home/websites/abc/www
<Directory /home/websites/abc/www>
</Directory>
ServerName abc.linux-dev
</VirtualHost>
I have made an entry of this include file in /etc/sysconfig/apache2 and
below is the info from that file
## Path: Network/WWW/Apache2
## Description: Configuration for Apache 2
## Type: string
## Default: ""
## ServiceRestart: apache2
#
# Here you can name files, separated by spaces, that should be
Include'd from
# httpd.conf.
#
# This allows you to add e.g. VirtualHost statements without touching
# /etc/apache2/httpd.conf itself, which makes upgrading easier.
#
APACHE_CONF_INCLUDE_FILES=""
## Type: string
## Default: ""
## ServiceRestart: apache2
#
# Here you can name directories, separated by spaces, that should be
Include'd
# from httpd.conf.
#
# All files contained in these directories will be recursively included
by apache.
# If a pattern like *.conf is appended, apache will use it.
#
# Examples: "/etc/apache2/my_conf/"
# "/etc/apache2/virtual_hosts/*.conf"
# "local/*.conf /srv/www/virtual/"
#
APACHE_CONF_INCLUDE_FILE="/etc/apache2/httpd.conf.local"
APACHE_CONF_INCLUDE_DIRS=""
## Type: string
## Default: "actions alias auth_basic authz_host authn_file
authz_groupfile authz_default authz_user autoindex cgi dir env expires
include log_config mime negotiation setenvif ssl suexec userdir php5"
## ServiceRestart: apache2
#
# [It might look silly to not simply edit httpd.conf for the LoadModule
statements.
# However, since the LoadModule statements might need an absolute path
to the modules,
# switching between MPMs can be quite a hassle. It's easier to just
give the names here.]
#
# * list of all modules shipped with the base distribution:
#
# actions alias asis auth_basic auth_digest authn_alias authn_anon
# authn_dbd authn_dbm authn_default authn_file authnz_ldap authz_dbm
# authz_default authz_groupfile authz_host authz_owner authz_user
# autoindex bucketeer cache case_filter case_filter_in cern_meta cgi
# charset_lite dav dav_fs dav_lock dbd deflate dir disk_cache dumpio
# echo env expires ext_filter file_cache filter headers ident
imagemap
# include info ldap log_config log_forensic logio mem_cache mime
mime_magic
# negotiation optional_fn_export optional_fn_import
optional_hook_export
# optional_hook_import proxy proxy_ajp proxy_balancer proxy_connect
# proxy_ftp proxy_http rewrite setenvif speling ssl status suexec
unique_id
# userdir usertrack version vhost_alias
#
# see http://httpd.apache.org/docs-2.2/mod/ !
#
# * It pays to use IfDefine statements... like
# <IfModule mod_xyz.c>
# ....
# </IfModule>
#
# * In the APACHE_MODULES variable, you can use mod_xyz or just xyz
syntax.
# You may also name an absolute path if you like.
#
# * NOTE ON MOD_SSL: before you can enable this module, you need a
server certificate.
# A test certificate can be created by entering
# 'cd /usr/share/doc/packages/apache2; ./certificate.sh' as root.
# Also, you need to set the ServerName inside the <VirtualHost
_default_:443>
# block to the fully qualified domain name (see /etc/HOSTNAME).
#
# * if your server certificate is protected by a passphrase you should
increase the
# APACHE_START_TIMEOUT (see above)
#
# * modules listed here will be ignored if they are not installed
#
#
# EXAMPLES:
#
# fairly minimal
# APACHE_MODULES="authz_host alias auth dir log_config mime setenvif"
#
# apache's default installation
# APACHE_MODULES="authz_host actions alias asis auth autoindex cgi dir
imap include log_config mime negotiation setenvif status userdir"
# your settings
APACHE_MODULES="authz_host actions alias auth_basic authz_groupfile
authn_file authz_user autoindex cgi dir include log_config mime
negotiation setenvif status userdir asis imagemap php5 authz_default"
## Type: string
## Default: ""
## ServiceRestart: apache2
#
# Additional server flags:
#
# Put here any server flags ("Defines") that you want to hand over to
# httpd at start time, or other command line flags.
#
# Background: Any directives within an <IfDefine flag>...</IfDefine>
# section are only processed if the flag is defined.
# This allows to write configuration which is active only
in a
# special cases, like during server maintenance, or for
testing
# something temporarily.
#
# Notably, to enable SSL support, 'SSL' needs to be added here.
# To enable the server-status, 'STATUS' needs to be added here.
#
# It does not matter if you write flag1, -D flag1 or -Dflag1.
# Multiple flags can be given as "-D flag1 -D flag2" or simply "flag1
flag2".
#
# Specifying such flags here is equivalent to giving them on the
commandline.
# (e.g. via rcapache2 start -DReverseProxy)
#
# Example:
# "SSL STATUS AWSTATS SVN_VIEWCVS no_subversion_today"
#
APACHE_SERVER_FLAGS=""
## Type: string
## Default: ""
## ServiceRestart: apache2
#
# Which config file do you want to use?
# (if not set, /etc/apache2/httpd.conf is used.)
# It is unusual to need to use this setting.
#
APACHE_HTTPD_CONF=""
## Type: list(prefork,worker)
## Default: ""
## ServiceRestart: apache2
#
# MPM (multi-processing module) to use.
#
# Needed to determine with which MPM apache will run, as well as
# against which header files modules will be built.
#
# If not set, the system will simply pick one of the installed MPMs.
#
# The implementation of the logic is in /usr/share/apache2/find_mpm,
# a script which can be used standalone as well if needed.
#
APACHE_MPM=""
## Type: string
## Default: ""
## ServiceReload: apache2
#
# email address of the server administrator (ServerAdmin directive)
# This address is added to the server's responses if
APACHE_SERVERSIGNATURE
# is set to "email".
#
# If empty ("") it defaults to webmaster@$FQHOSTNAME, where FQHOSTNAME
is
# taken from /etc/HOSTNAME.
#
# Note that ServerAdmin directives inside VirtualHost statements are
not
# changed, even not the one in the stock SSL virtual host block.
#
APACHE_SERVERADMIN="subrato@getcaffeinated.com"
## Type: string
## Default: ""
## ServiceReload: apache2
#
# ServerName gives the name and port that the server uses to identify
itself.
# This can often be determined automatically, but we recommend you
specify
# it explicitly to prevent problems during startup.
#
# If this is not set to valid DNS name for your host, server-generated
# redirections will not work. See also the UseCanonicalName directive.
#
# If your host doesn't have a registered DNS name, enter its IP address
here.
# You will have to access it by its address anyway, and this will make
# redirections work in a sensible way.
#
APACHE_SERVERNAME="linux-dev"
## Type: integer
## Default: 2
#
# timeout during server startup (seconds)
# after this time, the start script decides wether the httpd process
started without error.
#
# Increase it, if you use mod_ssl and your certificate is passphrase
protected!
#
APACHE_START_TIMEOUT="2"
## Type: list(on,off,email)
## Default: "on"
## ServiceReload: apache2
#
# Configures the footer on server-generated documents
# This correlates to the ServerSignature directive.
#
APACHE_SERVERSIGNATURE="on"
## Type: list(debug,info,notice,warn,error,
crit,alert,emerg)
## Default: "warn"
## ServiceReload: apache2
#
# LogLevel: Control the number of messages logged to the error_log.
#
APACHE_LOGLEVEL="warn"
## Type: string
## Default: "/var/log/apache2/access_log combined"
## ServiceRestart: apache2
#
# 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. Contrarywise, if you *do*
# define per-<VirtualHost> access logfiles, transactions will be
# logged therein and *not* in this file.
#
# Simply set it to empty, if you configure it yourself somewhere else.
#
# Examples:
#
# If you would like to have agent and referer logfiles:
#
# setting it to "/var/log/apache2/referer_log referer,
/var/log/apache2/agent_log agent"
# corresponds to
# CustomLog /var/log/apache2/referer_log referer
# CustomLog /var/log/apache2/agent_log agent
#
# If you prefer a single logfile with access, agent, and referer
information
# (Combined Logfile Format):
#
# setting it to "/var/log/apache2/access_log combined"
# corresponds to
# CustomLog /var/log/apache2/access_log combined
#
APACHE_ACCESS_LOG="/var/log/apache2/access_log combined"
## Type: list(On,Off,DNS)
## Default: "Off"
## ServiceReload: apache2
#
# UseCanonicalName: Determines how Apache constructs self-referencing
# URLs and the SERVER_NAME and SERVER_PORT variables.
# When set "Off", Apache will use the Hostname and Port supplied
# by the client. When set "On", Apache will use the value of the
# ServerName directive.
#
APACHE_USE_CANONICAL_NAME="off"
## Type: list(Major,Minor,Minimal,ProductOn
ly,OS,Full)
## Default: "OS"
## ServiceReload: apache2
#
# How much information the server response header field contains about
the server.
# (installed modules, versions, etc.)
# see http://httpd.apache.org/docs-2.2/mo...ml#servertokens
#
APACHE_SERVERTOKENS="OS"
## Type: list(on,off)
## Default: "off"
## ServiceReload: apache2
#
# If mod_status is used, include extended information about the server,
like
# CPU usage, in the status report. It is a server-wide setting, and it
can cost
# some performance!
#
APACHE_EXTENDED_STATUS="off"
## Type: list(on,off)
## Default: "off"
## ServiceRestart: apache2
#
# Enable buffered logging
#
APACHE_BUFFERED_LOGS="off"
## Type: integer
## Default: 300
## ServiceReload: apache2
#
# Timeout: The number of seconds before receives and sends time out.
# It is a server wide setting.
#
APACHE_TIMEOUT="300"
## Path: Network/WWW/Apache/SuSEhelp
## Description: SuSE help doc server configuration
## Type: yesno
## Default: no
## Config: apache
## ServiceRestart: apache
## Command:
#
# Set this to yes on the central documentation server
# or to configure apache for local use of susehelp.
# Then the online-help-system indices are automatically adjusted
# and access to the help-files is allowed as specified in DOC_ALLOW.
# To run as a client for the central documentation server who's name
# is specified in DOC_HOST, just set DOC_SERVER to no.
# The DOC_HOST and DOC_ALLOW variables are in the file
/etc/sysconfig/susehelp.
#
DOC_SERVER="no"
There is also a listen.conf in /etc/apache2 directory and it has
following info in it
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports. See also the <VirtualHost> directive.
#
# http://httpd.apache.org/docs-2.2/mo...mon.html#listen
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
#
# When we also provide SSL we have to listen to the
# standard HTTP port (see above) and to the HTTPS port
#
# Note: Configurations that use IPv6 but not IPv4-mapped addresses need
two
# Listen directives: "Listen [::]:443" and "Listen 0.0.0.0:443"
#
#Listen 12.34.56.78:80
#Listen 80
#Listen 443
<IfDefine SSL>
<IfDefine !NOSSL>
<IfModule mod_ssl.c>
Listen 443
</IfModule>
</IfDefine>
</IfDefine>
# Use name-based virtual hosting
#
# - on a specified address / port:
#
#NameVirtualHost 12.34.56.78:80
#
# - name-based virtual hosting:
#
#NameVirtualHost *:80
#
# - on all addresses and ports. This is your best bet when you are on
# dynamically assigned IP addresses:
#
Listen 80
I think I have included all the info and would be glad if you could
point what exactly is that I have missed somewhere
Davide Bianchi wrote:
> On 2006-08-14, subrato <mukherjeesubrato@gmail.com> wrote:
>
> Good, so now ping firstsite.linux-box and ping secondsite.linux-box
> should bot resolve in the linux ip address, right?
>
>
> Would be nice if you could post such configuration, otherwise is quite
> difficult to know if you've done something correct or not.
>
> In a pinch you should have something like
>
> NameVirtualHost *:80
>
> <VirtualHost *:80>
> ServerName firstsite.linux-box
> DocumentRoot /where/you/want/it
> <Directory /where/you/want/it>
> ...other directives
> </Directory>
> </VirtualHost>
>
> <VirtualHost *:80>
> ServerName secondsite.linux-box
> DocumentRoot /where/you/want/it/2
> <Directory /where/you/want/it/2>
> ...other directives
> </Directory>
> </VirtualHost>
>
> Davide
>
> --
> If JavaScript is walking alone late at night through a bad part of town
> with a pocket full of $20 bills, ActiveX is dropping your trousers in the
> middle of the yard of a maximum-security prison, bending over, and yelling
> 'Come and get it, boys!' --Adam
| |
| Davide Bianchi 2006-08-16, 1:28 pm |
| On 2006-08-16, subrato <mukherjeesubrato@gmail.com> wrote:
> http://xyz.linux-dev/ it was still pointing to default site
> ### Virtual server configuration
> Include /etc/apache2/vhosts.d/*.conf
This bits make me think that you have something in that directory that
could mess around with your virtual host configuration. Check that.
> httpd.conf.local --> this file I used for including the VirtualHost
> Info as the httpd.conf said its better practice..
>
> NameVirtualHost *:80
> Listen 80
>
><VirtualHost *:80>
> DocumentRoot /home/websites/xyz/www
><Directory /home/websites/xyz/www>
></Directory>
> ServerName xyz.linux-dev
></VirtualHost>
You should add some directive in the <Directory> block, otherwise
there is no sense.
> I have made an entry of this include file in /etc/sysconfig/apache2 and
> below is the info from that file
>
> # This allows you to add e.g. VirtualHost statements without touching
> # /etc/apache2/httpd.conf itself, which makes upgrading easier.
> #
> APACHE_CONF_INCLUDE_FILES=""
>
> APACHE_CONF_INCLUDE_FILE="/etc/apache2/httpd.conf.local"
Why twice? The first time empty? Maybe this is the problem?
Since you already have an 'Include /etc/apache2/vhosts.d/*.conf', I
suggest you use that, as told in the config file itself, apachectl configtest
will check your configuration file for inconsistency.
Davide
--
Sept 25th: Discovered lots of things about Dynamic HTML.
Notably that almost every site attempting to use it is crap.
-- Alan Cox's diary
| |
| subrato 2006-08-22, 7:41 pm |
| David,
Thanks for the help so far. I was able to get to the point
where I could type in http://xyz.linux-dev/ and it was getting
redirected to the directory specified. When I try to type
http://abc.linux-dev/ it gives me Permission denied error. Also in
http://xyz.linux-dev/ site there is php page. It gets up until that
point but doesnt show up anything from the php page. I am unable to
determine why the page is not executing or showing up errors. Also
there is another issue on which I would like some help. This linux box
is going to be used as a testing server as well. On the windows side,
we have exposed one testing box and using subdomain , we redirect the
traffic based on the port. I would like to use this box in the similar
manner. If I am not clear on what I want I can explain it in details.
Thanks in advance
Subrato
Davide Bianchi wrote:
> On 2006-08-16, subrato <mukherjeesubrato@gmail.com> wrote:
>
>
>
> This bits make me think that you have something in that directory that
> could mess around with your virtual host configuration. Check that.
>
>
> You should add some directive in the <Directory> block, otherwise
> there is no sense.
>
>
> Why twice? The first time empty? Maybe this is the problem?
>
> Since you already have an 'Include /etc/apache2/vhosts.d/*.conf', I
> suggest you use that, as told in the config file itself, apachectl configtest
> will check your configuration file for inconsistency.
>
> Davide
>
> --
> Sept 25th: Discovered lots of things about Dynamic HTML.
> Notably that almost every site attempting to use it is crap.
> -- Alan Cox's diary
|
|
|
|
|