LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-14-2015, 02:32 PM   #1
alanford
LQ Newbie
 
Registered: Jun 2015
Location: planet of boredom
Distribution: debian
Posts: 18

Rep: Reputation: Disabled
how to assign 3 IPs to 3 different sites at debian server?


Hi,
I am newbie here, so, I have domain question.

debian + virtualmin, when i created servers in virtualmin I assigned 3 different IPs to 3 different servers. I did the same at VPS hosting website, I created DNS zones.

for example:

mysite1.com has IP 5.220.100.101
mysite2.com has IP 5.220.100.102
mysite3.com has IP 5.220.100.103

so, it is OK in virtualmin and VPS hosting site, but when I created wordpress sites, all 3 got the same IP: 5.220.100.101, it means if I try to type http://5.220.100.102/~mysite2.com
I don't get anything,

now I visited domain website and I understood I can not change A input to IP 5.220.100.102 than I must use for all 3 sites the same basic IP: 5.220.100.101
I saw the whole problem when i wanted to change IP at domain register. I logged in and I must add only basic IP.

by the way, all 3 wordpress websites are created in
/home/mysite1.com/public_html
/home/mysite2.com/public_html
/home/mysite3.com/public_html

it means virtualmin created users as I wanted, but how to give them different IPs? in virtualmin it is different but not in reality.

for example in Virtualmin - server configuration - dns records:
mysite2.com A - IPv4 Address 5.220.100.102
at virtualmin server mysite3.com is also: mysite3.com A - IPv4 Address 5.220.100.103

but in reality it is working only if I type in web browser: 5.220.100.101/~mysite2.com

so, how to assign second IP to /home/mysite2.com?

I said to friend to buy 3 IP dresses but now I don't know how to set it up for him, to have separated IP for each domain/wordpress site. in wordpress admin backend is also written basic address: 5.220.100.101/~mysite2.com
I had to install wordpress like that before I change IP at domain register (I migrate sites for him, it is all OK except I don't know how to assign 3 different IPs).

additional information:
I checked now and /var/lib/bind/mysite2.com.hosts and everything is OK, there is assigned IP, 5.220.100.102, and not basic IP.
it is also correct for mysite3.com, 5.220.100.103.

I checked and /etc/apache2/sites-available/
it is OK: <VirtualHost 5.220.100.102:80 then there is IPv6address:80

Last edited by alanford; 06-14-2015 at 03:24 PM. Reason: additional info
 
Old 06-15-2015, 07:20 AM   #2
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,550

Rep: Reputation: 137Reputation: 137
I guess you better work with different name based virtual hosts instead of using different ips. You need several network cards for 3 IPs, don't you?
But I don't know Virtualmin.
 
Old 06-15-2015, 09:33 PM   #3
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,712

Rep: Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279
Could always try virtual interfaces. These show up the same as the base ethernet interface, but with a number attached( such as "eth0:1", "eth0:2") once created they work exactly like a different physical interface would.
 
Old 06-16-2015, 09:04 AM   #4
richey75
LQ Newbie
 
Registered: Jun 2015
Posts: 8

Rep: Reputation: Disabled
The file you want to find is the httpd.conf file for Apache web server. Towards the bottom of the file different virtual web servers can be configured for them to run on application initialization.
 
Old 06-16-2015, 11:54 AM   #5
alanford
LQ Newbie
 
Registered: Jun 2015
Location: planet of boredom
Distribution: debian
Posts: 18

Original Poster
Rep: Reputation: Disabled
hosting company answered to me that I should assign additional IPs to the server, in etc/network/interfaces

Quote:
auto eth0:0
iface eth0:0 inet static
address xxx.xxx.xxx.xxx
netmask 255.255.255.0
Quote:
auto eth0:1
iface eth0:1 inet static
address xxx.xxx.xxx.xxx
netmask 255.255.255.0
after that restarting network (/etc/init.d/networking restart), then check it with ifconfig and then configuring Domains at domain register.

I did it and now it is working, I can use all IPs to ssh login to the server.

problem is only when I uploaded new wordpress, I can not start installation, I get download file instead of installation wizard.
now I try to find solution for that, apache <directory is OK:

Quote:
<Directory />
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
Quote:
<Directory "/home/*/public_html/">
Options Indexes FollowSymLinks Includes ExecCGI
#Order allow,deny
#Allow from all
Require all granted
</Directory>
any idea why wp installation is not accessible?
when i type IP address IP 5.220.100.102
I get some file to download and it is the same when I type: IP 5.220.100.102/~mysite2.com

this is content of that file:
Quote:
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.

*
* @package WordPress
*/

/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define('WP_USE_THEMES', true);

/**
Loads the WordPress Environment and Template */
require( dirname( __FILE__ ) . '/wp-blog-header.php' );

Last edited by alanford; 06-16-2015 at 11:56 AM.
 
Old 06-16-2015, 11:58 AM   #6
Habitual
LQ 5k Club
 
Registered: Jan 2011
Location: Nowhere near you, thank God.
Distribution: OSX Sierra
Posts: 8,573
Blog Entries: 15

Rep: Reputation: Disabled
Quote:
Originally Posted by alanford View Post
problem is only when I uploaded new wordpress, I can not start installation
Current WP installs have an upgrade option on the admin area that will do it for you.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Ubuntu Server 14.04 doesn't assign/recognize all available IPs TRUNoise Linux - Server 1 07-25-2014 02:06 PM
Assign multiple IPs to eth0? kenw232 Slackware 1 12-07-2013 04:59 AM
how to assign two IPs on same NIC arvind_77_99 Linux - Newbie 10 01-09-2008 06:25 PM
Assign different folders/users to different IPs on the same dedicated server yuye811 Linux - Server 2 12-17-2007 01:13 PM
how to assign 2 IPs to a computer dragon Linux - Networking 6 11-05-2002 09:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration