3

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,

  • Check Apache error logs and update in your question – Rahul Patil Jun 9 '14 at 7:33
  • I got this from access.log file 123.231.16.77 - - [09/Jun/2014:07:17:19 +0000] "GET /admin1/ HTTP/1.1" 404 498 "-" "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/30.0.1599.114 Chrome/30.0.1599.114 Safari/537.36" 123.231.16.77 - - [09/Jun/2014:07:17:25 +0000] "GET /admin1 HTTP/1.1" 404 498 "-" "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/30.0.1599.114 Chrome/30.0.1599.114 Safari/537.36" – doubleD Jun 9 '14 at 8:38
  • have you restarted webserver after updating configuration ? but before restart do config test using apachectl -t – Rahul Patil Jun 9 '14 at 12:14
  • yes I did and i restart the server still its not good. and also after running apachectl -t I get Syntax OK message – doubleD Jun 10 '14 at 4:02
  • 3
    once check with Alias /admin1 "/var/www/html/admin", and also remove allow,deny order instead, you need to use Require all granted Ref httpd.apache.org/docs/2.4/upgrading.html – Rahul Patil Jun 10 '14 at 5:05
1

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.

  • 1
    This might be right, for sites-enabled they do need to end with .conf. Have an upvote for remembering that change. Note that they don't need it in sites-available, just the symbolic link name in sites-enabled need it. Same goes for all the xxx-enabled files, which are actually all symbolic links to their respective xxx-available files, which can be named anything. – Lizardx Dec 1 '17 at 1:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.