Diferencia entre revisiones de «VirtualHost»
De enunpimpam
								
												
				|  (Página creada con «Category:Linux <syntaxhighlight lang="bash"> <VirtualHost *:80>      ServerAdmin nacho@espaiformacio.com      DocumentRoot /var/www/pimpamwiki/      ServerName wiki.enu…») | |||
| (No se muestran 2 ediciones intermedias del mismo usuario) | |||
| Línea 3: | Línea 3: | ||
| <VirtualHost *:80> | <VirtualHost *:80> | ||
|       ServerAdmin nacho@espaiformacio.com |       ServerAdmin nacho@espaiformacio.com | ||
| − |       DocumentRoot /var/www/ | + |       DocumentRoot /var/www/pimpa/ | 
| − |       ServerName  | + |       ServerName tom.enunpimpam.com | 
| − |       ServerAlias www. | + |       ServerAlias www.tom.enunpimpam.com | 
| − |       Alias / | + |       Alias /pimpa "/var/www/pimpa/" | 
| − |       <Directory /var/www/ | + |       <Directory /var/www/pimpa/> | 
|          Options +FollowSymlinks |          Options +FollowSymlinks | ||
|          AllowOverride All |          AllowOverride All | ||
| Línea 15: | Línea 15: | ||
|              Dav off |              Dav off | ||
|            </IfModule> |            </IfModule> | ||
| − |          SetEnv HOME /var/www/ | + |          SetEnv HOME /var/www/pimpa | 
| − |          SetEnv HTTP_HOME /var/www/ | + |          SetEnv HTTP_HOME /var/www/pimpa | 
|       </Directory> |       </Directory> | ||
| − |       ErrorLog ${APACHE_LOG_DIR}/ | + |       ErrorLog ${APACHE_LOG_DIR}/pimpa.error.log | 
| − |       CustomLog ${APACHE_LOG_DIR}/ | + |       CustomLog ${APACHE_LOG_DIR}/pimpa.access.log combined | 
| </VirtualHost> </syntaxhighlight> | </VirtualHost> </syntaxhighlight> | ||
| + | |||
| + | == Obtener el listado de VirtualHosts de un Apache == | ||
| + | Para obtener un listado de los dominios que esta activos sus puerto y los archivos de configuración. | ||
| + |  apachectl -S | ||
| + | <syntaxhighlight lang="bash"> | ||
| + | VirtualHost configuration: | ||
| + | *:80                   is a NameVirtualHost | ||
| + |          default server 192.168.101.20 (/etc/apache2/sites-enabled/000-default.conf:1) | ||
| + |          port 80 namevhost 192.168.101.20 (/etc/apache2/sites-enabled/000-default.conf:1) | ||
| + |          port 80 namevhost aki.nationarmy.net (/etc/apache2/sites-enabled/aki.nat.conf:1) | ||
| + |                  alias www.aki.nationarmy.net | ||
| + |          port 80 namevhost nationarmy.net (/etc/apache2/sites-enabled/nationarmy.conf:1) | ||
| + |                  alias www.nationarmy.net | ||
| + | *:443                  is a NameVirtualHost | ||
| + |          default server aki.nationarmy.net (/etc/apache2/sites-enabled/aki-ssl.conf:2) | ||
| + |          port 443 namevhost aki.nationarmy.net (/etc/apache2/sites-enabled/aki-ssl.conf:2) | ||
| + |                  alias www.aki.nationarmy.net | ||
| + |          port 443 namevhost 192.168.101.20 (/etc/apache2/sites-enabled/default-ssl.conf:2) | ||
| + |          port 443 namevhost nationarmy.net (/etc/apache2/sites-enabled/nation-ssl.conf:2) | ||
| + |                  alias www.nationarmy.net | ||
| + |          port 443 namevhost toma.nationarmy.net (/etc/apache2/sites-enabled/toma.nation-ssl.conf:2) | ||
| + |                  alias www.toma.nationarmy.net | ||
| + | ServerRoot: "/etc/apache2" | ||
| + | </syntaxhighlight> | ||
Revisión actual del 17:21 3 jul 2020
<VirtualHost *:80>
     ServerAdmin nacho@espaiformacio.com
     DocumentRoot /var/www/pimpa/
     ServerName tom.enunpimpam.com
     ServerAlias www.tom.enunpimpam.com
     Alias /pimpa "/var/www/pimpa/"
     <Directory /var/www/pimpa/>
        Options +FollowSymlinks
        AllowOverride All
        Require all granted
          <IfModule mod_dav.c>
            Dav off
          </IfModule>
        SetEnv HOME /var/www/pimpa
        SetEnv HTTP_HOME /var/www/pimpa
     </Directory>
     ErrorLog ${APACHE_LOG_DIR}/pimpa.error.log
     CustomLog ${APACHE_LOG_DIR}/pimpa.access.log combined
</VirtualHost>
Obtener el listado de VirtualHosts de un Apache
Para obtener un listado de los dominios que esta activos sus puerto y los archivos de configuración.
apachectl -S
VirtualHost configuration:
*:80                   is a NameVirtualHost
         default server 192.168.101.20 (/etc/apache2/sites-enabled/000-default.conf:1)
         port 80 namevhost 192.168.101.20 (/etc/apache2/sites-enabled/000-default.conf:1)
         port 80 namevhost aki.nationarmy.net (/etc/apache2/sites-enabled/aki.nat.conf:1)
                 alias www.aki.nationarmy.net
         port 80 namevhost nationarmy.net (/etc/apache2/sites-enabled/nationarmy.conf:1)
                 alias www.nationarmy.net
*:443                  is a NameVirtualHost
         default server aki.nationarmy.net (/etc/apache2/sites-enabled/aki-ssl.conf:2)
         port 443 namevhost aki.nationarmy.net (/etc/apache2/sites-enabled/aki-ssl.conf:2)
                 alias www.aki.nationarmy.net
         port 443 namevhost 192.168.101.20 (/etc/apache2/sites-enabled/default-ssl.conf:2)
         port 443 namevhost nationarmy.net (/etc/apache2/sites-enabled/nation-ssl.conf:2)
                 alias www.nationarmy.net
         port 443 namevhost toma.nationarmy.net (/etc/apache2/sites-enabled/toma.nation-ssl.conf:2)
                 alias www.toma.nationarmy.net
ServerRoot: "/etc/apache2"