Friday, July 6, 2018

Apache Wildfly Config

1. Backup your default Apache configuration:
   sudo cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd-org.conf
 
2. sudo yum install httpd-devel gcc gcc-c++ make libtool
3. sudo ln -s /usr/bin/apxs /usr/sbin/apxs

4.  cd /tmp
5.  wget http://www.apache.org/dist/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.43-src.tar.gz
6.  tar -xf tomcat-connectors-1.2.43-src.tar.gz
7.  cd /tmp/tomcat-connectors-1.2.43-src/native
8.  ./buildconf.sh
9. ./configure --with-apxs=/usr/sbin/apxs
10. make
11. sudo systemctl stop httpd
12. sudo cp /tmp/tomcat-connectors-1.2.43-src/native/apache-2.0/mod_jk.so /usr/lib64/httpd/modules


13. sudo vi /etc/httpd/conf.d/workers.properties
--------------------------------------------------------------
 worker.list=jboss1,jkstatus
worker.jkstatus.type=status
worker.jboss1.type=ajp13
worker.jboss1.port=8009

worker.jboss1.host=127.0.0.1


14. sudo vi /etc/httpd/conf.d/modjk.conf
----------------------------------------------------------
# To avoid error AH00558: httpd: Could not reliably
# determine the server's fully qualified domain name
# replace 1.2.3.4 with your server IP
ServerName    23.95.0.231

# Load mod_jk
LoadModule    jk_module modules/mod_jk.so
JkWorkersFile /etc/httpd/conf.d/workers.properties
JkLogFile     /var/log/httpd/mod_jk_log

# To be changed to warn in production, the mount point should match your application sample pathes
JkLogLevel    info
JKMount       /mobicast jboss1
JkMount       /mobicast/* jboss1
JKMount       /jkstatus jkstatus

# To avoid write access error in mod_jk
# https://bugzilla.redhat.com/show_bug.cgi?id=912730
JKShmFile     /var/tmp/jk-runtime-status

15. sudo systemctl restart httpd

16. Configure WildFly for accepting calls from Apache HTTP,
    Open the admin console, and selection the Configuration

Menu -> Web -> HTTP. Then click the View link beside the default-server.

    Select the AJP Listener above, and click Add


17. Check wildfly config(its better to use 28080 instead of 8080)

sudo vi /opt/wildfly/standalone/configuration/standalone-full.xml

Check the config as below :
<interface name="public"> <inet-address value="${jboss.bind.address:127.0.0.1}"/> </interface> <interface name="unsecure"> <inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/> </interface> </interfaces> <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}"> <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/> <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9993}"/> <socket-binding name="ajp" port="${jboss.ajp.port:8009}"/> <socket-binding name="http" port="${jboss.http.port:28080}"/> <socket-binding name="https" port="${jboss.https.port:8443}"/>

18. sudo vi vhost.com

<VirtualHost *:80> ServerAdmin webmaster@xxxxxx ServerName apihost.xxxxxxxxx ServerAlias apihost.xxxxxxxxx DocumentRoot /var/www/html/xxxxx/public_html/ ErrorLog /var/www/html/xxxxxxxxx/logs/error.log CustomLog /var/www/html/xxxxxx/logs/access.log combined
JkMountCopy On
</VirtualHost>

Make sure to add the "JkMountCopy On" line



19. to check if ajp listener is running :

ss -lnp | grep 8009

No comments:

Post a Comment