How to configure an alias in Apache 2.4?

11,750

I had a similar issue and my fix was to make sure my file ended with .conf . It seems this wasn't required in apache 2.2.

EDIT

As per the comment, apache 2.4's apache2.conf contains this line: IncludeOptional sites-enabled/*.conf . sites-available isn't related to this, unless you've got a symlink from sites-enabled.

Share:
11,750

Related videos on Youtube

Author by

doubleD

Updated on September 18, 2022

Comments

  • doubleD 4 months

    I need to config an alias in Apache 2.4, and work the same as phpmyadmin works in my Ubuntu AWS server. I created a site-enable file and add the following lines for it

        Alias /admin1/ "/var/www/html/admin"
        <Directory "/var/www/html/admin">
            Order allow,deny
            Allow from all
        </Directory>
    

    But when I hit /admin1 it redirects to the 404 page,

    • Rahul Patil
      Rahul Patil over 8 years
      Check Apache error logs and update in your question
    • doubleD over 8 years
      yes I did and i restart the server still its not good. and also after running apachectl -t I get Syntax OK message
    • doubleD over 8 years
      I tried that still no good, and now my virtual host like this Alias /admin1 "/var/www/admin.dgstg2.com/html" <Directory "/var/www/admin.dgstg2.com/html"> Require all granted </Directory>
    • elbarna
      elbarna about 8 years
      Try location instead of alias for me worked fine.
    • Vinz
      Vinz about 7 years
      Did you configure a DirectoryIndex pointing to index.php or index.html ?