Re: [Nolug] php scripts virtual hosts cleaned up

From: James Scott <jhs_technical_at_cox.net>
Date: Thu, 11 Mar 2004 10:12:38 -0600
Message-Id: <1079021557.3330.33.camel@example1.com>

On Wed, 2004-03-10 at 13:02, Mark A. Hershberger wrote:
> James Scott <jhs_technical@cox.net> writes:
>
> > First this cleaning up thing is a pain. I am going to attempt to get
> > the relevant stuff in here.
>
> It's worth the effort, though. You /would/ find this a lot easier if
> you configured Outlook to prefix the message you are replying to with
> "> " (or switched MUAs). That's another reason not to use Outlook's
> default configuration in mailing lists where you want help: you'll
> get more help if you post using the conventions that other people are
> used to.
>
> Enough preaching. Time to help.
Thank you. I am using evolution and I think the arrows show up.
This email will tell for sure. If not it is the way I am editing this.
>
> > NameVirtualHost *
> >
> > <VirtualHost *>
> > DocumentRoot /var/www/example1
> > ServerName www.example1.com
> >
> >
> > AddType application/x-httpd-php .php
> > DirectoryIndex index.php
> > </VirtualHost>
>
> Are you actually using "www.example1.com"? Does it resolve
> properly? If you are using another name, does it resolve properly?
Yup, set it up in /etc/hosts.
> Is there a file at /var/www/example1/index.php?
Yes
>
> You get the following error:
>
> > "Starting httpd: [Tue Mar 09 10:45:02 2004] [error] VirtualHost
> > _default_:443 -- mixing * ports and non-* ports with a NameVirtualHost
> > address is not supported, proceeding with undefined results"
>
> Which indicates that you have other <VirtualHost> sections not in the
> form <VirtualHost *> -- something that isn't allowed.
Ok. This is probably where I failed. Please clarify for me. If you are
using "virtual hosts" you cannot have "regular hosts"? Is this because
I did not comment out the default section of the file setting up
documentroot at /var/www/html?
>
> For my own configurations, putting
>
> NameVirtualHost *
>
> and then using
>
> <VirtualHost *>
> ...
> </VirtualHost>
>
> for every virtual host does the job.
>
>
> > Attempting to access files html or php gave me these sort of log
> > entries.
> > log errors:
> >
> > [Mon Mar 08 16:27:56 2004] [error] [client 68.11.44.133] Directory
> > index forbidden by rule: /var/www/html/
> > [Mon Mar 08 16:32:36 2004] [error] [client 68.11.44.133] File does
> > not exist: /var/www/html/admin
> > [Mon Mar 08 16:50:05 2004] [error] [client 68.11.44.133] Directory
> > index forbidden by rule: /var/www/html/
> > script not found or unable to stat script
> > not found or unable to statp
>
> This is because you've mis-configured your virtual hosts.
>
> > And I also tried it with 127.0.0.0 net addresses. I believe I would
> > have to set routes for those to use them and I cannot remember how
> > now.
>
> No, you wouldn't. Especially on Linux, all 127.* addresses are
> routed through the lo interface -- they'll never end up on a live
> network because the RFCs state that these addresses are local to the
> machine.

> Here the point is to setup test websites only visible on the host machine.

> If you're using another OS -- Solaris, for example -- it is possible
> that some 127.* addresses will end up on the network.)

>
> If you wanted, you could set up a local network of 10.* or
> 192.168.*.* addresses, but you'd have to give each local machine an
> IP in that range.
For this you need more than one computer.
>
> > [Tue Mar 09 14:20:21 2004] [error] [client 68.11.44.133] Invalid method
> > in request \x80g\x01\x03
>
> Something really strange is happening here. What sort of web client
> are you using?
Netscape. A google search on this brought to a bug report.
>
> > [Tue Mar 09 14:20:26 2004] [error] [client 68.11.44.133] File does not
> > exist: /var/www/example1/index.html
Yes they were there.
>
> Does that file exist? Do you have /var/www/example1/index.html?
> You forgot "DirectoryIndex index.php" in your <VirtualHost>
> section, so it isn't going to go looking for an index.php file:
So, this needs to be specified in each virtual host section?
It is specified globally in /etc/httpd/conf.d/php.conf.
>
> > <VirtualHost example1.com "actual ip address of localhost">
> > ServerAdmin webmaster@localhost
> > ServerName example1.com
> > ServerAlias *.example1.com
> > DocumentRoot /var/www/example1
> > CustomLog /etc/httpd/logs/access_log combined
> > </VirtualHost>
>
> > This is somewhat what I'm using at home. My server internal IP is
> > 10.255.178.2 and in my workstation hosts file I've specified
> > "10.255.178.2 myserver.cmx" That way DNS is not involved deperately
> > trying to find .cmx tld.
>
> FWIW, try using ".localhost" instead of ".cmx" or
> ".whatever-you-want". That way, you future-protect the names you use
> in the same way that you future-protect them by using 10.* addresses.
This is Pietu's configuration. He has a server and a local network at
home.
>
> Mark.
Mark, Thanks. I have taken out the virtual host sections of the config
file and things are working (mostly) in the default configuration. I am
in attack mode on learning this stuff right now and what you are telling
me helps a lot.

Jim

___________________
Nolug mailing list
nolug@nolug.org
Received on 03/11/04

This archive was generated by hypermail 2.2.0 : 12/19/08 EST