[Gllug] Problems with mod_alias and Apache

william pink will.pink at gmail.com
Thu Aug 28 14:03:59 UTC 2008


That fixed the problem of it need trying to resolve to www.example.com
so thanks for that

The problem I am having now is the directory root I think, When I try
and access it I get this error in my apache log

File does not exist: /var/www/foo/example

But of course I want it to point at /var/www/example

Heres my VH config for that part now

    Alias /example/ /var/www/example
     <Directory /var/www/example>
       Order allow,deny
       Allow from all
      </Directory>

But looking at the Apache docs that appears to be the right way of doing it?


Thanks for the help so far,

Will


On 8/28/08, chanka perera <chanka.perera at gmail.com> wrote:
> Hi,
>
>  I would suggest you to try out,
>
>  Alias /example/     /var/www/example/
>
> check on the httpd.conf file i you may give a try as above,
>
> cheers!
> Chanka Perera
>
> On Thu, Aug 28, 2008 at 12:17 PM, william pink <will.pink at gmail.com> wrote:
>> 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
>>
>>
>> --
>> Gllug mailing list  -  Gllug at gllug.org.uk
>> http://lists.gllug.org.uk/mailman/listinfo/gllug
>>
>>
>
>
>
> --
> http://chanka.paunix.org/
> --
> Gllug mailing list  -  Gllug at gllug.org.uk
> http://lists.gllug.org.uk/mailman/listinfo/gllug
>
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list