1

I have a multi purpose server running ArchLinux that currently serves multiple virtual hosts from /var/www/domains/EXAMPLE.COM/html /var/www/domains/EXAMPLE2.COM/html

I deploy those websites (mostly using Kohana framework) using a Jenkins job by checking out the project, removes the .git folder and ssh-copy the tar.gz to /var/www/domains/ on the server and untars it.

Since I don't want to have to re-install phpMyAdmin after each deploy, I decided to use an alias.

I would like the alias to be something like /.tools/phpMyAdmin/ so I could have more "tools" later if I wanted to.

I have tried just changing the default httpd-phpmyadmin.conf that was installed by following the official WIKI: https://wiki.archlinux.org/index.php/Phpmyadmin

Alias /.tools/phpMyAdmin/ "/usr/share/webapps/phpMyAdmin"
<Directory "/usr/share/webapps/phpMyAdmin">
        AllowOverride All
        Options FollowSymlinks
        Order allow,deny
        Allow from all
        php_admin_value open_basedir "/var/www/:/tmp/:/usr/share/webapps/:/etc/webapps:/usr/share/pear/"
</Directory>

Changing only that, doesn't seem to work with my current setup on the server, and apache forwards the request to the framework which 404s (as there's no route to handle /.tools/phpAdmin).

I have Mass Virtual hosting enable and setup like this:

#
# Use name-based virtual hosting.
#
NameVirtualHost *:8000

# get the server name from the Host: header
UseCanonicalName On

# splittable logs
LogFormat "%{Host}i %h %l %u %t \"%r\" %s %b" vcommon
CustomLog logs/access_log vcommon

<Directory /var/www/domains>
# ExecCGI is needed here because we can't force
# CGI execution in the way that ScriptAlias does
    Options FollowSymLinks ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

RewriteEngine On

# a ServerName derived from a Host: header may be any case at all
RewriteMap lowercase int:tolower

## deal with normal documents first:
# allow Alias /icons/ to work - repeat for other aliases
RewriteCond %{REQUEST_URI} !^/icons/
# allow CGIs to work
RewriteCond %{REQUEST_URI} !^/cgi-bin/
# do the magic
RewriteCond %{SERVER_NAME}  ^(www\.|)(.*)
RewriteRule ^/(.*)$ /var/www/domains/${lowercase:%2}/html/$1
## and now deal with CGIs - we have to force a MIME type
RewriteCond %{REQUEST_URI} ^/cgi-bin/
RewriteRule ^/(.*)$ /var/www/domains/${lowercase:%{SERVER_NAME}}/cgi-bin/$1 [T=application/x-httpd-cgi]

There is also nginx running on this server on port 80 as a reverse proxy for Apache:

    location ~ \.php$ {
        proxy_pass   http://127.0.0.1:8000;
    }

Everything else was setup by following the official WIKI so I don't think those would cause trouble. Do I need to have the alias for phpMyAdmin setup along the mass virtual hosting or can it be in a separate include file for that alias to work?

closed as unclear what you're asking by MadHatter, mdpc, Ward, Dave M, colealtdelete Oct 23 '13 at 22:04

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Mauricio, could I trouble you to be quite a lot more specific? At the moment this question strikes me as a candidate for "unclear what you're asking". What you've said already is admirably precise, but we need to know what "it's not working" means. Specifically: what did you do? What did you expect to happen? What actually happened? – MadHatter Oct 23 '13 at 7:30
1

Change

Alias /.tools/phpMyAdmin/ "/usr/share/webapps/phpMyAdmin"

to

Alias /.tools/phpMyAdmin/ "/usr/share/webapps/phpMyAdmin/"

restart apache and try again

Edit: Something interesting at kb.ucla.edu/articles/… So I guess it is about mod_alias vs mod_rewrite and you could try add this

RewriteCond %{REQUEST_URI} !^/.tools/phpMyAdmin/

before this

RewriteCond %{REQUEST_URI} !^/icons/
  • I still have a 404 answered by kohana meaning the Alias is not being used – MauricioOtta Oct 23 '13 at 18:38
  • @MauricioOtta Something interesting at kb.ucla.edu/articles/… So I guess it is about mod_alias vs mod_rewrite and you could try add this RewriteCond %{REQUEST_URI} !^/.tools/phpMyAdmin/ – Wutiphong Oct 23 '13 at 21:09
  • 1
    add the RewriteCond for phpMyAdmin before this RewriteCond %{REQUEST_URI} !^/icons/ – Wutiphong Oct 23 '13 at 21:56

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