{"id":819,"date":"2011-07-18T01:53:39","date_gmt":"2011-07-18T06:53:39","guid":{"rendered":"http:\/\/yourLinuxGuy.com\/?p=819"},"modified":"2011-07-19T05:55:36","modified_gmt":"2011-07-19T10:55:36","slug":"how-to-add-a-second-apache2-instance-to-a-sles11-server","status":"publish","type":"post","link":"https:\/\/yourLinuxGuy.com\/?p=819","title":{"rendered":"How to add a second Apache2 instance to a SLES11 server?"},"content":{"rendered":"<p>I recently got this question from reader <em>Niyati<\/em>:<\/p>\n<p><em>&#8220;Can you please guide for installing apache separately without disturbing the current version on sles.. if doing that risks the support issues.. Or any workaround to get the latest release running on sles server.&#8221;<\/em><\/p>\n<p>I&#8217;ll bravely say this with 99% certainty:\u00a0 Running a second instance of Apache on a SLES server should not compromise your support; especially if you keep it 100% separate.\u00a0 Besides, if a support person complains, you can always just remove the second instance.<\/p>\n<p>Anyway, here&#8217;s a way to install the latest good version of Apache2 (at the time of this writing) on a SLES 11sp1 server that *already* has a SLES-provided Apache2 instance running on it (installed via <code>zypper<\/code>).<\/p>\n<p>I&#8217;m going to run this second instance of Apache on a secondary address, rather than an alternate set of ports; so, I need to bind that secondary IP address.\u00a0 In my case, my machine is <code>192.168.1.23\/24<\/code>, and my interface is <code>eth0<\/code>, so I&#8217;ll add <code>.24<\/code> for my new instance in real time, like this:<\/p>\n<p><code>ifconfig eth0:1 192.168.1.24\/24<\/code><\/p>\n<p>Now, since I&#8217;m going to &#8220;build my own&#8221; Apache, rather than using a pre-built binary (for various reasons), I need to make sure I have the needed support software for compiling and such:<\/p>\n<p><code>zypper in gcc gcc43 glibc-devel linux-kernel-headers<\/code><\/p>\n<p>And it&#8217;s time to get the new Apache2 bundle:<\/p>\n<pre>mkdir \/tmp\/apache;cd \/tmp\/apache\r\ntar zxvf httpd-2.2.19.tar.gz\r\nwget http:\/\/www.alliedquotes.com\/mirrors\/apache\/\/httpd\/httpd-2.2.19.tar.gz\r\ncd httpd-2.2.19\/<\/pre>\n<p>And to get it installed:<\/p>\n<p><code>.\/configure<br \/>\nmake<br \/>\nmake install<br \/>\n<\/code><br \/>\nNote that since I didn&#8217;t specify the installation prefix, it got placed into <code>\/usr\/local\/apache2<\/code>; so we go there to make some tweaks:<\/p>\n<p><code>cd \/usr\/local\/apache2\/conf<br \/>\nvi httpd.conf<\/code><\/p>\n<p>We need to change the <code>Listen<\/code> statement to reflect the secondary address, like this&#8230; Change:<\/p>\n<p><code>Listen 80<\/code><br \/>\n&#8230;to&#8230;<br \/>\n<code>Listen 192.168.1.24:80<br \/>\n<\/code><br \/>\nOf course, there&#8217;s a ton more you can do with it, but this will get it up and running.<\/p>\n<p>Now, if your *other* instance of Apache is consuming all configured addresses, you&#8217;ll need to limit it to just the original IP address rather than <code>0.0.0.0<\/code>.<\/p>\n<p><code>vi \/etc\/apache2\/listen.conf<\/code><\/p>\n<p>Change:<\/p>\n<p><code>Listen 80<\/code><br \/>\n&#8230;to&#8230;<br \/>\n<code>Listen 192.168.1.23:80<\/code><\/p>\n<p>Now restart the original instance:<\/p>\n<p><code>rcapache2 restart<\/code><\/p>\n<p>&#8230;and a <code>netstat -patune<\/code> should show <code>192.168.1.23:80<\/code> instead of <code>0.0.0.0:80<\/code><\/p>\n<p>Now restart the new instance:<\/p>\n<p><code>\/usr\/local\/apache2\/bin\/apachectl start<\/code><\/p>\n<p>&#8230;and a <code>netstat -patune<\/code> should show both <code>192.168.1.23:80<\/code> (for the original instance) and <code>192.168.1.24:80<\/code> (for the new instance).<\/p>\n<p>And with that, you&#8217;re up and running with two instances!\u00a0 You can edit the content of your old instance in <code>\/srv\/www\/htdocs<\/code>, and the new instance content in <code>\/usr\/local\/apache2\/htdocs\/<\/code>.<\/p>\n<p>Now, of course I&#8217;m not covering how to automate the startup, or to add SSL, or anything else; I&#8217;ve covered those things and many others here in this blog in the past.\u00a0\u00a0 Besides, those things are relatively easy to find around the &#8216;Net&#8230; Just like you found this.<br \/>\n\ud83d\ude09<\/p>\n<p>Enjoy!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently got this question from reader Niyati: &#8220;Can you please guide for installing apache separately without disturbing the current version on sles.. if doing that risks the support issues.. Or any workaround to get the latest release running on&#8230;<br \/><a class=\"read-more-button\" href=\"https:\/\/yourLinuxGuy.com\/?p=819\">Read more<\/a><\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[12,44,59],"tags":[],"class_list":["post-819","post","type-post","status-publish","format-standard","hentry","category-advanced","category-apache","category-sles11"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pnjn1-dd","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/posts\/819","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=819"}],"version-history":[{"count":14,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/posts\/819\/revisions"}],"predecessor-version":[{"id":834,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/posts\/819\/revisions\/834"}],"wp:attachment":[{"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=819"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=819"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=819"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}