Showing posts with label mySQL. Show all posts
Showing posts with label mySQL. Show all posts

Wednesday, August 09, 2017

Docker and Apple Server Service: How to use ports 80 and 443 on Mac OS X

Introduction

I was trying to deploy some Docker containers yesterday which use ports 80 and 443. OK, I will confess that I was trying to deploy Wordpress or Bitnami Wordpress and MySQL to containers to see if I could migrate my personal blog to Wordpress. Eventually, I am hoping to migrate all of my blogs to a new blogging environment.

Problem

Well the containers would not deploy because the ports 80 and 443 were being used. A quick connection to localhost confirmed that the Apple Server.app was using these ports for running its processes. So I logged into the Server.app only to discover no way to turn it off.

Solution

Apple Server.app service is simply that... a service. The launchctl command will allow us to stop and start services. So I tried to stop the service only to discover it will automatically restart on a new PID. The only solution apparently is to unload the service temporarily. The following commands will allow you to unload and load the com.apple.serviceproxy service, and check its status. This will allow you to use Docker containers on those ports while doing your development and testing.

Thursday, July 10, 2014

Creating a BLOB Image Table

I am going through some old code while I wait for my Windows VM to update. I came across some code to create an image BLOB table on MySQL. I thought I would publish it before deleting it from my system. It might be helpful to someone.

CreateImagesTable.java


Saturday, June 25, 2011

CIO Magazine: 5 Things You Need to Know MySQL

MySQLImage via Wikipedia
There is a nice five point things you need to know article about MySQL in CIO Magazine. The number one item is "Rumors of its demise have been greatly exaggerated". Check out the brief article for other interesting bits.
Enhanced by Zemanta

Monday, August 02, 2010

MySQL Sunday | Oracle OpenWorld 2010

Duke, the Java Mascot, in the waving pose. Duk...Image via Wikipedia
MySQL Sunday | Oracle OpenWorld 2010 I wish there was more time at JavaOne. There are so many events going on at the same time that it makes it hard to decide which ones to attend. On Sunday alone, there are two major events: MySQL Sunday, and Java User Groups Sunday. Since I am a speaker at Java User Groups Sunday, and one of the Java User Groups community leaders, I must attend our event. However, l wish I could attend this event too.

Later in the evening, the GlassFish community is going to meet for an unconference and probably a few beverages. The Java User Groups Leaders are having a dinner at the same time across town. Could I clone myself: johnyeary.clone();? I want to attend both. My luck the OpenJDK folks will meet Sunday night too.

This is going to be a different JavaOne. It will be the first since the acquisition of Sun by Oracle. I am curious how it is going to compare to past JavaOne events.

My favorite JavaOne was 2005 with the release of Java SE and EE 5 along with GlassFish. Is this going to be one to remember?
Enhanced by Zemanta

Saturday, June 26, 2010

Drupal 6 on GlassFish 3 with Quercus using NetBeans 6.9 in less than 5 minutes

This is an update to my previous blog post on using Drupal on GlassFish with Quercus. Since I have been writing blog posts I have found that it is important to distinguish which versions of software I am using.

Software
Mac OS X 10.6.4
MySQL 5.1.48
MySQL Connector/J 5.1.12
NetBeans 6.9
GlassFish 3.0.1
Drupal 6.17
Quercus 4.0.3

Database:
  1. Create the Drupal user in the database.


    GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON drupal.* TO 'drupal'@'localhost' IDENTIFIED BY 'drupal';

    Note: This is not secure and should only be used for demo.

  2. Create a new database in mySQL called drupal.


    create database drupal character set utf8;
Quercus:

Download and extract the quercus-4.0.3.war file.

jar -xvf quercus-4.0.3.war WEB-INF
 
Drupal:
  1. Download and extract Drupal 6.17
  2. Copy the WEB-INF directory and files from the Quercus into the Drupal directory.
MySQL Connector/J
  1. Extract mySQL Connector/J


    unzip mysql-connector-java-5.1.12.zip
  2. Copy the mysql-connector-java-5.1.12-bin.jar to the ../glassfish-3.0.1/glassfish/domains/domain1/lib/ext directory. This allows any project deployed to domain1 to connect to a mySQL server.

NetBeans
  1. Create a new project. Select Java Web and Web Application with Existing Sources. Click Next.



  2. Select the location of the files we previously extracted for the Location.
  3. Accept default project name.
  4. Change the project folder name to drupal. Click Next.



  5. Ensure GlassFish Server 3 is selected as the server.
  6. The Java EE version should be Java EE 6.
  7. Change the context path to /drupal. Click Next.



  8. Set the Web Pages Folder: to point to the top level of our sources. In our case it is drupal-6.17. Click Finish.



  9. Open the Web Pages -> sites -> default folder. You should see a file called default.settings.php. Copy the file and rename it to settings.php. Our application configuration is complete.






  10. Go to the Services tab. Expand the Databases tree. Select MySQL Server. Right click and select Create Database from the context menu.
  11. Create a database called drupal. Check the checkbox for Grant Full Access To:. Pick the drupal@localhost user. Press OK.






  12. Click on the deploy button. After the application is deployed to GlassFish, you should see Drupal Configuration screen below.



  13. Select Install Drupal in English
  14. Set up the database configuration. In my case, I chose the mysqli radio button and provided database name: drupal, database username: drupal, and database password: drupal.

    Note: I had to fill in the information twice. DO NOT USE MY CONFIGURATION IN PRODUCTION.



  15. Fill in the site configuration parameters.




    Note: Once the site is deployed. I received an SMTP error as noted below. It seems that it can be safely ignored.



  16. Installation Complete.

Here is an example of what my finished site looks like.


If you want to watch a 5 minute video on the whole process, please check the link below.

Popular Posts