apache2 web server

Sajan Parikh sajan at parikh.io
Wed Apr 23 15:47:42 UTC 2014


On 04/23/2014 10:34 AM, Ian A Taylor wrote:
> Sajan
>
> apachectl configtest
>
> returns
>
> Syntax OK
>
>
> The server fffff.st-and.ac.uk
>
> works ok
>
> But I want to create a sub-directory
> I am not sure if sub-directory is the correct word to utilize here.
>
> But I want the web address
>
> fffff.st-and.ac.uk/qwert
>
> to respond in a different way from  fffff.st-and.ac.uk
Ah, okay.  In that case, you're going about it incorrectly.

In the main VirtualHost or configuration for fffff.st-and.ac.uk, you 
need to use the Alias directive like this;

Alias /qwert /home/qwert/  #(you might need to play with the trailing 
slashes)

That line will allow your main configuration to work as expected, but 
for /qwert, it will use /home/qwert as the DocumentRoot. Meaning 
fffff.st-and.ac.uk/qwert/somefile.jpg will pull from 
/home/qwert/somefile.jpg while the rest of fffff.st-and.ac.uk will 
operate normally using the standard config, which seems to be what 
you're after.

There's actually a whole section in the Apache documentation about URL 
mapping, which is what you are trying to do.  Creating a separate 
VirtualHost for each URL path is not the way to go.

http://httpd.apache.org/docs/2.2/urlmapping.html

Sajan Parikh


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3195 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20140423/459bbab8/attachment.bin>


More information about the ubuntu-users mailing list