How to Redirect CNAME to Hosting

Asked

Viewed 231 times

0

I am trying to redirect a domain and a CNAME to an IP at Locaweb.

It is a cloud server that generates a temporary link to access the site from the browser. Let’s assume: http://cproXXXX.publiccloud.com.br

In domain hosting I’m putting like this:

dominio.com.br           A        XXX.X.XXX.XXX
www.dominio.com.br     CNAME      dominio.com.br

This IP is from the Locaweb server that is the site. I configured the Virtual Host like this:

ServerName dominio.com.br
ServerAlias www.dominio.com.br
ServerAdmin [email protected]
DocumentRoot /var/www/dominio.com.br/public_html

<Directory /var/www/dominio.com.br/public_html>
   Options Indexes FollowSymLinks MultiViews
   AllowOverride None
   Order allow,deny
   allow from all
</Directory>

I’ve circled the a2ensite dominio.com.br.conf

And nothing happens.

When access the site appears like this:

You can only access this site by the address: http://cproXXXX.publiccloud.com.br

Then he redirects to that domain and enters the site I left as a test.

But how do I access the domain and already land on the site ?

Apache2 Log - Error.Log

[Wed May 18 13:47:52.720700 2016] [mpm_prefork:notice] [pid 8080] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.16 configured -- resuming normal operations
[Wed May 18 13:47:52.720907 2016] [core:notice] [pid 8080] AH00094: Command line: '/usr/sbin/apache2'
  • What appears in the apache log? After a2ensite restarted the service (without being Reload?)

  • I restarted Apache2 with Restart...

  • what you did I do daily in my Ocaweb VPS, the business is to activate the log and see what message it gives

  • Which folder is this LOG ? Apache log or Server log ? What is the path ?

  • The vhost log itself, Errorlog ${APACHE_LOG_DIR}/domain.com.br-error.log Customlog ${APACHE_LOG_DIR}/domain.com.br-access.log Combined

  • ah, and a2ensite is domain.com.br (the has to have . conf in the file, but not in the command)

  • In LOG the only things you have are the ones I put in my POST

  • That’s why I asked to activate the vhost log but take a look at my comment on a2ensite

  • I saw your comment, I had already done it. And the Logs are enabled

  • witchcraft. Ran apachectl configtest to see if all confs are ok? Other than that my next attempt was to take your site from /var/www

  • I typed this command there, appeared Syntax OK

  • remove the site from /var/www give permission to www-data:www-data and, I don’t know, check if the DNS is replicating even

  • You don’t even have that www-data folder

  • is not a folder, is a user and a group.

  • Got it. Well, there’s no it here. I installed Apache2, PHP, Mysql everything from 0...

  • I’m having the same problem and nothing, I think it might be the hosts file, it has this entry:127.0.1.1 {namepads}.publiccloud.com.br {namepads}

Show 11 more comments
No answers

Browser other questions tagged

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