What would be and how to use Namevirtualhost *:80?

Asked

Viewed 40 times

1

I am installing a new site pre-configured, but for it to be installed you need to create a configuration file as follows:

inserir a descrição da imagem aqui

This part of the documentation is vague for me, and I didn’t understand what this configuration file would be, so I created a file. htaccess in the htdocs folder of xampp.

My file looked like this:

NameVirtualHost *:80

<VirtualHost *:80>
  ServerName localhost;
  DocumentRoot C:\xampp\htdocs\public;
</VirtualHost>

But when I try to access http://localhost see this mistake:

inserir a descrição da imagem aqui

I also tried to use modifying the code for this:

NameVirtualHost *:80

<VirtualHost *:80>
  ServerName localhost;
  DocumentRoot /xampp/htdocs/public;
</VirtualHost>

But the error generated is the same. What am I doing wrong? It follows structure of the directories htdocs and public respectively.

htdocs

publick

  • 1

    With the VirtualHost you can point out folders and ports, making adjustments for each type of access, it is also possible to detect the HOST, ie you can use multiple Hosts and each HOST would have its own pointing folder.

  • Thank you, but should it be added to . htaccess itself? because I’m running a test excluding this code that I put here in the question and the error is the same, it seems that it is indifferent whether it is in the . htaccess

  • No, virtualhost does not work on htaccess, virtualhost control is on the core, htaccess runs well after the current host check run.

  • Talnun goes to the Apache logs please and tries to copy the errors and sends me, it may be some module or infinite redirect loop.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.