1

I have production server with apache/2.4.7 on ubuntu 14.04. I have several virtual hosts on it. This server located on hetzner. I decide to transfer my server on more powerfull server. I create snapshot of my old server and transfer it on new. Everything work fine but when i try to access on one of my domains that i transfer on new server i got just default apache webpage that stored on 000-default.conf on line:

DocumentRoot /var/www/html

i tried to aplly this command:

a2ensite mysite.conf

but i got this message: Site mysite already enabled i tried to a2dissite mysite.conf restart server, a2ensite mysite.conf then restart server once again. but i still got default page. Here is example of mysite:

<VirtualHost mysite.com.ua:80>
    ServerName mysite.com.ua
    ServerAlias www.mysite.com.ua
    WSGIDaemonProcess mysite processes=2 threads=15 display-name=%{GROUP} python-path=/var/www/mysite
    WSGIProcessGroup mysite

    WSGIScriptAlias / /var/www/mysite/mysite/wsgi.py

    <Directory /var/www/mysite/mysite>
        Require all granted
    </Directory>

    CustomLog /var/www/mysite/logs/apache_access.log combined
    ErrorLog /var/www/mysite/logs/apache_error.log

    Alias /static/ /var/www/mysite/static/
    <Directory /var/www/mysite/>
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Require all granted
    </Directory>

    Alias /media/ /var/www/mysite/media/
    <Directory /var/www/mysite/>
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Require all granted
    </Directory>
</VirtualHost>

here is my 000-default.conf:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

As you can see i use wsgi, but it still doesn't work when i use pure html. Can somebody help me with it. Thanks

  • After migrating the sites to new server your sites are not accessible. Is it? – Rajesh Keladimath Jan 11 '17 at 12:01
  • Is the domain that you are trying to access is pointing to the new server? – Rajesh Keladimath Jan 11 '17 at 12:04
  • Yes, i point domains on new server. – Zagorodniy Olexiy Jan 11 '17 at 12:05
  • I'm looking at your configuration. Could you try, please, to change <VirtualHost mysite.com.ua:80> with <VirtualHost *:80>. I don't know why, but I had similar problem while ago, and this was the solution. Maybe it is connected with /etc/hosts... – pa4080 Jan 11 '17 at 12:57
  • 1
    @SpasSpasov thank you it worls! post it as answer! – Zagorodniy Olexiy Jan 11 '17 at 13:00
1

Change <VirtualHost mysite.com.ua:80> with <VirtualHost *:80>.

I don't know what is the reason of this behaviour, but I had similar problem while ago, and this was the solution. Maybe it is connected with /etc/hosts.

It would be good someone, who knows the reason, give us an explanation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.