LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-17-2001, 05:45 PM   #1
Ricardo77uk
Member
 
Registered: Jun 2001
Location: London England
Distribution: Suse 7.1
Posts: 45

Rep: Reputation: 15
Smile


Hi all, I have installed suse on my box and got the latest version of apache going.

I would like to know how i can assign mutiple ip addresses to my system. i.e, what file i need to add entries to???

Thanks
 
Old 06-17-2001, 07:36 PM   #2
nabil
Member
 
Registered: Feb 2001
Location: MI, USA
Distribution: Debian Linux 100% GNU
Posts: 210

Rep: Reputation: 31
If you are refering to multiple IPs on same network interface then look into:
#ifconfig eth0:1
 
Old 06-18-2001, 10:21 AM   #3
Ricardo77uk
Member
 
Registered: Jun 2001
Location: London England
Distribution: Suse 7.1
Posts: 45

Original Poster
Rep: Reputation: 15
Question

Thanks for the post nabil, yep thats what i want, only i dont understand your instruction, is IPCONFIG a file? Can you please elobrate some more as i have had linux for only 2 weeks,

 
Old 06-18-2001, 02:52 PM   #4
Ricardo77uk
Member
 
Registered: Jun 2001
Location: London England
Distribution: Suse 7.1
Posts: 45

Original Poster
Rep: Reputation: 15
Thumbs down

OK, I have managed to assign a I.P address for my network card (eth0) and used command: ifconfig eth0:0 194.168.0.2.

I did a PING to 194.168.0.2 and it seemed to have worked, yet when i reboot Linux i loose 194.168.0.2, 100% packet loss when pinged.

please help????
 
Old 06-18-2001, 04:08 PM   #5
nabil
Member
 
Registered: Feb 2001
Location: MI, USA
Distribution: Debian Linux 100% GNU
Posts: 210

Rep: Reputation: 31
Well, I think you need to make a file under /etc/sysconfig/network-scripts called "ifcfg-eth0:0" then do the ifconfig again
#ifconfig eth0:0 172.26.20.110 netmask 255.255.255.255 up

The file for eth0:0 as "ifcfg-eth0"

It would be something similar to this :
[nabil@viper network-scripts]$ more ifcfg-eth0:0
DEVICE=eth0:0
ONBOOT=yes
BOOTPROTO=static
IPADDR=10.0.0.150
NETMASK=255.255.255.0
GATEWAY=10.0.0.1
BROADCAST=10.0.0.255
NETWORK=10.0.0.0
USERCTL=no
[nabil@viper network-scripts]$

Let me know if this work.

I tested this on a Sun Solaris 8 but not yet on Linux.
BTW: The ifconfig command is a temp thing unless the file is made and the machine can use it when rebooted.
If that does not work then don't reboot the machine until you figure it out.
 
Old 06-19-2001, 09:10 AM   #6
Ricardo77uk
Member
 
Registered: Jun 2001
Location: London England
Distribution: Suse 7.1
Posts: 45

Original Poster
Rep: Reputation: 15
Thumbs up I think i solved it

I tried the above but no luck, I think SUSE has a different means of doing this: I edited rc.config to look like this:

# Number of Network cards

NETCONFIG "_0 _1 _2 _3"

# IP Addresses

IPADDR_0="192.168.0.2"
IPADDR_1="192.168.0.3"
IPADDR_2="192.168.0.4"
IPADDR_3="192.168.0.5"

#network devices

NETDEV_0="eht0"
NETDEV_1="eht0:0"
NETDEV_2="eht0:1"
NETDEV_3="eht0:2"

______________________________

I used Ping and they all work. I am using APACHE and i have configured virtual hosts at each of these IP ADDRESSES. It seems to work. I get no errors at boot-up...

Do you know if the above is okay?


 
Old 06-19-2001, 01:29 PM   #7
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
Quote:
Originally posted by Ricardo77uk
Hi all, I have installed suse on my box and got the latest version of apache going.

I would like to know how i can assign mutiple ip addresses to my system. i.e, what file i need to add entries to???

Thanks
As you mention Apache are you setting up the multiple addresses to implemente multiple sites hosted on the same box? If this is the case its not necessary - you can do it using VirtualHosts in you httpd.conf - have a look near the end of the file.

Cheers.

Jamie...
 
Old 06-19-2001, 02:40 PM   #8
Ricardo77uk
Member
 
Registered: Jun 2001
Location: London England
Distribution: Suse 7.1
Posts: 45

Original Poster
Rep: Reputation: 15
Jamie I tried that but it didnt work

Jamie I tried that but it didnt work... I made a few virtual hosts and when i pinged them there was 100% packet loss.
also the pages didn't load, i got a message: could not connect www.virtualhost.com.

When i added the IP Address to the Interface, all seemed to work well.

I need more than one IP as I am playing around with MODSSL and want to configure SSL on more than on virtual host.
 
Old 06-19-2001, 02:56 PM   #9
rebby
LQ Newbie
 
Registered: Apr 2001
Location: Hugo, MN
Distribution: Slackware, RedHat
Posts: 24

Rep: Reputation: 15
you did that correctly for suse... redhat does it via /etc/sysconfig, suse uses rc.config.... and yes, you must use ip based virtual hosts w/ssl because of how ssl works...
 
Old 06-19-2001, 05:14 PM   #10
nabil
Member
 
Registered: Feb 2001
Location: MI, USA
Distribution: Debian Linux 100% GNU
Posts: 210

Rep: Reputation: 31
Ricardo77uk,

I think you setup is OK, but as far as Apache using multiple IP's for the purpose of having virtual hosts is not necessary in your case. Apache has the capability to bind virtual hosts to same IP address but there are a couple of tricks to this. A typical SSL setup does not work on multiple IP's if this what's multiple IPs are for. If SSL is not your case and only need to have multiple sites running on same box with same IP then look at my http.conf file. I have few actual web sites running on same IP address.

###############################
# Listen: Allows you to bind Apache to specific IP addresses #and/or
# ports, in addition to the default. See also the <VirtualHost>
# directive.
#
#Listen 3000
#Listen 10.0.0.1:80
Listen 80
#
#
# BindAddress: You can support virtual hosts with this option. #This directive
# is used to tell the server which IP address to listen to. It can #either
# contain "*", an IP address, or a fully qualified Internet domain #name.
# See also the <VirtualHost> and Listen directives.
#
BindAddress 10.0.0.1
#
#
# Port: The port to which the standalone server listens. For
# ports < 1023, you will need httpd to be run as root initially.
#
Port 80
#
# ServerAdmin: Your address, where problems with the server #should be
# e-mailed. This address appears on some server-generated #pages, such
# as error documents.
#
ServerAdmin nabil@abuharbid.com
#
#
ServerName viper.linux-hpc.org
#
NameVirtualHost 10.0.0.1:80
<VirtualHost 10.0.0.1>
ServerAdmin nabil@abuharbid.com
DocumentRoot /home/nabil/html/linux-hpc.org
ServerName www.linux-hpc.org
ServerAlias linux-hpc.org *.linux-hpc.org
AddHandler cgi-script .cgi
AddHandler cgi-script .pl
AddHandler cgi-script .sh
Alias /cgi-bin/ "/home/nabil//cgi-bin/linux-hpc.org/"
ScriptAlias /cgi-bin/ "/home/nabil/cgi-bin/linux-hpc.org/"
</VirtualHost>


<VirtualHost 10.0.0.1>
ServerAdmin nabil@abuharbid.com
DocumentRoot /home/nabil/html/abuharbid.com
ServerName www.abuharbid.com
ServerAlias abuharbid.com *.abuharbid.com
AddHandler cgi-script .cgi
AddHandler cgi-script .pl
Alias /cgi-bin/ "/home/nabil/cgi-bin/abuharbid.com/"
ScriptAlias /cgi-bin/ "/home/nabil/cgi-bin/abuharbid.com/"
Redirect /email/ http://www.abuharbid.com/cgi-bin/neomail/neomail.pl
</VirtualHost>

<VirtualHost 10.0.0.1>
ServerAdmin nabil@freetech.org
DocumentRoot /home/nabil/html/freetech.org
ServerName www.freetech.org
ServerAlias freetech.org *.freetech.org
AddHandler cgi-script .cgi
AddHandler cgi-script .pl
Alias /cgi-bin/ "/home/nabil/cgi-bin/freetech.org/"
ScriptAlias /cgi-bin/ "/home/nabil/cgi-bin/freetech.org/"
ErrorLog /home/nabil/freetech.org/log/httpd/error_log
TransferLog /home/nabil/freetech.org/log/httpd/access_log
</VirtualHost>
####################

Every else in httpd.conf is irrelevant....

This setup will allow you to run apache for multiple sites using same IP.
 
Old 06-19-2001, 05:28 PM   #11
rebby
LQ Newbie
 
Registered: Apr 2001
Location: Hugo, MN
Distribution: Slackware, RedHat
Posts: 24

Rep: Reputation: 15
nabil,
that is a good example however you could simplify your virtualhost tags some by putting the common things in the global config section... however, that is a good example and like you pointed out - this does not work for ssl...

there are ways around that though but they require an http splash page...
 
Old 06-19-2001, 05:58 PM   #12
nabil
Member
 
Registered: Feb 2001
Location: MI, USA
Distribution: Debian Linux 100% GNU
Posts: 210

Rep: Reputation: 31
rebby,

Thanks for your comments, but I think I tried some of that before and did not have time to debug why it did not work. Anyway: I like to know a little more about that work-around for the splash page setup for using SSL on mutiple IP's....Would you kindly post some info in reference to that.
 
Old 06-20-2001, 07:58 AM   #13
rebby
LQ Newbie
 
Registered: Apr 2001
Location: Hugo, MN
Distribution: Slackware, RedHat
Posts: 24

Rep: Reputation: 15
Quote:
Originally posted by nabil
rebby,

Thanks for your comments, but I think I tried some of that before and did not have time to debug why it did not work. Anyway: I like to know a little more about that work-around for the splash page setup for using SSL on mutiple IP's....Would you kindly post some info in reference to that.
sure...

first setup your dns like this ->
  • site1.net -> 192.168.1.1
  • site2.net -> 192.168.1.1
  • site3.net -> 192.168.1.1
  • etc...

now you want to create your key. make sure that it is very general (ie: your business and not site specific). it is best to have a verified key for this but if you just want ssl it doesn't matter. having one key for all sites is the big draw back here

now setup domain name based virtual hosts (as seen above).

in the document root of each site put your splash page or redirect (meta tag, javascript, etc.).

the link off of the splash/redirect should be to a page in the document root of the ssl site.

for example
because the ssl enable site can't do virtual hosts by domain name the site name does not matter... therefore, https://site1.net/page/ is the same as https://site2.net/page/ so be sure to use seperate directories for each site...

it's kind of a ghetto hack but it works pretty good and gets the job done w/out using a ton of ip's (some of us are limited to very few).

Last edited by rebby; 06-20-2001 at 08:02 AM.
 
Old 06-20-2001, 03:34 PM   #14
Ricardo77uk
Member
 
Registered: Jun 2001
Location: London England
Distribution: Suse 7.1
Posts: 45

Original Poster
Rep: Reputation: 15
Question Cheers Guys

I found all of the above useful and the config i posted above works really well! Cheers all!

Rebby, You mentioned DNS, i am currently putting all of my IP's and Domain names in the 'Hosts' File, Is this Linux's DNS or is there another way or file?


Both of my SSL sites work perfectly on the Linux Box, does this mean they will work ok remotely?
 
Old 06-20-2001, 03:47 PM   #15
Ricardo77uk
Member
 
Registered: Jun 2001
Location: London England
Distribution: Suse 7.1
Posts: 45

Original Poster
Rep: Reputation: 15
Yep Nabil, I need multiple IP's for SSL Virtual Hosts. My Current Httpd.conf almost mirrors yours and allows me to make a HTTPS connection on 2 different Virtual Sites.

only i had to name the secure sites to:

secure.site1.com
secure.site2.com

with non-ssl virtual host entries for:

site1.com
site2.com

Could anybody be kind enough and post their Httpd.conf which has SSL V-Hosts setup?

Cheers
 
  


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
Balancing multiple connections over same interface mailmaldi Linux - Networking 5 08-25-2005 04:07 PM
Firewire disc adds multiple devices to kernel 2.6 (sda, sdb, .. , sdh) mehlkelm Linux - Hardware 2 04-18-2005 08:54 AM
Adding Multiple Ips to 1 Interface kemplej Slackware 1 12-27-2004 09:18 AM
Multiple Interface routing question kongfused Linux - Networking 2 07-01-2003 07:53 AM
multiple ips, multiple gateways, one interface drpixel Linux - Networking 6 12-04-2002 12:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:54 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
Open Source Consulting | Domain Registration