Y
Y
Yuri2014-11-08 19:45:33
Apache HTTP Server
Yuri, 2014-11-08 19:45:33

Why does localhost open instead of a domain?

Ubuntu server 12.10, apache2
There is a city.domen.ru subdomain, in DNS management Record A indicated the IP address of the server. Set up virtual hosts:

<VirtualHost *:5080>
   ServerAdmin [email protected]
   DocumentRoot /var/www/city.domen.ru/public_html
   ServerName city.domen.ru
   ServerAlias www.city.domen.ru

The server port is not standard 80, but 5080, so I add the
city.domen.ru:5080 port to the domain.
The problem is that when I try to access this domain, I get to localhost.
that is, the same as ip address: 5080, local CRM is located on localhost.
here is the contents of its VirtualHost
<VirtualHost *:5080>
   ServerAdmin [email protected]
   DocumentRoot /var/www/crm/public_html
   ServerName localhost

there is a link to the config in sites-enabled
What could be the problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Petrikov, 2014-11-08
@RicoX

Comment out the line:
ServerName localhost
restart the web server and try again.

Y
Yuriy, 2014-11-09
@yborschev

At random it turned out that only the default VirtualHost works.
there are other configs in sites-enabled, but it's not clear how to make them work

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question