[Gllug] Problems with mod_alias and Apache

william pink will.pink at gmail.com
Thu Aug 28 11:17:28 UTC 2008


I did have a virtualhost setup for example but only as ServerName example
and I have since removed it from sites-enabled, Is mod_alias  the best of
way of doing it anyway? heres my VH config

<VirtualHost foo.com:80>
    ServerAdmin webmaster at localhost
    ServerName www.foo.com
    ServerAlias foo.com www.foo.co.uk foo.co.uk
    DocumentRoot /var/www/foo
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
        # This directive allows us to have apache2's default start page
                # in /apache2-default/, but still have / go to the right
place
    </Directory>

## Put landing page redirects here
    Redirect permanent /other    http://www.foo.com/
    Redirect permanent /other2    http://www.foo.com/
    Redirect permanent /other3    http://www.foo.com/

    Alias /example     /var/www/example/

####
    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

    ErrorLog /var/log/apache2/lfoo-error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog /var/log/apache2/foo-access.log combined
    ServerSignature On

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>

I didn't configure the server so anything could be happening but there must
be a straight forward explanation.

Thanks,
Will

On Thu, Aug 28, 2008 at 11:49 AM, Peter Corlett <abuse at cabal.org.uk> wrote:

> On Thu, Aug 28, 2008 at 11:22:13AM +0100, william pink wrote:
> [...]
> > But when I reload the config and try and go to the /example it tries to
> > resolve www.example.com/example and I can't work out what I am I doing
> > wrong, I have looked through the Apache documentation and can't see any
> > reference to this. I haven't got www.example.com in my /etc/hosts so I
> amm
> > not sure where it is getting it from?
>
> You've not really given us enough information, but I'd bet that you've got
> ServerName www.example.com somewhere and Apache's trying to redirect
> there.
> Apache will redirect if you give it the URL of a directory without the /.
> (It needs a redirect because otherwise relative URLs will be wrong.)
>
> --
> Gllug mailing list  -  Gllug at gllug.org.uk
> http://lists.gllug.org.uk/mailman/listinfo/gllug
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20080828/b67e2036/attachment.html>
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list