How To Do Apache Aliasing

Discussion in 'Apache' started by cesarcesar, May 8, 2006.

  1. #1
    Hello all. I have a question that pertains to Apache Aliases. I have read multiple upon multiple info on this and I am still confused. Guru wisdom is much appreciated. My question is, what is the difference between these two was of aliasing? I have added both my local (WIN-XP) and remote (LAMP) aliases. I am also wondering if my <Directory>...</Directory> attributes are correct.

    1. Adding within .htaccess file like -
    
    Local -	Alias /EmpireManager C:/apache2triad/htdocs/EmpireManager
    Remote - Alias /EmpireManager /var/www/path/to/EmpireManager
    
    Code (markup):
    2. Adding into httpd.conf file like -
    
    Local -	Alias /EmpireManager/ "C:/apache2triad/htdocs/clients/EmpireManager/"
    
    	<Directory "C:/apache2triad/htdocs/clients/EmpireManager">
    	    Options Indexes MultiViews
    	    AllowOverride None
    	    Order allow,deny
    	    Allow from all
    	</Directory>
    
    Remote - Alias /EmpireManager/ "/var/www/path/to/EmpireManager/"
    
    	<Directory "/var/www/path/to/EmpireManager">
    	    Options Indexes MultiViews
    	    AllowOverride None
    	    Order allow,deny
    	    Allow from all
    	</Directory>
    
    Code (markup):
    When using the httpd.conf method locally Apache will not start with <Directory>...</Directory>. If i comment it out Apache works but Aliasing does not.
     
    cesarcesar, May 8, 2006 IP
  2. theblight

    theblight Peon

    Messages:
    246
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Alias Directive is a complement of the:
    DocumentRoot
    Alias is parsed first before the <Directory>...</Directory>.

    Example:
    you have www.somesite.com.
    
    and your 
    DocumentRoot is "C:\websites"
    and your images is stored:
    "C:\images"
    
    So you will declare:
    
    DocumentRoot is "C:\websites"
    Alias "/images/" "C:\images"
    
    so when you visit your site:
    
    somesite.com/images/
    
    it will show the images on "C:\images" even though you dont have images folder under "C:\websites".
    
    
    Code (markup):
    This directive is used to specify certain
    additional settings for that certain directory declared within the parameter.
    <Directory>
    .....
    </Directory>


    Hope It Helps
     
    theblight, May 11, 2006 IP