Integrating Tomcat And Apache on Red Hat Linux 9 Or Red Hat Enterprise Linux 3

xiaoxiao2021-03-06  143

Integrating Tomcat And Apache on Red Hat Linux 9 Or Red Hat Enterprise Linux 3

Mike MillsonWeb Systems Engineermillson@meritonlinesystems.comFebruary 5, 2004Merit Online Systems, Inc.http://www.meritonlinesystems.com/

1.0 Introduction

Java servlets are a powerful tool for building websites and web based applications. One skill that every Java web developer should have is the ability to install and configure the Tomcat servlet engine. Many thanks to the Apache Software Foundation for providing this mature, stable, open Source Software. It was recently voted the best application server of 2003 by infoWorld Readers.

This article discusses how to integrate Tomcat with the Apache web server on Red Hat Linux 9 or Red Hat Enterprise Linux 3. The goal is to provide a simple, stable configuration that will allow users to gain confidence using Tomcat.Please note the following code conventions :

All Commands Are Issued As Root Unless Values ​​Should Be Customized to your Setup.

2.0 Installing Apache

I Chose to install apache Using the red hat rpm. Using the rpm instead of compiling apache from source simplifies system administration in the Following Ways:

.

I recommend using the Red Hat up2date command line utility to install Red Hat RPMs. It eliminates a multitude of headaches by ensuring the software you install is the correct version and you have the right dependencies installed on your system.

Red Hat RPMs That Must Be Installed:

Httpd: The Apache Web Server Httpd-We: Development Tools That Will Be Needed to Create The Mod_jk Connector

To Install, Make Sure You Are Connected to the Internet, and Enter the Following: Up2date -i Httpd

Up2date -i httpd-deb

You Should Now Be Able To Start / Stop / Restart Apache As Follows:

Service httpd start

Service httpd stop

Service Httpd Restart

Verify That Apache is working by starting apache and type http: // localhost / infault apache install power page with links to documentation.

3.0 Installing Tomcat

The Only Requirements to Run Tomcat Are That A Java Development Kit (JDK), Also Called A Java Software Developement Kit (SDK), Be Installed and the Java_Home Environment Variable Be set.

3.1 Java SDK

I Chose to Install Sun's Java 2 Platform, Standard Edition, Which can be downlined from http://java.sun.com/j2se/. I Chose The J2se V1.4.2 SDK Linux Self-extracting binary file.

Change to the Directory where you downloaded the sdk and make the self-extracting binary executable:

CHMOD X J2SDK-1_4_2-Linux-i586.bin

Run the self-extraracting binary:

./j2sdk-1_4_2-linux-i586.bin

There should now be a directory called j2sdk1.4.2 in the download directory. Move the SDK directory to where you want it to be installed. I chose to install it in / usr / java. Create / usr / java if it does not exist Here is The Command I used from inside the download Directory:

MV J2SDK1.4.2 / usr / java

Set the java_home environment variable, by modifying / etc / profile suludes the folowing:

Java_home = "/ usr / java / j2sdk1.4.2"

Export java_home

.

exit

SU -

Check to make sure java_home is defined Correctly Using The Command Below. You Should See The Path To your java sdk.echo $ java_home

3.2 Tomcat Account

You Will Install and configure Tomcat As root; however, you shouth, group and user account for tomcat to Run Under As Follows:

GroupAdd Tomcat

UserAdd -g Tomcat Tomcat

This Will Create The / Home / Tomcat Directory, WHERE I WILL Install My Tomcat Applications.

3.3 Download Tomcat

Download The Latest Release Binary Build from http://www.apache.org/dist/jakarta/tomcat-4/. Since Tomcat Runs Directly On Top of A Standard JDK, I Cannot Think of Any Reason To building it from source.

The Tomcat Binary Is Available In Two Different Flavors:

Non-le

Full Binary Distribution Includeds All Optional Libraries and an XML Parser (Xerces) Can Be Run On JDK 1.2 Le

Lightweight binary distribution Designed to be run on JDK 1.4 Does not include an XML parser because one is included in JDK 1.4 Can be run on JDK 1.2 by adding an XML parser All the components of this distribution are open source software Does not include any of the FOLLOWING OPTIONAL BINARIES: JavaMail, Java Activation Framework, Xerces, JNDi, or the JDBC Standard Extension

There Are A Number of Different Download Formats. I Chose The Le Version GNU Zipped Tar File (Jakarta-Tomcat-4.1.29-Le-jdk14.tar.gz).

3.4 Tomcat Standalone

Unzip tomcat by issuing the Following Command from Your Download Directory:

TAR XVZF JAKARTA-TOMCAT-4.1.29-Le-jdk14.tar.gz

This will create a directory called jakarta-tomcat-4.1.29-LE-jdk14 Move this directory to wherever you would like to install Tomcat I chose / usr / local Here is the command I issued from inside the download directory...:

mv jakarta-tomcat-4.1.29-LE-jdk14 / usr / local / The directory where Tomcat is installed is referred to as CATALINA_HOME in the Tomcat documentation. In this case CATALINA_HOME = / usr / local / jakarta-tomcat-4.1.29 -LE-JDK14.

I recommend setting up a symbolic link to point to your current Tomcat version. This will save you from having to change your startup and shutdown scripts each time you upgrade Tomcat or set a CATALINA_HOME environment variable. It also allows you to keep several versions of Tomcat on your system and easily switch amongst them. Here is the command I issued from inside / usr / local to create a symbolic link called / usr / local / jakarta-tomcat that points to /usr/local/jakarta-tomcat-4.1.29 -Le-JDK14:

LN-S Jakarta-Tomcat-4.1.29-Le-JDK14 Jakarta-Tomcat

Change the group and ooner of the / usr / local / jakarta-tomcat and /usr/local/jakarta-tomcat-4.1.29-le-jdk14 directories to Tomcat:

Chown Tomcat.Tomcat / USR / local / jakarta-tomcat

Chown -r tomcat.tomcat /usr/local/jakarta-tomcat-4.1.29-LE-JDK14

IT IS Not Necessary to set the catalina_home environment variable. Tomcat is smart enough to Figure out catalina_home on its OWN.

You should now be able to start and stop Tomcat from the CATALINA_HOME / bin directory by typing ./startup.sh and ./shutdown.sh respectively Test that Tomcat is working by starting it and typing http:. // localhost: 8080 into your .......................

3.5 SELECTING A Connector

At this point, Apache and Tomcat should be working separately in standalone mode. You can run Tomcat in standalone mode as an alternative to Apache. In fact, in some cases, it is said that Tomcat standalone is faster than serving static content from Apache and . dynamic content from Tomcat However, there are compelling reasons to use Apache as the front end If you run Tomcat standalone:. you will have to run Tomcat as root on port 80. This is a security concern you will not be able to use. a connector such as mod_jk to load balance amongst several Tomcat instances. You will not be able to take advantage of Apache features such as cgi and PHP. You will not be able to take advantage of Apache modules such as mod_rewrite. You will not be able To isolate Virtual Hosts in Their Own Tomcat Instances.

I think the increased functionality obtained by using Apache on the front end far outweighs the effort required to install and configure a connector. With that said, I selected the tried and true mod_jk connector. It has been around a long while and is very stable. mod_jk2 is the wave of the future, but I'm holding off on that for now. In early 2002 I invested a considerable amount of time on the "wave of the future" connector at that time, mod_webapp, which is now no longer being Developed. for That Reason, I am Being Cautious About MigRating to MOD_JK2.

3.6 Building The Mod_jk Connector

The MOD_JK Connector Is The Communication Link Between Apache and Tomcat. It Listens on Port 8009 for Requests from apache.

In my experience, it's safest to think of connectors as being version dependent If you upgrade Tomcat and you have a connector issue, try compiling the connector using the version-specific connector source.Download the jk connector source from http:. // www. Apache.org/dist/jakarta/tomcat-connectors/jk/. i buy Jakarta-Tomcat-Connectors-JK-1.2-src-current.tar.gz.

Unzip The Contents of The File Into Your Download Directory As Follows:

TOAR XVZF JAKARTA-TOMCAT-Connectors-JK-1.2-src-current.tar.gz

This will create a folder called jakarta-tomcat-connectors-jk-1.2.5-src. Move this folder to wherever you store source files on your system. I chose / usr / src. Here is the command I issued from inside the download Directory:

MV JAKARTA-TOMCAT-Connectors-JK-1.2.5-SRC / USR / SRC

I Refer to the folder where the connection amount is installed as conn_src_home. In my copy conn_src_home = /usr/src/jakarta-tomcat-connectors-jk-1.2.5-src.

Run the buildconf script to to create the conn_src_home / jk / native / configure file.

CONN_SRC_HOME / JK / NATIVE / BUILDCONF.SH

Run the configure script with the path to the apxs file on your system and the options Below:

./configure --with-apxs = / usr / sbin / apxs

Build Mod_jk with the folload command:

Make

IF All Went Well, The MOD_JK.SO File Was Success Created .manually Copy It To Apache's Shared Object Files Directory:

CP conn_src_home / jk / native / apache-2.0 / mod_jk.so / etc / httpd / modules

4.0 Configuring Tomcat

4.1 Workers.properties

The Workers.properties File Contains Information So Mod_jk Can Connect To The Tomcat Worker Processes.

Create a Directory Called Catalina_Home / Conf / JK and Place The Workers.properties File Below in this Directory.

# workers.properties - ajp13

#

# List workersworker.list = WRKR

#

# Define WRKR

Worker.wrkr.port = 8009

Worker.wrkr.host = localhost

Worker.wrkr.type = ajp13

Worker.wrkr.cachesize = 10

Worker.wrkr.cache_timeout = 600

Worker.wrkr.socket_timeout = 300

Notes

There is an example workers.properties file located in the CONN_SRC_HOME / jk / conf directory. The example file provides a lot of useful information and insight into the workers.properties file, but it contains so much information that it can be confusing. I recommend using it as a learning tool but creating your own workers.properties file from scratch. The configuration above assumes Apache and Tomcat are located on the same box and requests are forwarded to Tomcat using type ajp13 workers. type ajp13 workers forward requests to out-of -process Tomcat workers using the ajpv13 protocol over TCP / IP sockets. The name of the worker in the JkMount directive in httpd.conf must match the name of the worker in worker.list ( "wrkr" in the configuration above).

4.2 Server.xml

The server.xml file contains Tomcat server configuration information. The default CATALINA_HOME / conf / server.xml file that comes with Tomcat contains so much information that I recommend saving it for future reference (eg server.xml.bak) and starting from scratch. The default server.xml is great for verifying that Tomcat works in standalone mode and for viewing the examples that come with the application, but I have found it is not the best starting point when you want to integrate Apache with Tomcat. Instead, create a Bare Bones Server.xml File As Follows:

Address = "127.0.0.1" port = "8009" MINPROCESSOORS = "5" maxprocessors = "75"

Enablelookups = "false" acceptcount = "10" debug = "0" />

Prefix = "Catalina_Log." SUFFIX = ". TXT"

TimeStamp = "true" />

Debug = "0" reloadable = "true" />

This Setup Assumes You Will Put Your Tomcat Applications IN / HOME / TOMCAT, NOT CATALINA_HOME / WebApps. This will allow you to easily Upgrade Tomcat and back up your tomcat applications.

If you do keep the default server.xml, make sure you comment out any other connectors besides mod_jk that are listening on port 8009. The default file comes with the Coyote / JK2 connector enabled for the Tomcat-Standalone service. This will conflict with the mod_jk connector in your Tomcat-Apache service. you should comment this connector out. It is not needed when you connect directly to Tomcat in standalone mode (port 8080), so I'm not sure why this connector is enabled by default.

The Server address defines the interface that Tomcat will listen on for mod_jk requests from Apache. In my configuration, Apache and Tomcat reside on the same box, so I have set the address to the loopback address. The default is for Tomcat to listen on all interfaces, so restricting it to the loopback interface improves security.The Server shutdown property is the text string that is sent over a socket connection to stop Tomcat. The default value is "SHUTDOWN". The shutdown port is always on the loopback interface, which provides host-level protection. However, there is the possibility that the host could be compromised and someone could send the command SHUTDOWN to all ports and knock Tomcat offline. to prevent this, replace the default value with one that is difficult to guess. Do NOT USE The EXAMPLE STRING. CREATE YOUR OWN by Feeding Random Bytes Into MD5Sum as Follows:

HEAD-1024C / dev / random | MD5SUM

Change the Permissions on Server.xml So No One Can Read The Shutdown String:

CHMOD 600 $ CATALINA_HOME / CONF / SERVER.XML

5.0 Configuring Apache

Apache is configured with directives placed in the main Apache configuration file, /etc/httpd/conf/httpd.conf. In addition, Apache 2 has configuration files for perl, php, and ssl located in /etc/httpd/conf.d/ .

Rename the /etc/httpd/conf.d/ssl.conf file to ssl.conf.bak. The Default Red Hat Apache 2 Installation Comes with ssl support enabled. If ssl is needed, You Can Re-Enable It after you have successfully Integrated Apache and Tomcat.

5.1 httpd.conf

YOU WILL NOTICE THATE ARE Three Sections Labled in The Httpd.conf File Supplied by Red Hat: (1) Global Environment, (2) Main Server Configuration, And (3) Virtual Hosts.

Add The Following to the Bottom of The EXISTING LOADMODULE DIRECTIVES IN THE GLOBAL ENVIRONMENT SECTION: LOADMODULE JK_MODULE MODULES / MOD_JK.SO

Add The Following to The Bottom of The Main Server Configuration Section section:

Jkworkersfile "/usr/local/jakarta-tomcat/conf/jk/workers.properties"

Jklogfile "/usr/local/jakarta-tomcat/logs/mod_jk.log"

JKLoglevel Info

JKLOGSTAMPFORMAT "[% a% B% D% H:% M:% S% Y]"

The Configuration Above Assumes You create a symbolic link / usr / jakarta-tomcat that point points to the directory where your version of tomcat is installed.

SET UP A Virtual Host Directive In The Virtual Hosts Section of httpd.conf. Below is an esample of how to set up the your_domain Website SO Tomcat Handles All JSP Pages and Requests with "servlet" in the path:

Namevirtualhost 127.0.0.1:80

ServerAdmin Webmaster @ Your_Domain

ServerName Your_Domain

Documentroot / USR / WWW / YOUR_DOMAIN / HTML

ErrorLog / USR / WWW / YOUR_DOMAIN / LOGS / ERROR_LOG

Customlog / USR / WWW / YOUR_DOMAIN / LOGS / Access_log Common

JKMount /*.jsp WRKR

JKMount / servlet / * WRKR

The Configuration Above Assumes That your application's static html files will be served from the / usr / www / your_domain / html directory.

The Argument for the namevirtualhost Directive Must Match Exactly The Argument for the VirtualHost Directive (127.0.0.1:80).

You can test your apache configuration by Typing the Following:

httpd -t -d dump_vhosts

You Should Get Something Like The Following Response:

127.0.0.1:80 Is A NameVirtualHost

Default Server Your_Domain (/etc/httpd/conf/httpd.conf:1056)

Port 80 NameVhost Your_Domain (/etc/httpd/conf/httpd.conf:1056)

Syntax OK

6.0 Setting Up your_domainyour_domain does not need to be a domain name with a DNS entry. For testing purposes, you can set up any domain you want in the / etc / hosts file of the machine that you will be using to access your_application.

The example below shows the entry for your_domain..

127.0.0.1 Your_Domain

7.0 Testing Apache

WE WILL CREATE AND INSTALL A Simple Hello World HTML Page So We can test to make sustic html pages.

7.1 Hello World HTML

Copy The Following Text Into A File Called HelloWorld.html And Install The File In The / USR / WWW / Your_Domain / HTML Directory.

Hello World HTML! </ Title></p> <p></ hEAD></p> <p><body></p> <p><H1> Hello World HTML! </ h1></p> <p></ body></p> <p></ html></p> <p>If Apache Has Not Been Restarted Since You Added your Virtual Host, Do So as Follows:</p> <p>Service Httpd Restart</p> <p>You Should Now Be Able To Type http: //your_domain/helloWorld.html Into your browser and see the always-exciting "Hello World" message.</p> <p>8.0 Testing Tomcat</p> <p>WE WILL CREATE AND INSTALL A Simple Hello World Servlet So We Can Test To make Sure Apache Forwards Servlet Requests To Tomcat for Handling.</p> <p>8.1 Hello World JSP</p> <p>Copy The Following Into a file called helloworld.jsp:</p> <p><% @ page contenttype = "text / html; charSet = windows-1252"%></p> <p><! Doctype html public "- // w3c // DTD html 4.01 transitional // en"> <html></p> <p><HEAD></p> <p><meta http-equiv = "content-type" content = "text / html; charSet = ISO-8859-1"></p> <p><title> Hello World JSP </ Title></p> <p></ hEAD></p> <p><body></p> <p><h1> <% out.println ("Hello World JSP!");%> </ h1></p> <p></ body></p> <p></ html></p> <p>Copy the helloworld.jsp file to the / home / Tomcat / your_Application / Directory.</p> <p>8.2 Hello World Servlet</p> <p>Copy The Following Into a File Called HelloWorld.java:</p> <p>Import java.io. *;</p> <p>Import javax.servlet. *;</p> <p>Import javax.servlet.http. *;</p> <p>Public class helloworld</p> <p>Extends httpservlet {</p> <p>Public void doget (httpservletRequest Request,</p> <p>Httpservletresponse response</p> <p>THROWS IOException, servletexception {</p> <p>Response.setContentType (Text / HTML ");</p> <p>PrintWriter out = response.getwriter ();</p> <p>Out.Println ("Hello World Servlet!");</p> <p>}</p> <p>}</p> <p>Compile The Source Into a class file as stock:</p> <p>Javac -classpath /usr/local/jakarta-tomcat/common/lib/servlet.jar HelloWorld.java</p> <p>This Will Create A file caled helloworld.class. Copy The helloWorld.class file to the / home / tomcat / your_application / web-inf / classes Directory.</p> <p>8.3 Tomcat Application</p> <p>Create The Following Directories and Files In / Home / Tomcat / Your_Application:</p> <p>/ home / tomcat / your_Application / Web-Inf</p> <p>/ home / tomcat / your_application / web-inf / classes</p> <p>/Home/tomcat/your_application/web-inf/web.xml</p> <p>. The web.xml file is where you map the name of your servlet to a URL pattern so Tomcat can run your servlet when requested Below is the web.xml file that runs the HelloWorld servlet whenever the URL http: // your_domain / servlet / HelloWorld Is Entered In The Browser:</p> <p><? XML Version = "1.0" encoding = "ISO-8859-1"?> <! doctype web-app</p> <p>Public "- // Sun microsystems, Inc.//dtd Web Application 2.3 // en"</p> <p>"http://java.sun.com/dtd/web-app_2_3.dtd"></p> <p><web-app></p> <p><servlet></p> <p><servlet-name> HelloWorld </ servlet-name></p> <p><servlet-class> HelloWorld </ servlet-class></p> <p></ servlet></p> <p><servlet-mapping></p> <p><servlet-name> HelloWorld </ servlet-name></p> <p><url-pattern> / servlet / helloworld </ url-pattern></p> <p></ servlet-maping></p> <p></ web-app></p> <p>Restart Tomcat As Follows:</p> <p>/Catalina_home/bin/shutdown.sh</p> <p>/Catalina_home/bin/startup.sh</p> <p>Restart Apache As Follows:</p> <p>Service Httpd Restart</p> <p>You Should Now Be Able To Type The Following Into Your Browser and See The Always-Exciting "Hello World" message: http://your_domain/helloWorld.jsphttp: // Your_Domain / servlet / HelloWorld</p> <p>9.0 Advanced Configuration</p> <p>The Following Steps Are Not Mandatory, But Are Suggested for a Better, Tighter Tomcat Installation.</p> <p>9.1 Tomcat Startup Script</p> <p>If you want to automatically start tomcat when your system boots and management it using the service command as we do apache, you must create an inTIALIZATION Script.</p> <p>Create the folowing tomcat initialization script as /etc/rc.d/init.d/tomcat</p> <p>#! / bin / sh</p> <p>#</p> <p># Startup Script for Tomcat, The Apache Servlet Engine</p> <p>#</p> <p># chkconfig: 345 80 20</p> <p># Description: Tomcat is The Apache Servlet ENGINE</p> <p># ProcessName: Tomcat</p> <p># pidfile: /var/run/tomcat.pid</p> <p>#</p> <p># MIKE MILLSON <mmillson@meritonlinesystems.com></p> <p>#</p> <p># Version 1.02 - Clear Work Directory On Shutdown Per John Turner Suggest.</p> <p># Version 1.01 - Cross Between Red Hat Tomcat RPM and Chris Bush Scripts</p> <p># Tomcat name :)</p> <p>Tomcat_Prog = Tomcat # if Tomcat_user is not set, Use Tomcat Like Apache HTTP Server</p> <p>IF [-z "$ Tomcat_user"]; then</p> <p>Tomcat_user = "Tomcat"</p> <p>Fi</p> <p>Retval = 0</p> <p># Start and stop functions</p> <p>START () {</p> <p>echo -n "starting tomcat:"</p> <p>Chown -R $ TOMCAT_USER: $ TOMCAT_USER / USR / local / jakarta-tomcat / *</p> <p>Chown -R $ TOMCAT_USER: $ TOMCAT_USER / HOME / TOMCAT / *</p> <p>Su -l $ Tomcat_user -c '/usr/local/jakarta-tomcat/bin/startup.sh'</p> <p>RetVal = $?</p> <p>echo</p> <p>[$ RETVAL = 0] && touch / var / lock / subsys / Tomcat</p> <p>Return $ RetVal</p> <p>}</p> <p>STOP () {</p> <p>echo -n "stopping Tomcat:"</p> <p>Su -l $ Tomcat_user -c '/usr/local/jakarta-tomcat/bin/shutdown.sh'</p> <p>RetVal = $?</p> <p>echo</p> <p>[$ RETVAL = 0] && rm -f / var / lock / subsys / tomcat /var/run/tomcat.pid</p> <p>Rm -rf / usr / local / jakarta-tomcat / work / *</p> <p>}</p> <p># See how wee wee caled.</p> <p>Case "$ 1" in</p> <p>START)</p> <p>Start</p> <p>;</p> <p>STOP)</p> <p>STOP</p> <p>;</p> <p>RESTART)</p> <p>STOP</p> <p># Ugly hack</p> <p># We Should Really Make Sure Tomcat</p> <p># is stopped before leaving stop</p> <p>Sleep 2</p> <p>Start</p> <p>;</p> <p>*)</p> <p>Echo "USAGE: $ 0 {start | stop | restart}"</p> <p>EXIT 1</p> <p>ESAC</p> <p>EXIT $ RETVAL</p> <p>Add The Startup Script to your System as Follows:</p> <p>Chkconfig --Add Tomcat</p> <p>You Will Be Able To Start / Stop / Restart IT Using The Following Commands:</p> <p>Service Tomcat Start</p> <p>Service Tomcat Stop</p> <p>Service Tomcat Restart</p> <p>If you want tomcat to start automaticly when your system boots, you need to add tomcat to your runlevel as stock:</p> <p>ChkConfig --Letle 5 Tomcat on</p> <p>Runlevel 5 is The X Window System, Typical For A Development Computer. Runlevel 3 is Typical for a Dedicated Web Server.</p> <p>.</p> <p>9.2 Development Setup</p> <p>During development, you will need access to your tomcat application directory. Add the user account under which you will be doing development to the tomcat group in / etc / group. For example, this is what the tomcat entry might look like in / etc / Group if you do development: Tomcat: x: 502: Yourname</p> <p>Make Sure The Tomcat Group Has Permission To Publish Files (E.G. USING ANT) To Your Tomcat Application In / Home / Tomcat / Your_Application. Issue The Following Command as root:</p> <p>CHMOD G RW / Home / Tomcat</p> <p>10.0 Troubleshooting</p> <p>10.1 Log Files to Watch</p> <p>/ usr / www / your_domain / logs / error_log</p> <p>Look here for clues to apache httpd.conf configuration Issues, for example VirtualHost Setup.</p> <p>$ Catalina_Home / Logs / Catalina.out</p> <p>LOOK Here for Clues To Tomcat Server.xml Configuration Issues. This File Is Written To When Tomcat Starts and Stops. It also catches system.out and system.err.</p> <p>$ Catalina_home / logs / mod_jk.log</p> <p>Look here for clues to mod_jk configuration issues.</p> <p>© 2003 Merit Online Systems, Inc.</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-127675.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="127675" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.048</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = 'Mt_2BSyCpk60tdaJtMUh7SkX7H0z_2FgDnKm70t61IJf2zLwbsJBYNLUneN4SMRVEMxkwKAgt7_2Bgtrzy51XXmUGqOg_3D_3D'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>