Build Apache + Tomcat + Pebble locally on Mac

About

It is a memorandum because I set Apache as a university assignment, made it SSL, and started Pebble from Tomcat linked with Apache. I will omit the Apache settings and local SSL. By the way, I described SSL conversion in the following article. https://qiita.com/Raluer/items/02b848437844ba3cbb6c

Editing httpd.conf

Comment out the following LoadModule

/usr/local/etc/httpd/httpd.conf


LoadModule proxy_module libexec/apache2/mod_proxy.so
LoadModule proxy_ajp_module libexec/apache2/mod_proxy_ajp.so

Add the following sentence to the end of the file Read the AJP communication settings (will be created) described in the external config file.

/usr/local/etc/httpd.conf


Include /usr/local/etc/httpd/extra/httpd-proxy.conf

Editing httpd-proxy.conf

On the terminal at / usr / local / etc / httpd / extra /

/usr/local/etc/extra


$ sudo vim httpd-proxy.conf

Then vim will start and a new file will be created, so copy and paste the following code.

/usr/local/etc/extra/httpd-proxy.conf


<Location /pebble >
  ProxyPass ajp://localhost:8009/pebble
  Order allow,deny
  Allow from all
</Location>

With this, the settings on the Apache side are all okay I will put Tomcat from here.

Tomcat installation

From the Official Site, select the version you like and press "Download". Click "tar.gz" from "Core" on the page you jumped to download. It may be easier later if you download it to the root directory (~ /). It can be anywhere.

Unzip the downloaded tar.gz file from the Finder and look inside. There is a folder called "conf", so go inside and open server.xml with your favorite text editor.

The following code around line 74,

conf/server.xml


<Connector executor="tomcatThreadPool"
          port="8080" protocol="HTTP/1.1"
          connectionTimeout="20000"
          redirectPort="8443" /> 

I will not use HTTP communication this time, so comment it out.

conf/server.xml


<!--
<Connector executor="tomcatThreadPool"
          port="8080" protocol="HTTP/1.1"
          connectionTimeout="20000"
          redirectPort="8443" /> 
-->

Next, rewrite the address of the setting for AJP communication used this time to 127.0.0.1 around the 117th line, add secretRequired, and set the parameter to false (only when local!)

conf/server.xml


<Connector protocol="AJP/1.3"
           address="127.0.0.1"
           port="8009"
           redirectPort="8443"
           secretRequired="false" />

By the way, I was really into it because I didn't set secretRequired.

Introduction of Pebble

The last spurt when you come here. First, download Pebble from this site. The download location is a bit confusing, but you can download it by clicking Pebble 2.6.4 in the upper right corner. image.png

Unzip the downloaded file, ** copy pebble-2.6.4.war in the unzipped folder ** without unzipping **, move to the previous Tomcat directory and paste it directly under webapps .. The original folder is unnecessary. Only use the ** war file ** inside. We will access the war file later, so let's ** rename ** to pebble.war.

Start tomcat and apache server

If you come this far, it's almost a goal. Open a terminal and go inside Tomcat's bin. To start the tomcat server, in bin on the terminal

tomcat/bin


$ ./startup.sh

Just type the command. By the way, when you stop

tomcat/bin


$ ./shutdown.sh

Just run in the same place. After confirming that it starts, leave it as it is

terminal


$ apachectl start

To start the apache server.

goal!

Now that both the tomcat server and the apache server are up, typing localhost / pebble in your browser's URL should bring up Pebble's Welcome page after a short load.

image.png

Afterword

I'm very addicted to it, so please refer to it and run through smoothly ...

Checkpoints if you get hooked

Is port 8009 not filled? If it is filled, you can use another port (such as 8019). Don't forget to change both server.xml and httpd-proxy.conf!

Reference site

https://ameblo.jp/g-pinchan-new/entry-11573378743.html https://qiita.com/brighton0725/items/0e116db637a8fea1d907

Recommended Posts

Build Apache + Tomcat + Pebble locally on Mac
Build Apache / Tomcat development environment on Cent OS 7
Install tomcat + eclipse on mac
When Gradle build stops when importing on Mac
Deploy Java Servlet app locally on Tomcat
Build a Java development environment on Mac
Build a JMeter environment on your Mac
Build openssl, apache2.4, php7.4 from source on Ubuntu-server20.04.
JSP on tomcat
Apache and tomcat
Install Java, Apache, Tomcat9 on EC2 (Amazon Linux2)
[Ruby on Rails] Let's build an environment on mac
Build Java development environment with VS Code on Mac
[Docker] Build an Apache container on EC2 using dockerfile
[Docker] Build a Wordpress environment locally (Win, Mac) quickly
Install gradle on mac
Run STS4 on Mac
Apache Tomcat 9 documentation summary
Install Java on Mac
Tomcat v8 on CentOS7
Apache2 on Ubuntu20.04 LTS
Install openjdk11 on mac
1002 error on tomcat + webSocket
Install OpenJDK 8 on mac
Build Zabbix on Ubuntu 20.04
Build a CentOS 8 virtual environment on your Mac with VirtualBox
Attempt to source build JDK9 EA on Mac OSX (failed)