C
C
Ciscoridze2016-03-03 11:04:56
Apache HTTP Server
Ciscoridze, 2016-03-03 11:04:56

Why doesn't Apache2 redirect to other virtual hosts?

Hello. When you add a host, Apache does not redirect to it, but sends it to the Apache page.
I do according to the manual c Digital Ocean.
blog project.
Contents of blog.com.conf:

<VirtualHost *:80>
    ServerAdmin [email protected]
    ServerName blog.com
    ServerAlias blog.com
    DocumentRoot /var/www/blog.com
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

I did sudo 2ensite blog.com and added to hosts 127.0.0.1 blog.com
Anyway, the default Apache page opens /var/www/html, what's wrong?
Looked at other topics - did not help.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2016-03-03
@Ciscoridze

Spread the Apache config, is the vhosts mod enabled, then what are the rights to the files? I hope you're on Linux?

C
Ciscoridze, 2016-03-03
@Ciscoridze

Got it!
It turns out that it was necessary to first create all the configs in sites-available, and then create projects. I first created projects, and then I ruled configs. Maybe it's crutches and I'm doing something wrong? Is there something wrong with access rights?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question