AFP548 Changing the world one server at a time.

Apache, Performance Cache and trailing slashes

Home › Forums › OS X Server and Client Discussion › Web › Apache, Performance Cache and trailing slashes

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #361408
    Sean Howard
    Participant

    I remember an old thread discussing this with people recommending editing the httpd.conf file by hand. We recently disabled the Performance cache and I decided I would share what we did. So I can learn better ways and to help others who are having the same challenge.

    Challenge: With the performance cache that ships with OSX one must always specify the trailing slash on any directory or the user gets redirected to port 16080 and hangs

    Potential solutions: Open up port 16080 in the firewall (not very professional in our opinion)

    or…

    Disable the performance cache.

    Toggling the Performance Cache checkbox in the Server Admin options under a website does not solve the problem. Sites appear to still be routed through the cache, but it’s more like a proxy now.

    What we did:
    First, we were using virtual domains.

    So we made a copy of the sites folder in /etc/httpd/ This is where all of our virtual domain .conf files were stored

    cd /etc/httpd/
    cp -pR sites sites_22apr05_16080

    Then I went into the sites folder and edited each file, changing the entry at the top from :16080 to :80

    cd sites
    vi 0001_…
    :%s/16080/80/g
    :wq

    So now Apache will direct those virtual domains to port 80. Now we just had to stop the performance cache from listening on port 80. We gave up on attempting to control it via SystemStarter and took the poor mans solution.

    cd /usr/sbin/
    mv webperfcache webperfcache_disabled
    mv webperfcachectl webperfcachectl_disabled

    Then we rebooted the server and the slash is no longer required. And we no longer have a performance cache.

    IMPORTANT: If you follow these steps, you can never use Server Admin again to edit your sites or they will be re-written for port 16080. And I can’t guarantee you won’t affect or break something else. We appear to be stable at this stage. Cyrus and apache appear to be running fine.

    #361415
    Sean Howard
    Participant

    GAH!!!

    lol.

    Well, at least I now know. 😉

    Thanks Joel.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.