Apache Virtual Server Help


 
Thread Tools Search this Thread
Operating Systems Linux Apache Virtual Server Help
# 1  
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>
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

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

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

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

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

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

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

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

9. 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
Login or Register to Ask a Question