JSP, PHP, and JAVA integrated development environment 1

Source: Internet
Author: User
JSP, PHP, and JAVA integrated development environment 1-General Linux technology-Linux programming and kernel information, the following is a detailed description. Author: Xiaoyu preface this article introduces the establishment of a Development Environment Integrating JSP, PHP, and JAVA. Many steps are convenient to suit the needs of most beginners, strive for simplicity and clarity. Generally, I use RPM to install software without special requirements. If you have special requirements such as optimized configuration and security considerations, please refer to relevant articles for configuration. In this article, Apache is installed in DSO mode, and PHP supports JAVA components, so that PHP can be used as the Front-End scripting language during large-scale project development, call JAVA components to implement underlying and enterprise-level applications. 1. System Environment 1. Initial installation firewall open interface: 9.0, eth0Redhat Linux Development Tools Network ServersVSFtpCVS-1.11.2-10MySQL 3.23.54 2. package installation JDK 1.4.2 _ 04: http://www.netshine.com.cn/linux /J2sdk-1_4_2_04-linux-i586.rpm Tomcat 5.0.19: http://www.netshine.com.cn/linux /Jakarta-tomcat-5.0.19.tar.gz 3. Script installation Webmin 1.110: http://www.netshine.com.cn/linux /Webmin-1.110.tar.gz ZendOptimizer 2.5.1: http://www.netshine.com.cn/linux ... Glibc21-i386.tar.gz 4. manually compile Apache 2.0.49: http://www.netshine.com.cn/linux /Httpd-2.0.49.tar.gz PHP 4.3.5: http://www.netshine.com.cn/linux /Php-4.3.5.tar.gzJK 2-2.0.4: http://www.netshine.com.cn/linux ... -Src-current.tar.gz 5. Windows XP Guest sionalabsolute Telnet 3.0 Zend EncoderMacromedia Dreamweaver MX 2004 Borland JBuilder 9 unzip isewincvs 1.3: http://www.netshine.com.cn/linux /WinCvs13b17.zip 2. Start the Linux installation CD and install the basic system: FTP, development tools, and MySQL3.23.54. If you compile and install MySQL manually, remember to specify the specific MySQL path when compiling PHP or other programs. Otherwise, compilation errors may occur because the path cannot be found. 3. Install webmin1.110 and use Webmin to configure the system. This will save a lot of effort, so I usually install it first. The installation process is very simple. Execute the setup. sh script and follow the prompts to start step by step. # Cd webmin * #./setup. sh 4. Install JDK1.4.2. 1. Edit the following three files. If you do not specify the full path, put it in your home directory. /Etc/profileJAVA_HOME =/usr/java/j2sdk1.4.2 _ 04 CLASSPATH =.: $ JAVA_HOME/lib: $ JAVA_HOME/jre/libCVSROOT =/usr/local/cvsrootPATH =.: $ JAVA_HOME/bin: $ JAVA_HOME/jre/bin: $ PATHexport JAVA_HOME classpath cvsroot path/etc/ld. so. conf/usr/java/j2sdk1.4.2 _ 04/jre/lib/i386/usr/java/j2sdk1.4.2 _ 04/jre/lib/i386/serverHelloWorld. javaclass HelloWorld {public static void main (String [] args) {// This file tests whether the Java environment has been installed successfully. System. out. println ("Hello World! ") ;}} 2. Run the following command: # rpm-ivh j2sdk *. rpm // install the JDK package. # Source/etc/profile // reload the profile environment. # Ldconfig // create a dynamic link library cache file. # Javac-d. HelloWorld. java // compile the test file. # Java HelloWorld // run the program to test whether the installation is successful. 5. install Apache # tar xvzf httpd * // decompress the source package. # Cd httpd * // enter the installation directory. #./Configure -- prefix =/usr/local/apache -- enable-so -- enable-mod-shared = most -- enable-rewrite # make; make install // compile and install. Note: The -- enable-so option enables Apache to support the DSO mode. Note that we use the Apache2.0 syntax here. If your Apache version is 1.3, change it to -- enable-module = so. -- Enable-mod-shared = most option: tells the compiler to compile all standard modules into DSO modules. If you use Apache1.3, change it to -- enable-shared = max. -- Enable-rewrite option: supports address rewriting. If you are using version 1.3, change it to -- enable-module = rewrite. 6. compile and install PHP 1. run the command # tar xvzf php * // decompress the source code package # cd php * // enter the PHP installation command #. /configure -- prefix =/usr/local/php -- with-mysql -- with-apxs2 =/usr/local/apache/bin/apxs -- with-java =/usr/java/j2sdk1.4.2 _ 04 # make; make install // compile and install # cp php. ini-dist/usr/local/php/lib/php. ini // copy the php configuration file # cd/usr/local/php/lib/php/extensions/no-debug-non-zts-20020429 // extensions directory # ln-s java. so libphp_java.so // create a connection. If you forget it, an error will occur. # cd Zend * // Enter the ZendOptimizer directory #. /install // install PHP accelerator instructions: -- with-apxs2 =/usr/local/apache/bin/apxs is the syntax of Apache2, for version 1.3, use -- with-apxs =/usr/local/apache/bin/apxs. 2. edit the following three files:/usr/local/apache/conf/httpd. confLoadModule php4_module modules/libphp4.soAddType application/x-httpd-php. phpAddType application/x-httpd-php-source. phpsadddefacharcharset gb2312/usr/local/apache/htdocs/test. php GetProperty ('java. version ').'
'; Echo 'java vendor ='. $ system-> getProperty ('java. upload ').'
'; Echo' OS = '. $ system-> getProperty ('OS. name '). ''. $ system-> getProperty ('OS. version '). 'on '. $ system-> getProperty ('OS. arch ').'
'; // Java. util. date example $ formatter = new Java ('java. text. simpleDateFormat ', "EEEE, MMMM dd, yyyy 'at' h: mm: ss a zzzz"); echo $ formatter-> format (new Java ('java. util. date');?> /Usr/local/php/lib/php. iniregister_globals = On [Java] java. class. path =/usr/local/php/lib/php/php_java.jar:/home/jim/myclassjava. home =/usr/java/j2sdk1.4.2 _ 04java. library =/usr/java/j2sdk1.4.2 _ 04/jre/lib/i386/libjava. sojava. library. path =/usr/local/php/lib/php/extensions/no-debug-non-zts-20020429extension_dir =/usr/local/php/lib/php/extensions/no-debug-non-zts-20020429extension = libphp_java.so Note: (1 ). if you just You may find that many of your PHP programs are unavailable after you switch from the old version of PHP to the new version. Don't be nervous! It's okay to open register_globals! This is because the register_globals of the old version of PHP is open by default, but the new version is disabled. (2)./home/jim/myclass is the path for storing JAVA components. You can modify the path according to the actual situation, but do not place it in the web directory for security reasons.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.