What is the difference between virtual server and alias in apache for php?

usually phpmyadmin is configured as an alias in wamp packages and some of the projects can be configured on a virtual server with a port number. Can someone explain what the difference is between the two and in which scenario you can use any of the functions?

+6
source share
1 answer

Alias

"Alias" in Apache can be a directory alias, i.e.

Alias /phpmyadmin /usr/share/phpmyadmin 

this means that you can use http://example.org/phpmyadmin/ and http://www2.example.org/phpmyadmin/ (each host on your apache instance) to access phpmyadmin.

Virtual host

Virtual hosts are used to host multiple domains in a single apache instance. You can have one virtual host for each IP address of your server or the same IP address, but different ports or the same IP address, the same port, but different host names. The latter are called "vhosts-based names."

Each virtual host is configured on its own and does not affect other vhosts.

There is also a ServerAlias directive that adds a different name to the virtual host based on the name.

+15
source

Source: https://habr.com/ru/post/886525/


All Articles