LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Two Web servers, Two MySqls in one Linux box Apache Centos (https://www.linuxquestions.org/questions/linux-newbie-8/two-web-servers-two-mysqls-in-one-linux-box-apache-centos-861517/)

rewards 02-08-2011 08:48 PM

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

gilead 02-08-2011 09:12 PM

Sounds like you want to configure virtual hosts. Are you using Apache 2.0 or Apache 2.2 (or even 1.3)?

paulsm4 02-08-2011 09:24 PM

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

rewards 02-08-2011 11:17 PM

I have Apache 2.2.3. I installed Centos and installed all the updates.

rewards 02-10-2011 10:46 AM

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.

gilead 02-10-2011 12:54 PM

The link I provided above gives both name based and IP based virtual hosting instructions

rewards 02-13-2011 03:57 PM

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?

gilead 02-13-2011 05:17 PM

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.

rewards 02-14-2011 12:57 PM

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.

rewards 02-18-2011 02:59 PM

Anyone can help me please?

gilead 02-18-2011 04:07 PM

Your question about setting up custom DynDNS accounts is best answered at DynDNS here and here since it's not just about Linux

rewards 02-18-2011 05:29 PM

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/

rewards 02-20-2011 02:21 AM

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>


All times are GMT -5. The time now is 05:15 AM.