Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Sep 10, 2015 5:23 pm 
Offline
Junior Member

Joined: Thu Apr 16, 2015 9:44 am
Posts: 21
I have 2 IP addresses in my Linode. It is basically for SSL but let's assume that I want example1.com and example3.com work at IP 1.1.1.1 and example2.com works at IP 2.2.2.2.

I should be missing something, somewhere. I have basically following settings related with this in the configuration files - I did read and apply the same thing in Apache documentation as well as many other sources.

Code:
    Listen 80
   
    <VirtualHost *:80>
            ServerName example1.com
            # ...
    </VirtualHost>
   
    <VirtualHost *:80>
            ServerName example3.com
            # ...
    </VirtualHost>
   
    <VirtualHost 2.2.2.2:80>
            ServerName example2.com
            # ...
    </VirtualHost>


I have example2.com pointed to 2.2.2.2 and and the others to 1.1.1.1 in DNS records.

I can go to example1.com and example3.com successfully but example2.com goes to default server, which is example1.com for this sample since it was entered first in the configuration.

Another weirdness: keeping DNS same for example2.com but change vhost config to be *:80 and it opens the website and server ip is reported as 1.1.1.1 as I can get from the web script to see what's going on.

And another one: Even I keep only example2.com domain in the configuration and remove others, it still doesn't work with the IP. As I tried to mention, if I enter 2.2.2.2, it successfully access to the server via this IP.

Could someone please help me to solve this problem which is obviously caused by something I am doing wrong or missing.

Thank you very much in advance.


Top
   
PostPosted: Fri Sep 11, 2015 3:44 am 
Offline
Junior Member

Joined: Thu Apr 16, 2015 9:44 am
Posts: 21
My bad.
Just in case someone else does the same mistake:

You really need to disable Auto Configure Network in Configuration Profile.


Top
   
PostPosted: Mon Sep 14, 2015 12:41 pm 
Offline
Linode Staff

Joined: Mon Sep 29, 2014 4:47 pm
Posts: 90
Twitter: FelicianoTech
Did you figure this out?

You should be able to run `apache2ctl -S` (for Debian based distros) or `apachectl -S` (for Red Hat based distros) to see which virtual host are loaded by Apache, their assigned IPs/ports, and server names. This can help make sure the right information is being loaded.

Also, for the example you gave, if you're going to explicitly use an IP address for the third vhost, I would use your first IP address for the other two vhost. Otherwise they are still configured to use ALL IPs.


Top
   
PostPosted: Thu Sep 17, 2015 8:15 am 
Offline
Newbie

Joined: Thu Sep 17, 2015 6:20 am
Posts: 4
smozgur wrote:
My bad.
Just in case someone else does the same mistake:

You really need to disable Auto Configure Network in Configuration Profile.

How does one "disable Auto Configure Network in Configuration Profile?"


Top
   
PostPosted: Thu Sep 17, 2015 9:41 am 
Offline
Newbie

Joined: Thu Sep 17, 2015 6:20 am
Posts: 4
rfeliciano wrote:
You should be able to run `apache2ctl -S` (for Debian based distros) or `apachectl -S` (for Red Hat based distros) to see which virtual host are loaded by Apache, their assigned IPs/ports, and server names. This can help make sure the right information is being loaded.

I am having trouble getting apache to display my pages. I believe that the request is being received by my server, but the only page that is displayed is the Apache default page. Can someone point me to some debug techniques that will help me isolate this problem. The result of my apachectl -S request follows:
Code:
[bobheath@example ~]$ apachectl -S
VirtualHost configuration:
45.79.xxx.yy:80        is a NameVirtualHost
         default server www.example1.com (/etc/httpd/conf/httpd.conf:1013)
         port 80 namevhost www.example1.com (/etc/httpd/conf/httpd.conf:1013)
                 alias example1.com
         port 80 namevhost www.example2.com (/etc/httpd/conf/httpd.conf:1022)
                 alias example2.com
         port 80 namevhost www.example3.com (/etc/httpd/conf/httpd.conf:1031)
                 alias example3.com
Syntax OK
[bobheath@example ~]$


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group