Showing posts with label OS X. Show all posts
Showing posts with label OS X. Show all posts

Thursday, May 19, 2016

How do I enable rndc on Mac OS X El Capitan (10.11.5)

So I was trying to figure out how to enable rndc on El Capitan so I could dump the DNS cache to check name resolution. I could run the command from the command line, but alas it would indicate that it was not listening on port 953. I tried the alternate port 54, but again to no avail. As it turns out, I needed to modify the named.conf file controls section to get it to work. The named.conf file is located at /Library/Server/named/named.conf. You will need to modify it as the super user using sudo.

Note: I have the Apple Server Application installed

sudo nano /Library/Server/named/named.conf


The existing file should have a controls section that looks similar to the one below.

controls {
        inet ::1 port 54 allow {
                "any";
        } keys {
                "rndc-key";
        };
};

I added the following inet 127.0.0.1 allow {localhost;};. So now the configuration looks like:

controls {
        inet 127.0.0.1 allow {localhost;};
        inet ::1 port 54 allow {
                "any";
        } keys {
                "rndc-key";
        };
};


You will need to restart named service using the following commands.

sudo launchctl stop org.isc.named
sudo launchctl start org.isc.named

You should be able to use rndc. To check, you can issue the following command:

sudo rndc status

version: 9.9.7-P3 
CPUs found: 8
worker threads: 8
UDP listeners per interface: 4
number of zones: 100
debug level: 0
xfers running: 0
xfers deferred: 0
soa queries in progress: 0
query logging is OFF
recursive clients: 0/0/1000
tcp clients: 0/100
server is up and running

Sunday, February 26, 2012

OpenJDK 7 on Apple G5 PowerPC on Mac OS X 10.5.8

Apple G5 Power Mac

  • Are you an Apple G5 owner feeling a little left out by Apple?
  • Do you have a very expensive and capable piece of hardware which can still be a valuable and fashionable?
  • Do you develop applications in Java, or run applications based on Java and feel left behind?

I have a solution for you! Use OpenJDK BSD Port!

Using a build script sent to me by Kurt Miller, build recommendations from Kelly O'Hair, and the great work of the BSD Port team... I created a new build of OpenJDK 7 for my PPC based system using the Zero VM.

The results are fantastic. I can run GlassFish 3.1.1 along with all my enterprise applications.

GlassFish 3.1.1 on Zero VM
Well it wouldn't be me if I didn't share my good fortune. I updated the Darwin9Build page for OpenJDK to demonstrate how to build OpenJDK for yourself. There are also links to the binaries too.

Here is the link: Darwin9Build


Saturday, January 07, 2012

Using Apache HTTPD (Web Server) mod_proxy with GlassFish and Mercurial

I wrote an article on how to use Secure Mercurial in GlassFish using SSL a few weeks ago. After the article was published, I was asked about URL rewriting. I had not really messed with it in the past except with PrettyFaces (which works like a champ for reference).

I tried a framework called Url Rewrite Filter which did a decent job of rewriting URLs. It is a simple library added to your project which uses a servlet filter to handle the URL re-writing. Add the filter to the web.xml, and a urlrewrite.xml which handles the rewrites. It works much in the same manner as PrettyFaces, but is targeted at JSP/Servlets.

In my case, I have an Apple G5 PPC which is the main server for my source repository for Mercurial. This presents some challenges since the Java version is limited to 1.5, and therefore GlassFish can't be upgraded to v3 from v2.1.1. I did manage to get GlassFish v3 to run with OpenJDK 1.7 (BSD Port), but the Zero VM is too slow to handle the load. Kurt Miller has a couple of the builds for Mac PPC There are a number of reasons for my interest, the primary one for URL rewriting is that GlassFish v3 supports AJP out of the box.

Enabling JK Listener (mod_jk)

Using GlassFish v3 would provide a more optimal solution as you can see from the administration console. I decided to try using the mod_jk articles I found for GlassFish v2 from Amy Roh: GlassFish supports configurable AJP Connector and Jean-Francois Arcand's Running GlassFish with Apache httpd.  I tried to combine these with mod_proxy and mod_proxy_ajp. The articles are focused on a specific build, and I was unsuccessful in using them. I am sure it has to framework versions, but I did not want spend too much time troubleshooting.

Finally, I tried using a simple mod_proxy arrangement along with mod_rewrite. This arrangement was surprisingly easy to configure, and worked the first time I tried it.

Here is the configuration I used:

httpd.conf



httpd-vhosts.conf


Those simple changes allowed me to rewrite the URL, and open only two ports on my firewall 80 and 443 which are a very good arrangement. As noted in Secure Mercurial in GlassFish using SSL, I am using GlassFish SSL and security to handle my authentication so this is truly a very good solution.
Mercurial Repositories

Wednesday, January 04, 2012

OpenJDK 1.7 with NetBeans 7.1 RC on Mac OS X 10.7

A question was posed to me the other day on how to use OpenJDK 1.7 on NetBeans on a Mac since there is only a Developer Preview available. I decided that a video does a better explanation. This applies to NetBeans 6+ as well when using JDK 7 on a default platform of JDK 6.



Tuesday, May 31, 2011

Mac OS X Java launchd (inetd) Applications

While I was creating my daemon examples for my previous blog entry, I created a plist file for executing launchd based applications. The convention is to name the plist file to match the name of the main application. In this example, it is com.bluelotussoftware.examples.Daemon. Place the file int the ~/Library/LaunchAgents directory.
Here is the file: com.bluelotussoftware.examples.Daemon

com.bluelotussoftware.examples.Daemon


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN
http://www.apple.com/DTDs/PropertyList-1.0.dtd >
<plist version="1.0">
    <dict>
        <key>Label</key>
        <string>com.bluelotussoftware.examples.Daemon</string>
        <!-- Program key is not necessary for Java -->
        <!--
        <key>Program</key>
        <string>/usr/bin/java</string>
        -->
        <key>ProgramArguments</key>
        <array>
            <string>/usr/bin/java</string>
            <string>-jar</string>
            <!-- MODIFY THIS TO POINT TO YOUR EXECUTABLE JAR FILE -->
            <string>/Users/jyeary/Desktop/JavaDaemonExample.jar</string>
        </array>
        <key>OnDemand</key>
        <true/>
        <key>RunAtLoad</key>
        <false/>
        <key>KeepAlive</key>
        <false/>
        <!-- MODIFY FOR YOUR ENVIRONMENT -->
        <key>StandardErrorPath</key>
        <string>/Users/jyeary/Desktop/err.log</string>
        <key>StandardOutPath</key>
        <string>/Users/jyeary/Desktop/out.log</string>
        <key>WorkingDirectory</key>
        <string>/Users/jyeary/Desktop</string>
    </dict>
</plist>

Saturday, July 31, 2010

OpenJDK 7 64-bit Mac

I updated the Darwin10Build instructions for building the BSD port of OpenJDK 7 on the OpenJDK wiki at Oracle. I successfully built 32-bit binaries, but decided to see if I could get it to build 64-bit binaries by changing the ARCH_DATA_MODEL=64 parameter to the build script. It worked. It reports that the build is amd64, but it is running on a MacBook Pro Intel Core Duo system. I added my 64-bit build script to the Darwin10Build instructions. Here is an image of my 64-bit build running tomcat. You can see the build is listed 1.7.0-internal-jyeary, and the OS Architecture amd64.


Enhanced by Zemanta

Thursday, July 08, 2010

Mac OS X Leopard/Snow Leopard Web Sharing Forbidden Issues

Forbidden
You don't have permission to access /~username/ on this server.

Have you received an error like the one above, then I may have the solution for you. There are a number of posts on the web around permissions, and Apache configuration files, etc. I found that the solution was really simple, yet not obvious.

It has to do with File Sharing, you need to add the Sites directory to the list of directories which are shared, even if sharing is not turned on. See the example below.


Once you add the Sites directory to the list and turn on Web Sharing, you should be able to see the local sites for users on the local system.

Monday, December 14, 2009

OS X "Dirty Dot"

To use the OS X "Dirty Dot" to indicate that changes have been made that need to be saved you can use the code snippets below.

To set this "Dirty Dot" use the following code:
myJFrame.getRootPane().putClientProperty("windowModified", Boolean.TRUE);

Use the following line to clear the dot after a save has occurred:
myJFrame.getRootPane().putClientProperty("windowModified", Boolean.FALSE);

Java library search order OS X

Per the Apple documentation, the Java library search order is as follows:
  1. User's home directory (~/Library/Java/Extensions/)
  2. Local domain (/Library/Java/Extensions/)
  3. Network domain (/Network/Library/Java/Extensions/)
  4. System domain (/System/Library/Java/Extensions/)
  5. $JAVA_HOME/lib/ext

You'll note that the user's home directory takes precedence over the other locations; this helps a developer working on a system to easily share a machine with other users and avoid classpath difficulties.

Thursday, November 02, 2006

Subversion 1.3.2 Build Configuration (OS X)

Here are the parameters I used to install subversion on OS X.

./configure --with-ssl --with-libs=/usr/include/ssl --enable-maintainer-mode --enable-javahl --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr --with-zlib --with-editor=/usr/bin/pico --with-apxs=/usr/local/apache2/bin/apxs --with-jikes=no --with-junit=/Users/jyeary/Library/Java/PrivateExtensions/junit-4.1 --with-jdk=/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home

Please note that I have the junit libraries stored in an alternate location.

Tuesday, October 31, 2006

Netbeans 5.5 Enterprise Pack Failure on OS X

I completely removed Netbeans including all directories in my home folder. I also removed glassfish and started with a complete new installation.

Once I performed the installation, everything worked as it was supposed to do. The only difference between this install and the previous installations was that I downloaded updates to the IDE after installing and before I installed the Enterprise Pack.

I could not reproduce which I could do consistently two days ago. I have installed the updates and it continues to work. I closed the issue on Issuezilla.

This was very strange.

Popular Posts