SquirrelMac

Q: Disable Apache Yosemite Server

Hi,

 

Is there any way to disable Apache in Yosemite Server?

 

Have done this in previous version of OSX, but command doesn't run as the location has changed.

 

Any help would be greatly appreciated.

 

Thanks

Darren

OS X Yosemite (10.10.5), null

Posted on Sep 29, 2015 3:46 AM

Close

Q: Disable Apache Yosemite Server

  • All replies
  • Helpful answers

Previous Page 2
  • by Strontium90,

    Strontium90 Strontium90 Oct 2, 2015 4:48 AM in response to SquirrelMac
    Level 5 (4,067 points)
    Servers Enterprise
    Oct 2, 2015 4:48 AM in response to SquirrelMac

    If you are using Server 5.0.4, I agree, Apple's claim to the web ports is a little aggressive.  If you are not using Profile Manager and you are not concerned about the web services, you can overcome this by disabling the ports in the service proxy config.  You have two options here.

     

    If Apple’s web interface is not needed and you are not using Profile Manager, reclaim those ports by editing the following file:

       

         /Library/Server/Web/Config/Proxy/apache_serviceproxy.conf 

     

    Comment or remove the following lines:

     

         listen 80

         listen 443

     

    To comment, simply add a # in front of each line.  Commenting out the lines is a better plan than deleting.  At least if you need to revert, you can simply remove the # character.  Reboot the server and now your 3rd party tools have access to the standard web ports.

     

    An alternative option is to multihome the Ethernet connection.  This way you can leave the primary interface attached to Apple’s services and run your third party tools on the secondary IP address.  If you do this, you will still need to edit the VirtualHost directives in the apache_serviceproxy.conf file.  Apple configured the service to listen on all interfaces.  You will find the following in the file by default:

     

         <VirtualHost *:80>

         <VirtualHost *:443>

     

    Change the * to the primary IP address of your server.  This will ensure that Apple’s services only listen on that IP address.  For example, let's say your server is currently at address 192.168.0.15. You can give it a second IP address by creating another Ethernet port in System Preferences.  In this example, 192.16.0.16.  Now the server will respond to both IP addresses.  Edit the service proxy file and set the VHost lines to:

     

          <VirtualHost 192.168.0.15:80>

         <VirtualHost 192.168.0.15:443>

     

    Once again reboot.  When you do, Apple's service proxy will only listen on address 192.168.0.15, allowing ports 80 and 443 to be used on the secondary address 192.168.0.16.  Now, you may have some DNS and port forwarding rules to modify but this will allow Apple's services (including Profile Manager) to run without surgery.

     

    Hope this helps.

     

    Reid

    Apple Consultants Network

    Author "El Capitan Server – Foundation Services" :: Exclusively available in Apple's iBooks Store

    Author of Yosemite Server and Mavericks Server books

  • by drumogge,

    drumogge drumogge Oct 7, 2015 1:23 PM in response to Strontium90
    Level 1 (0 points)
    Oct 7, 2015 1:23 PM in response to Strontium90

    I am experiencing the same issue with Server 5.0.4 & Kerio 8.5.2 .

     

    I chose the first of your suggestions and commented out "listen 80" & "listen 443" in /Library/Server/Web/Config/Proxy/apache_serviceproxy.conf and then rebooted.  twice.  Yet httpd persists.

     

    I have tried "sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist" (which has worked in the past) but now I get "No such file or directory".

     

    Because this is a mail server, I really don't want to use the VirtualHost solution and risk any potential DNS issues.  Any other ideas?  Many thanks!

  • by Strontium90,

    Strontium90 Strontium90 Oct 7, 2015 5:23 PM in response to drumogge
    Level 5 (4,067 points)
    Servers Enterprise
    Oct 7, 2015 5:23 PM in response to drumogge

    What appears when you use Safari on the machine and run:  http://localhost and http://localhost:443

     

    Try running this in the Terminal to determine what it running the port

     

    ps -ax | grep httpd

     

    Let's see what is running the service.  In the result, you should see the config file that is associated with the service.  For example, if you enabled web password reset, you might see this:

     

      479 ??         0:15.87 /usr/sbin/httpd -D FOREGROUND -f /Library/Server/Web/Config/apache2/services/auth.conf -E /var/log/apache2/services/auth_error_log

     

    Note the configuration file is auth.conf not the service proxy. 

     

    Reid

    Apple Consultants Network

    Author "El Capitan Server – Foundation Services" :: Exclusively available in Apple's iBooks Store

    Author of Yosemite Server and Mavericks Server books

  • by drumogge,

    drumogge drumogge Oct 8, 2015 12:08 PM in response to Strontium90
    Level 1 (0 points)
    Oct 8, 2015 12:08 PM in response to Strontium90

    I was able to resolve the issue by trashing Server App.  That effectively stopped all OS X services and Kerio can now use ports 80 & 443.

     

    Thanks for your help.

  • by mcelligott.nick,

    mcelligott.nick mcelligott.nick Jul 25, 2016 9:20 PM in response to drumogge
    Level 1 (4 points)
    Jul 25, 2016 9:20 PM in response to drumogge

    I'm on El Capitan but seem to have found the solution, I ran `ps -ax | grep httpd` and found this file: `/Library/Server/Web/Config/Proxy/apache_serviceproxy.conf`

     

    Editing that file and commenting the Listen for 80 and 443 will stop it from restarting. Then run `sudo killall httpd` to kill existing services and it should work.

  • by bigtoe,

    bigtoe bigtoe Aug 11, 2016 12:53 PM in response to SquirrelMac
    Level 1 (24 points)
    Aug 11, 2016 12:53 PM in response to SquirrelMac

    I resorted to commenting out some lines in /Library/Server/Web/Config/Proxy/apache_serviceproxy.conf, killall httpd and the ports are no longer 'stolen'.

Previous Page 2