Re: a couple questions about virtual hosts in Apache

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2007-08-10 at 11:45 -0500, Scott wrote:
> I still seem to have the same problem where index.php is not coming up 
> properly.  by this I mean I cannot see it at all.

A 404 error?

> Here is what my virtual host looks like for this.
> NameVirtualHost *:80
> 
> <VirtualHost *:80>
> ServerName pilotalk.com

Servername for what you want the address to be.

e.g. ServerName www.pilotalk.com

> ServerAlias pilotalk.com

ServerAlias alternatives that will be accepted, even if you rewrite them
(as your rewrite rule did below).

If you only had one name, and no aliases, you'd remove the ServerAlias
directive.

> UseCanonicalName On
> ServerAdmin webmaster@xxxxxxxxxxxx
> DocumentRoot /var/www/PilotalkBraillesoft.com

File paths and names are case-sensitive on Linux, be sure that you've
typed them correctly.

> DirectoryIndex index.php
> ErrorLog logs/PilotalkBraillesoft.com-error_log
> CustomLog logs/PilotalkBraillesoft.com-access_log common
> RewriteEngine On
> RewriteCond %{HTTP_HOST} ^PILOTALK\COM$ [NC]

There'd be a backslash followed by a dot before com, you've got no dot.
The backslash is to escape the dot, so the match is for a dot being
there.  Otherwise, the dot typed into the line would be part of a
wildcard.  As it stands, that rewrite match wouldn't get applied.

> RewriteRule (.*)$ http://www.pilotalk.com/$1 [R=301,L]
> </VirtualHost>

As Alan said, check your logs.  You've set up two, above, for this
virtual host, check both your access and error logs.  Also, check the
main logs for the rest of the server (i.e. if this virtual host didn't
accept the request, the default might have, and they'll be logged
there).  Both will be inside:  /var/log/httpd/

-- 
[tim@bigblack ~]$ uname -ipr
2.6.22.1-41.fc7 i686 i386

Using FC 4, 5, 6 & 7, plus CentOS 5.  Today, it's FC7.

Don't send private replies to my address, the mailbox is ignored.
I read messages from the public lists.




[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux