Apache 2 host virtual apontando para index.html

1

Eu tentei criar um host virtual whitecrm.local pelo seguinte procedimento:

  1. Primeiro eu criei o host usando sudo vim /etc/hosts

    127.0.0.1       localhost
    127.0.0.1       whitecrm.local
    
  2. Criado um arquivo em sites-available/whitecrm.local

    <VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName whitecrm.local
        DocumentRoot /var/www/whitecrm_local
    
        <Directory />
            Options FollowSymLinks
            AllowOverride All
        </Directory>
    
        <Directory /var/www/whitecrm_local/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
        </Directory>
    
        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    
        <Directory "/usr/lib/cgi-bin">
            AllowOverride None
            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all
        </Directory>
    
        ErrorLog ${APACHE_LOG_DIR}/error.log
    
        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn
    
        CustomLog ${APACHE_LOG_DIR}/access.log combined
    
        Alias /doc/ "/usr/share/doc/"
        <Directory "/usr/share/doc/">
            Options Indexes MultiViews FollowSymLinks
            AllowOverride None
            Order deny,allow
            Deny from all
            Allow from 127.0.0.0/255.0.0.0 ::1/128
        </Directory>
    </VirtualHost>
    
  3. Em seguida, reinicie o apache

    sudo /etc/init.d/apache2 restart
    

Quando tentei http://whitecrm.local no meu navegador. Ele está apontando para o arquivo index.html de /var/www , não para o meu novo em /var/www/whitecrm_local .

Eu verifiquei o arquivo apache2.conf . Ele tem a linha descomentada:

Include sites-enabled/

Qual é o problema aqui? e o que estou perdendo?

    
por Ganesh Babu 08.12.2014 / 16:04

1 resposta

1

Você não deve simplesmente colocar coisas em sites-enabled . Você deve usar a2ensite para ativar a configuração do site no Apache.

A sintaxe é a2ensite [site] .

    
por Thomas Ward 08.12.2014 / 16:21