in Web server by (12.7k points)
0 like 0 dislike
How I can to add any directory in role virtual host in Apache web server, e.g. for PhpMyAdmin? I.e. on URL query: "" (virtual server directory) I need receive content of "/var/srv/web/phpMyAdmin" (real directory of server file system).

1 Answer

0 like 0 dislike
by (12.7k points)

For this need alias directive of the "mod_alias" module.

Need configure the necessary directory using the Directory section, and add an alias (address) to this directory using the alias directive of the "mod_alias" module for Apache. Usually this module comes with the Apache web server and is already connected to it.

Directing a specific URL alias to a specific directory on the server:

<IfModule mod_alias.c>
	Alias /phpmyadmin/ "/var/srv/web/phpMyAdmin/"

Set settings for a specific directory:

<Directory "/var/srv/web/phpMyAdmin">
	AllowOverride All
	Options +FollowSymlinks +Indexes
	Require all granted

Your answer

Try to answer the question as detailed as possible.
Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.