RE: [Nolug] php scripts virtual hosts

From: -ray <ray_at_ops.selu.edu>
Date: Tue, 9 Mar 2004 13:11:50 -0600 (CST)
Message-ID: <Pine.LNX.4.44.0403091310020.23037-100000@romulus.csd.selu.edu>

Perhaps ya'll can clean up the text and redundant parts of this thread,
and use a little better formatting in replies? I can't tell who is
replying to what, where, or when, anymore.

ray

On Tue, 9 Mar 2004, Pietu wrote:

>
>
> -----Original Message-----
> From: owner-nolug@joeykelly.net [mailto:owner-nolug@joeykelly.net] On Behalf
> Of James Scott
> Sent: Tuesday, March 09, 2004 12:27 PM
> To: nolug@joeykelly.net
> Subject: RE: [Nolug] php scripts virtual hosts
>
>
> On Tue, 2004-03-09 at 11:56, Pietu wrote:
> > On Mon, 2004-03-08 at 21:53, Petri Laihonen wrote:
> > > > On Mon, 2004-03-08 at 18:29, Joey Kelly wrote:
> > > >> <snip>
> > > >>
> > > >> >
> > > >> > Thanks Ray, Here are the relevant entries from the log.
> > > >> > I really do not understand the first one and it is probably the
> core
> > > >> > issue. I can see that index.php is defined in conf.d.
> > > >> > [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 stat
> > > >> > [Mon Mar 08 17:31:19 2004] [error] [client 68.11.44.133] File does
> > not
> > > >> > exist: /var/www/html/new_downloads
> > > >> > [Mon Mar 08 17:31:57 2004] [error] [client 68.11.44.133] File does
> > not
> > > >> > exist: /var/www/html/new_downloads
> > > >>
> > > >> At least part of that really looks like a permissions problem. What
> > user
> > > >> is
> > > >> apache running under, and what user owns those files?
> > > >>
> > > >> I normally work out of my home directory, and tell apache to point
> any
> > > >> virtual
> > > >> hosts I have at some directory in /$user/public_html/
> > > > Maybe this is it. I assumed apache would be running as apache and
> chown
> > > > the files and directories apache. I just looked and one was root. I
> > > > changed it to apache still doesn't work. I can't think no more. What
> > > > should they be?
> > > > The home directory thing would be cool but I opted for the virtual
> > > > hosts. By the documentation it actually seemed just as easy. All you
> > > > do is add couple of lines to the hosts file and set virtual container
> at
> > > > the end of httpd.conf. Yeah sure.
> > > >
> > > > ___________________
> > >
> > > The errors you are seeing in the logs, I've seen them in the cases where
> I
> > > had incorrectly configured path to the website in my httpd.conf file OR
> > > when I did not have all the correct index files listed in httpd.conf
> > This is exactly what I think the problem is.
> > > Could you post the virtual host lines (container) from your httpd.conf
> and
> > > equivalent directory structure of the site location on the server?
> > The path:/var/www/example1/html
> > Path 2: /var/www/example2/html
> > 20040308 I added the following in the virtual hosts section of
> > httpd.conf which is at the end of the file.
> >
> > This is supposed to be the right way to configure for a dhcp machine.
> > I think I have missed an important concept somewhere.
> > I setup the server names in the hosts file. These are not real sites
> > I am setting up dummies for testing and to learn php and mysql.
> > corresponding manual page:
> > http://httpd.apache.org/docs-2.0/vhosts/examples.html#serverpath
> > The section heading:
> > "Running several name-based web sites on a single IP address."
> > excerpt from file:
> > ________________________________________________
> > # Listen for virtual host requests on all IP addresses
> > NameVirtualHost *
> >
> > <VirtualHost *>
> > DocumentRoot /var/www/example1
> > ServerName www.example1.com
> >
> > # Other directives here
> > # the following were spec'd in php.conf tried to be explicit here
> > # because php was not showing up
> > AddType application/x-httpd-php .php
> > DirectoryIndex index.php
> > </VirtualHost>
> >
> > <VirtualHost *>
> > DocumentRoot /var/www/example2
> > ServerName www.example2.org
> >
> > # Other directives here
> > AddType application/x-httpd-php .php
> > DirectoryIndex index.php
> > </VirtualHost>
> > This gives me some flak on startup of httpd but still I get the
> > default fedora page when I point the browser to www.example1.com
> > and example2.org. I am actually using these names. What the hell.
> > > Are you using IP based or name based virtual hosting?
> > Name based.
> > > Is the machine you are hosting behind the firewall?
> > Is internal only.
> > > btw. With apache 2.x I started using separate .conf file for virtual
> > > hosts. At the bottom of the actual httpd.conf, I'm just 'including' it.
> > Found this part.
> >
> > The new error message on httpd start up. Like I said it still seems to
> > work and I copied this config section right off the manual page.
> > Gotta read some more I think.
> >
> > "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"
> > Like I said it still seems to work and I copied this config section
> > right off the manual page.
> > Gotta read some more I think.
> >
> > > Petri
> > ___________________
> >
> > I've never succeeded with those * asterixes in httpd.conf
> I think I can see why. I am not liking it either.
> >
> > 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.
> I get this part. This is standard stuff in small nets.
> > 127.0.0.2 local address is there just to enable ssh tunneled access
> machine
> > to see some stats and stuff. Instead of using http://localhost/ I can use
> > http://mycron/. It is not needed in the conf.
> >
> Do you need a special directory path for this part? Not in the conf
> file but a www/whatever/directory.
> >
> No. Unless you want to make this kind of stuff in a separate directory.
> Additionally I have another port for this setup, but I lef it out. (For
> example 127.0.0.2:8880)
>
> > the conf below will also respond to www.myserver.cmx. I've never been big
> on
> > limiting the address with mandatory www. subdomain, instead one is free to
> > use both 'myserver.cmx' and 'www.myserver.cmx'
> >
> The entry *.myserver.cmx does this?
> >
>
> Correct.
> Or if you want some your sub domains to point different directories, then I
> would specify for example:
> ServerAlias www.myserver.cmx
> ServerAlias old.myserver.cmx
>
> for new location of you web docs in a separate subdomain you would just
> create another vhost container, like:
>
> <VirtualHost 10.255.178.2>
> ServerAdmin webmaster@localhost
> ServerName develop.myserver.cmx
> DocumentRoot /var/www/develop.myserver.cmx
> CustomLog /etc/httpd/logs/access_log combined
> </VirtualHost>
>
> > folder '/var/www/myserver.cmx' has normal web read access. Or if php needs
> > to write something to HD then apache has the write access to specified
> > folder.
> >
> The write access is to the log file specified?
> >
> Not for this "CustomLog /etc/httpd/logs/access_log combined"
> This is going to /var/log/httpd/ by default.
>
> What I meant, if you have a PHP script which need to write to harddrive,
> such as some debugging information, then the file (and/or folder) you want
> to write to, apache process must have write access. (Where ever in the
> system this file (and/or folder)it resides)
>
> All the other files in your webdocument folder write accss can be specified
> to whom ever is the developer.
>
> P
>
>
> > My example.
> >
> > NameVirtualHost 10.255.178.2
> >
> > <VirtualHost 10.255.178.2 127.0.0.2>
> > ServerAdmin webmaster@localhost
> > ServerName myserver.cmx
> > ServerAlias *.myserver.cmx
> > ServerAlias mycron #local 127.0.0.2
> > DocumentRoot /var/www/myserver.cmx
> > CustomLog /etc/httpd/logs/access_log combined
> > </VirtualHost>
> >
> > I hope this helps a bit.
> This is helping a lot.
> > P
> >
> > ___________________
> > Nolug mailing list
> > nolug@nolug.org
>
> ___________________
> Nolug mailing list
> nolug@nolug.org
>
> ___________________
> Nolug mailing list
> nolug@nolug.org
>

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

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