LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 02-08-2011, 09:48 PM   #1
rewards
Member
 
Registered: Dec 2010
Posts: 135

Rep: Reputation: 0
Question Two Web servers, Two MySqls in one Linux box Apache Centos


Hello all,
I am running a Linux Centos on the local network. The Apache and Mysql services are running on this Linux box. I can access the site by putting 192.168.0.22 in the browser from other computers in the network with no problem. Now I want to run another site in the same Linux box by assigning a virtual IP address, Apache and another Mysql and don't know how to. Basically, I want to run two web servers accessible in the same network in one Linux box. Any help is appreciated.

Thank you all
 
Old 02-08-2011, 10:12 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 164Reputation: 164
Sounds like you want to configure virtual hosts. Are you using Apache 2.0 or Apache 2.2 (or even 1.3)?
 
Old 02-08-2011, 10:24 PM   #3
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
For whatever it's worth, you probably want:

1. Apache:
a) One instance of Apache
b) One "default" server, and one "virtual" server
<= they'll look to the end-user as two completely separate sites
c) It's common practice to configure the virtual server by name (rather than by IP)
d) In either case, you'll probably want DNS, too

2. MySQL:
a) again: you're probably better off with *one* instance
b) simply create multiple databases
c) if, for whatever reason, you indeed want multiple instances of MySQL co-located on the same server, then
d) you'll need to run them on different ports, and (slightly) tailor your default configuration
 
Old 02-09-2011, 12:17 AM   #4
rewards
Member
 
Registered: Dec 2010
Posts: 135

Original Poster
Rep: Reputation: 0
I have Apache 2.2.3. I installed Centos and installed all the updates.

Last edited by rewards; 02-09-2011 at 01:35 AM.
 
Old 02-10-2011, 11:46 AM   #5
rewards
Member
 
Registered: Dec 2010
Posts: 135

Original Poster
Rep: Reputation: 0
How can i configure the virtual server by name rather than by IP, Apache and DNS? Can anyone tell me step by step where to go and make such changes? Thank you all.
 
Old 02-10-2011, 01:54 PM   #6
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 164Reputation: 164
The link I provided above gives both name based and IP based virtual hosting instructions
 
Old 02-13-2011, 04:57 PM   #7
rewards
Member
 
Registered: Dec 2010
Posts: 135

Original Poster
Rep: Reputation: 0
I have done the Apache part. Could someone tell me how to configure the DNS stuff? I have to assign the virtual IP address too correct? How virtual ip/server can be assigned?
 
Old 02-13-2011, 06:17 PM   #8
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 164Reputation: 164
Are you talking about your own DNS server or the dyndns stuff?

If you're using http and not https (SSL), then you can do it with name based virtual hosts and one IP address. In which case just set up custom entries for both domains on dyndns and have them point to the IP address of your router.
 
Old 02-14-2011, 01:57 PM   #9
rewards
Member
 
Registered: Dec 2010
Posts: 135

Original Poster
Rep: Reputation: 0
Thank you for your response. Yes I am using http. Could you tell me step by step how to set up custom entries for both domains on dyndns and have them point to the IP address of my router? I am very new to Linux. This will be in a local network behind the router. Thank you.
 
Old 02-18-2011, 03:59 PM   #10
rewards
Member
 
Registered: Dec 2010
Posts: 135

Original Poster
Rep: Reputation: 0
Anyone can help me please?
 
Old 02-18-2011, 05:07 PM   #11
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 164Reputation: 164
Your question about setting up custom DynDNS accounts is best answered at DynDNS here and here since it's not just about Linux
 
Old 02-18-2011, 06:29 PM   #12
rewards
Member
 
Registered: Dec 2010
Posts: 135

Original Poster
Rep: Reputation: 0
The server I am trying to put together is at home behind the router for testing purposes only. Do I still need this?


http://www.dyndns.com/services/dns/custom/
 
Old 02-20-2011, 03:21 AM   #13
rewards
Member
 
Registered: Dec 2010
Posts: 135

Original Poster
Rep: Reputation: 0
Hello all,

MySQL is configured correctly and running. I managed to do one web server. I also managed to configure one virtual IP address by typing: cd /etc/sysconfig/network-scripts and cp ifcfg-eth1 ifcfg-eth1:1. Assigned static IP address to eth1 192.168.0.182 and 192.168.0.183 on eth1:1 with respective subnetmask 255.255.255.0 and default gateway 192.168.0.1. In /var/www/html, I have two folder called server1 and server2. These two folders have the necessary files and folders to run the apache webservers. I launched the sript from the browser http://192.168.0.182/install and installed the script on one webserver successfully however when I try to launch the browser to install other server script http://192.168.0.183/install nothing happens. The connection gets timed out. Can anyone tell me what am I missing here? Thank you all.


Here is the httpd configuration is below now and I have tried putting IP addresses into <VirtualHost 192.168.0.182> and no success:

<VirtualHost *>
DocumentRoot /var/www/html/server1
ServerName development.mysite.com
</VirtualHost>

<VirtualHost *>
DocumentRoot /var/www/html/server2
ServerName development.mysite.com
</VirtualHost>
 
  


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
CentOS 5.5 box unable to access a live web service on the Interwebs gr33d Linux - Networking 4 10-27-2010 05:36 PM
[SOLVED] Apache Virtual Servers (CentOS 5.5) dstu Linux - Software 7 09-21-2010 05:43 AM
Mail/ftp/web servers, on VIRTUAL!! dedicated server. Also resource usage. Centos 5. newn Linux - Software 4 07-08-2010 03:55 PM
Web Load Balancing (apache+heartbeat+ldirector) : Unable to connect to real servers dipakbiswal Linux - Networking 1 11-08-2009 05:34 AM
How does my CentOS box determine its name servers? Will they change? sneakyimp Linux - Newbie 2 10-23-2007 03:14 AM


All times are GMT -5. The time now is 08:25 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