The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to migrate from apache 1.3 to apache 2.2?

Discussion in 'EasyApache' started by anton_latvia, Nov 21, 2007.

  1. anton_latvia

    anton_latvia Well-Known Member
    PartnerNOC

    Joined:
    May 11, 2004
    Messages:
    348
    Likes Received:
    3
    Trophy Points:
    18
    Location:
    Latvia
    cPanel Access Level:
    Root Administrator
    Hi,
    My problem is simple and short. So i won't speak long. We run apache 1.3 and would like to upgrade to apache2.2. easyapache3 works fine, except one thing. In httpd.conf we have lots of custom entries and after compilation finished, httpd.conf gets overwritten. So what should I do prior the upgrade to keep all custom entries in place? Different VirtualHosts might have different settings (most of them are RewriteRules).

    I am sorry, if I am repeating some other thread, but I haven't found any information regarding this with "search" function...

    Anton.
     
  2. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,383
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Take a look at my last reply in the thread at:

    http://forums.cpanel.net/showthread.php?t=72710

    This might help you. Though the post talks mostly about suphp configurations, the same came be applied to mod_rewrite rules. I'm not sure if this is the correct way to approach this, but it is the way I am approaching it on our one server that is using an Apache 1.3 compiled from EA3 (we have a lot of different servers and want to get a firm understanding of the new system before applying it to all of the servers).

    I would recommend keeping a copy of your current httpd.conf file before you upgrade to Apache 2.2. I would also get a list of what VirtualHosts have custom settings in the pre-Apache 2.2 httpd.conf file. Then once you upgrade to Apache 2.2 apply those customizations using the directory structure and steps as detailed in the above post.

    Again, I don't know if this is the correct way to accomplish this, but it does seem to work.
     
  3. anton_latvia

    anton_latvia Well-Known Member
    PartnerNOC

    Joined:
    May 11, 2004
    Messages:
    348
    Likes Received:
    3
    Trophy Points:
    18
    Location:
    Latvia
    cPanel Access Level:
    Root Administrator
    I saw your post and that means I would have to go manually and apply changes for each website... This sounds terrible, as during this time websites will stop working. Any more or less automatical way? What if I just copy-paste all <VirtualHost> sections from old httpd.conf to the new one?

    Question number two: how can I disable distiller-thing, disable httpd.conf regeneration? We don't want that on some servers.

    Anton.
     
  4. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,383
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    How many VirtualHosts do you have customized settings for?

    Just do the includes before you do the Apache upgrade.

    Create a directory on the server, for example:

    mkdir -p /root/userdata

    Now create the directory structure for each virtual host in that temporary userdata directory:

    mkdir -p /root/userdata/std/2/username1/domain1.com
    mkdir -p /root/userdata/std/2/username2/domain2.com
    ...


    Then create the necessary files for each VirtualHost, using the pre-Apache2.2 httpd.conf as a map.

    /root/userdata/std/2/username1/domain1.com/rewrites.conf
    /root/userdata/std/2/username2/domain2.com/rewrites.conf


    One thing I would recommend, if you are not already do so, when you create these rewrites.conf files be sure that you include the relevant <IfModule> container:

    <IfModule mod_rewrite.c>
    ...
    </IfModule>


    This way, if for some reason mod_rewrite does not compile when you upgrade Apache, your rewrites won't work, but it won't completely kill your Apache set up.

    Then once you have upgraded to Apache 2.2, just copy or move this userdata directory to the httpd directory:

    cp -r /root/userdata /usr/local/apache/conf

    Finally, tell Apache to apply this to all of the affected usernames:

    /scripts/ensure_vhost_includes --user=username1 --user=username2...

    Is this tedious? You bet. Is there another way around this? I have no idea, someone can feel free to chime in if they know of another way to do this.


    As for disabling the distiller settings with the new EA3, I don't know if you can do that either. Personally, I'm like you, I'm not sure I see the whole point for having this new set up. But just because I don't understand why its in place doesn't mean that its going to disappear any time soon. From what I have gathered, the new system is in order to prevent users from really messing up the Apache configuration. I'm not really sure why this is the case. You either understand Apache configurations or you don't. If you don't, then you don't need to be making changes to the Apache configuration anyway. If you do understand Apache configurations, but are making extensive changes, one would hope that you would create a backup copy of the httpd.conf file prior to making any changes, to use as an emergency fall back. If you make a change to the httpd.conf file and Apache does not restart after that change, then common sense would tell you to go back into the file and reverse the changes you just made in order to get it working again.

    I'm not all that thrilled with this new EA3 set up either, but I am assuming that there is a specific reason for doing this and I'm just not aware of that reason.
     
Loading...

Share This Page