Apache别名子文件夹,并开始与点

我有一个运行ArchLinux的多用途服务器,它目前从/var/www/domains/EXAMPLE.COM/html /var/www/domains/EXAMPLE2.COM/html提供多个虚拟主机

我使用Jenkins作业来部署这些网站(通常使用Kohana框架),通过检出项目,删除.git文件夹并将tar.gz复制到服务器上的/ var / www / domains /并对其进行解压缩。

由于我不想在每次部署后重新安装phpMyAdmin,我决定使用别名

我想这个别名是/.tools/phpMyAdmin/,所以如果我愿意的话,我可以有更多的“工具”。

我试过只是更改默认的httpd-phpmyadmin.conf,通过官方的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> 

只更改,似乎并没有与我当前在服务器上的设置,并将Apache请求转发到404s的框架(因为没有path来处理/ .tools / phpAdmin)。

我有大量虚拟主机启用和设置像这样:

 # # 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] 

在端口80上的服务器上也有nginx作为Apache的反向代理:

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

其他的一切都是按照官方的WIKI设置的,所以我不认为这会造成麻烦。 我是否需要在群发虚拟主机上设置phpMyAdmin的别名,或者是否可以在单独的包含文件中使别名正常工作?

更改

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

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

重新启动Apache,然后重试

编辑:在kb.ucla.edu/articles/…有趣的东西所以我想这是关于mod_alias与mod_rewrite,你可以尝试添加

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

在这之前

 RewriteCond %{REQUEST_URI} !^/icons/