0

I have to install a new CentOS Server v6.5

I already install httpd and want to access Apache Welcome Page by serverIP. But I get a timeout, so I stop iptables service for a moment.

Now I get an 301 redirect to 127.0.0.1

Some information :

  • nano /etc/hosts is set to ''SERVERIP'' domain www.domain
  • /etc/httpd/conf/httpd.conf I set ServerName to www.domain

What's wrong ?

GTL-WEB
  • 1
  • 1

1 Answers1

0

It sounds like you have no high level of knowledge about setting up web server with apache. Why would you involve in this /etc/hosts?

Your server should automatically resolve the ip into hostname and it doesn't it means there is something wrong on the basic setup.

However, coming to httpd.conf, you have 2 directives there for ServerName, VirtualHost directive and and apache main configuration where you tell apache the IP address and the port to listen (this is in case you are using vhost, but they are both the same).

There is a good step by step guide to help you to set up what you need:

  https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-centos-7

Good luck!

ostendali
  • 373
  • 1
  • 4
  • Thanks I don't use VirtualHost (cause I just want to access Apache Welcome Page with the server IP, not multi domain or other..) I have to use VirtualHost for that ? – GTL-WEB Nov 21 '15 at 09:31
  • if you read carefully what I wrote you will already find the answer. I didn't said that you have to set/configure vhost. follow the guide as you seem to be not familiar with apache configuration. – ostendali Nov 23 '15 at 09:37