|
Home > Archive > Web Servers on Unix and Linux > June 2005 > Apache 2.x won't do virtual host like 1.x
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 |
Apache 2.x won't do virtual host like 1.x
|
|
| Paul J. Lucas 2005-04-19, 5:54 pm |
| What I want to do is have:
1. The "main server" serve nothing.
2. The "main virtual host" serve what the main server would have
on port 81.
3. A second virtual host on the same IP, but different port (82).
My abridged httpd.conf is below. As it is, it works, but I had
to make my "main virtual host" not be a virtual host and instead
have it be the main server.
If I uncomment the commented-out stuff, the "main virtual host"
doesn't work. It's like Apache never "sees" the declarations
for it. By looking in the error log, it looks like the document
root gets set to /usr/local/packages/apache.
For the main virtual host, I tried using both:
<VirtualHost *:81>
<VirtualHost _default:*>
(only one at a time, of course) but neither helped. My set-up
used to work fine in Apache 1.x.
Any ideas hot to get what I want?
- Paul
### Section 1: Global Environment
ServerName www.pauljlucas.org
ServerRoot /home/www
### Section 2: 'Main' server configuration
<Directory />
Options None
AllowOverride None
Order Deny,Allow
Deny from All
</Directory>
#/*DocumentRoot /home/www/denied*/
#/*<Directory /home/www/denied>*/
#/* Options None*/
#/* AllowOverride None*/
#/* Order Deny,Allow*/
#/* Deny from All*/
#/*</Directory>*/
AccessFileName .htaccess
<Files ~ "^\.ht">
Order Allow,Deny
Deny from All
</Files>
########## vhost-main ########################################
#######
Listen 81
#<VirtualHost *:81>
#<VirtualHost _default_:*>
DocumentRoot /home/www/htdocs
<Directory /home/www/htdocs>
Options All
AllowOverride All
Order Allow,Deny
Allow from All
</Directory>
<Directory /usr/local/packages>
Options FollowSymLinks
AllowOverride None
Order Allow,Deny
Allow from All
</Directory>
Alias /icons/ /usr/local/packages/apache/icons/
ScriptAlias /cgi-bin/ /home/www/cgi-bin/
<Directory /home/www/cgi-bin>
Options FollowSymLinks
AllowOverride None
Order Allow,Deny
Allow from All
</Directory>
<IfModule mod_userdir.c>
UserDir public_html
UserDir disabled
UserDir enabled pjl
<Directory /home/*/public_html>
Options All
AllowOverride All
Order Allow,Deny
Allow from All
</Directory>
</IfModule>
#</VirtualHost>
########## vhost-rio ########################################
########
Listen 82
<VirtualHost *:82>
DocumentRoot /home/www/rio/htdocs
<Directory /home/www/rio/htdocs>
Options FollowSymLinks
AllowOverride None
Order Deny,Allow
Deny from All
Allow from 10.0.1
</Directory>
<Directory /home/www/rio/cgi-bin>
Options ExecCGI FollowSymLinks
AllowOverride None
Order Deny,Allow
Deny from All
Allow from 10.0.1
</Directory>
AliasMatch ^/favourites(.*) /home/www/rio/htdocs/favourites.txt
ScriptAliasMatch ^/list(.*) /home/www/rio/cgi-bin/list.cgi$1
ScriptAliasMatch ^/query /home/www/rio/cgi-bin/query.cgi
ScriptAliasMatch ^/results /home/www/rio/cgi-bin/results.cgi
ScriptAliasMatch ^/tags(.*) /home/www/rio/cgi-bin/tags.cgi$1
</VirtualHost>
| |
| phil-news-nospam@ipal.net 2005-05-09, 5:49 pm |
| On Tue, 19 Apr 2005 15:50:03 GMT Paul J. Lucas <pauljlucas-removethis@removethistoo-mac.com> wrote:
| What I want to do is have:
|
| 1. The "main server" serve nothing.
| 2. The "main virtual host" serve what the main server would have
| on port 81.
| 3. A second virtual host on the same IP, but different port (82).
|
| My abridged httpd.conf is below. As it is, it works, but I had
| to make my "main virtual host" not be a virtual host and instead
| have it be the main server.
I've found that configuring is a lot simpler if I don't worry about a
"main server" and just use virtual host exclusively. I've done it for
years on 1.3 and when I tried 2.0 it worked fine.
--
-----------------------------------------------------------------------------
| Phil Howard KA9WGN | http://linuxhomepage.com/ http://ham.org/ |
| (first name) at ipal.net | http://phil.ipal.org/ http://ka9wgn.ham.org/ |
-----------------------------------------------------------------------------
| |
| Paul J. Lucas 2005-05-10, 5:54 pm |
| phil-news-nospam@ipal.net wrote:
> On Tue, 19 Apr 2005 15:50:03 GMT Paul J. Lucas <pauljlucas-removethis@removethistoo-mac.com> wrote:
>
> | What I want to do is have:
> |
> | 1. The "main server" serve nothing.
> | 2. The "main virtual host" serve what the main server would have
> | on port 81.
> | 3. A second virtual host on the same IP, but different port (82).
> |
> | My abridged httpd.conf is below. As it is, it works, but I had
> | to make my "main virtual host" not be a virtual host and instead
> | have it be the main server.
>
> I've found that configuring is a lot simpler if I don't worry about a
> "main server" and just use virtual host exclusively. I've done it for
> years on 1.3 and when I tried 2.0 it worked fine.
That's exactly what I'm trying to do by have the "main server"
serve nothing. AFAIK, that is, by definition, what not having a
main server means.
- Paul
| |
| Jim Stanley 2005-06-15, 6:00 pm |
| Phil and Paul,
If this thread is still active.....
I'm having similar problems, and in looking through various setup docs
on the net, it looks like Apache cannot do virtual hosts without a name
server on that machine to specify the hosts. Is this correct? I tried
to do much the same as Paul (creating different directories and server
names in a virual hosts file) and have had similar override problems.
The docs seem to point to the DNS thing, but I'm not sure. (This is
behind a firewall, with a separate router and fixed IP address and
Apache 1.X running under an old Linux distro.) Any more light shed
would be appreciated.
Thanks
Jim Stanley
| |
|
| On Wed, 15 Jun 2005 13:02:49 -0700,
Jim Stanley <jhs-dash-angl-dash-music.at@at.earthlink-dot.net> posted:
> I'm having similar problems, and in looking through various setup docs
> on the net, it looks like Apache cannot do virtual hosts without a name
> server on that machine to specify the hosts. Is this correct? I tried
> to do much the same as Paul (creating different directories and server
> names in a virual hosts file) and have had similar override problems.
> The docs seem to point to the DNS thing, but I'm not sure.
I don't recall having any problems using my hosts file to test out virtual
hosts, though it could be down to the specific builds of Apache that we've
used. Is your system set up to use the hosts file *then* try a DNS server
to resolve names?
Of course, running your own DNS server helps with all sorts of
experimenting. I'd advocate doing so, if you can.
--
If you insist on e-mailing me, use the reply-to address (it's real but
temporary). But please reply to the group, like you're supposed to.
This message was sent without a virus, please delete some files yourself.
|
|
|
|
|