Sponsored Content
Full Discussion: Apache Virtual Server Help
Operating Systems Linux Apache Virtual Server Help Post 302164736 by ratnamg on Tuesday 5th of February 2008 07:44:10 PM
Old 02-05-2008
Apache Virtual Server Help

Hi
I am trying to configure virtual host on apache and I am running into a problem where the server defaults to the default location and I cannot get apache to pull from the second server.
  • I have configured 2 files in vhosts.d folder
  • I have added NameVirtualHost *.80 to the httpd.conf
  • I have entries in the /etc/hosts file for the 2 servers



apache2ctl - S results are below:

VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80 is a NameVirtualHost
default server www.a.com (/etc/apache2/vhosts.d/01.a.conf:1)
port 80 namevhost www.a.com (/etc/apache2/vhosts.d/01.a.conf:1)
port 80 namevhost www.b.com (/etc/apache2/vhosts.d/02.b.conf:1)
Syntax OK


My first conf file in vhosts.d folder is :
01.a.conf
<VirtualHost *:80>
ServerName www.a.com
DocumentRoot /srv/www/htdocs
ServerAlias a.com www.a.com
ServerAdmin a@a.com
<Directory /srv/www/htdocs>
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ScriptAlias /cgi-bin/ /srv/www/cgi-bin
<Directory /srv/www/cgi-bin>
AllowOverride None
Options +ExecCGI -Includes
Order allow,deny
Allow from all
</Directory>
</VirtualHost>


File 2
02.b.conf
<VirtualHost *:80>
DocumentRoot /srv/www/htdocs/b
ServerName www.b.com
ServerAlias www.b.info www.b.org b.com
ServerAdmin b@b.com
<Directory /srv/www/htdocs/b>
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ScriptAlias /cgi-bin/ /srv/www/cgi-bin
<Directory /srv/www/cgi-bin>
AllowOverride None
Options +ExecCGI -Includes
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Apache virtual host

Would this be the correct entry for Apache to answer on the IP 129.250.242.126 if the servers IP is 129.250.242.125? Are any other changes necessary to get Apache to answer this IP for web traffic? < VirtualHost 129.250.242.126> ServerName www.my_domain.com ServerAdmin admin@my_domain.com... (4 Replies)
Discussion started by: 98_1LE
4 Replies

2. UNIX for Advanced & Expert Users

Apache 2 Virtual Hosts not resolving

Hey all, I'm having some apache problems. I've installed apache countless times on FreeBSD. However, I'm having some problems and I could use some help. Here is my system info: FreeBSD 5.2.1 Apache 2.0.51 (/usr/local/apache2), doc root (/www symlink to /var/www) PHP 5.0.1 (/usr/local/php)... (2 Replies)
Discussion started by: ezekiel61
2 Replies

3. UNIX for Dummies Questions & Answers

Apache not logging virtual domain

A client has asked us to set up a different domain (as an alias for their site) which they could use on certain marketing material and hence measure the campaign's effectiveness. We've set it up and it all seems to be working fine except that the access log file for the new domain is stuck at zero... (2 Replies)
Discussion started by: fire>ant>
2 Replies

4. Web Development

Apache Virtual URL

Hi All, i'am facing a problem with urls that don't have a filestructure under DocumentRoot. A URL like http://mydomain.com/applicationrew/Structure1/Structure2/some?parameter=key&parameter1=key1 Should be rewritet to something else. Now i defined a Location like <Location ~... (3 Replies)
Discussion started by: wuschelz
3 Replies

5. Red Hat

Virtual Host Apache

Hi, I have set up the following virtual host but it cannot find the URL? Apache is running fine and I have disabled iptables. Within the document root I have the following file index.html displaying a sample text message. Any ideas what my problem might be? httpd.conf: ... (2 Replies)
Discussion started by: Duffs22
2 Replies

6. Web Development

Apache Virtual Path

Say there is a certain path I wish to always load the same page. So if they go to somesite.com/a/b/c, it always goes to myscript.php and fed a/b/c as a server variable. I'm fairly sure this is possible but cannot remember the term it's called, and so cannot find it in web searches or... (7 Replies)
Discussion started by: Corona688
7 Replies

7. Red Hat

CPU high - apache real server OK, virtual server not

Got two RHEL servers - one real and one virtual/cloud. Both run apache web server. When traffic is applied, CPU seems to go quite high on virtual one (20%) but real is not really affected. Worry is that a further increase in traffic will see a problem. Experience of RHEL is limited. Whats... (2 Replies)
Discussion started by: psychocandy
2 Replies

8. Web Development

Problems with Apache Virtual Host

I am attempting to add virtual hosts to an apache web server, which has this current configuration: <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www <Directory /> Options FollowSymLinks AllowOverride None ... (27 Replies)
Discussion started by: Corona688
27 Replies

9. UNIX for Advanced & Expert Users

Apache Virtual host issue

Hello, I am facing a very strange issue while setting a virtual host on apache to setup multiple websites using separate IPs. Virtual host is setup but when i am browsing the website it display content under /var/www/html and displaying site1 and site2 folder instead of access the content... (2 Replies)
Discussion started by: sunnysthakur
2 Replies
URI::URL(3)						User Contributed Perl Documentation					       URI::URL(3)

NAME
URI::URL - Uniform Resource Locators SYNOPSIS
$u1 = URI::URL->new($str, $base); $u2 = $u1->abs; DESCRIPTION
This module is provided for backwards compatibility with modules that depend on the interface provided by the "URI::URL" class that used to be distributed with the libwww-perl library. The following differences exist compared to the "URI" class interface: o The URI::URL module exports the url() function as an alternate constructor interface. o The constructor takes an optional $base argument. The "URI::URL" class is a subclass of "URI::WithBase". o The URI::URL->newlocal class method is the same as URI::file->new_abs. o URI::URL::strict(1) o $url->print_on method o $url->crack method o $url->full_path: same as ($uri->abs_path || "/") o $url->netloc: same as $uri->authority o $url->epath, $url->equery: same as $uri->path, $uri->query o $url->path and $url->query pass unescaped strings. o $url->path_components: same as $uri->path_segments (if you don't consider path segment parameters) o $url->params and $url->eparams methods o $url->base method. See URI::WithBase. o $url->abs and $url->rel have an optional $base argument. See URI::WithBase. o $url->frag: same as $uri->fragment o $url->keywords: same as $uri->query_keywords o $url->localpath and friends map to $uri->file. o $url->address and $url->encoded822addr: same as $uri->to for mailto URI o $url->groupart method for news URI o $url->article: same as $uri->message SEE ALSO
URI, URI::WithBase COPYRIGHT
Copyright 1998-2000 Gisle Aas. perl v5.18.2 2012-02-11 URI::URL(3)
All times are GMT -4. The time now is 03:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy