Liferay. Часть 3. Настраиваем Apache 2.2. + mod_jk.so для работы на Front. Переводим портал на SSL (TSL).

By | 5 августа, 2015

 

Fronting Liferay with Apache Web Server using mod_jk Connector:
In this example I am going to explain how to access a liferay tomcat server using Apache web server. For this we require Liferay server, Apache web server and mod_jk connector.
In this example I am using Liferay Tomcat 6.2 , Apache Web server 2.2(httpd-2.2.25-win32-x86-openssl-0.9.8y.msi) and mod_jk (tomcat-connectors-1.2.x-windows-i386-httpd-2.2.x.zip)
1. Installing The Apache Web Server:
Download the Apache Web Server here and to Install follow this link 2. Downloading and Enabling mod_jk in httpd.conf file:Download the mod_jk from here.
Once the mod_jk connector is downloaded, unzip and copy the ‘mod_jk.so’ file from it and paste it under “modules” folder of your Apache installation directory.
For eg: C:\Program Files (x86)\Apache Group\Apache2\modules
To access mod_jk, we need an entry in ‘httpd.conf’ file which is located under “conf” folder of your apache installation directory.Paste the below lines in your ‘httpd.conf’ file after “

#LoadModule vhost_alias_module modules/mod_vhost_alias.so”
# Load mod_jk module
LoadModule jk_module modules/mod_jk.so

3. Creating ‘workers.properties’ file and including in httpd.conf file: Create a “workers.properties” file under the “conf” folder of your apache installation directory.
copy the below 4 lines and paste it in your newly created workers.properties file.

worker.list = worker1
worker.worker1.port=8009
worker.worker1.host=127.0.0.1
worker.worker1.type=ajp13

Here worker.worker1.port is the AJP port number of your Liferay tomcat server. and now include below line in your ‘httpd.conf’ file after “LoadModule jk_module modules/mod_jk.so”
JkWorkersFile conf/workers.properties
4. Creating VirtualHost in httpd.conf file:
Copy the below code and paste it at the end of your httpd.conf file.

# Listen for virtual host requests on all IP addresses
NameVirtualHost *:80

<VirtualHost *:80>
ServerAdmin serveradmin@akram.com
ServerName http://www.akram.com
JkMount /* worker1
JkMountCopy On
</VirtualHost>

Here ServerName is your domain name and worker1 is the name of the worker you defined in your workers.properties file.
5. Adding entry in the hosts file:
Now you must add your server name (which is mentioned as ServerName in VirtualHost of your httpd.conf file) in your hosts
file which is located under “C:\Windows\System32\drivers\etc” as shown below.
127.0.0.1 http://www.akram.com
6. Restart your Apache Web Server and start your Liferay server.
7. Access your Liferay server with the domain name (ex: http://www.akram.com)

Добавить комментарий