Install and debug web servers in RHELAS4

Source: Internet
Author: User
Tags download zend mysql manual
In RHELAS4, install and debug web Server -Linux Enterprise Application-Linux server application information. The following is a detailed description. AS an enterprise operating system, rhel as 4 naturally contains basic web server programs. To learn about server configuration, we plan to download a newer version of today's web server from the Internet, and install it step by step to enjoy DIY! Before performing the following operations, make sure that your system has not installed the web server that comes with the system. I. WEB Server (Apache Ver2.0.53) Apache v2.0.53 for Linux: One of the most popular HTTP server software, completely free, open source code, if you need to create a Web server that is accessible to millions of people every day, Apache may be the best choice. 1. Download http://down.chinaz.com/S/9064.asp 2. Installation (1) decompress the downloaded apache2.tar.gz package to a temporary directory such as/usr/local/src/(2) Compile and install the package to the directory you just decompressed. If you want to put Apache2 under/usr/local/apache, then :#. /configure -- prefix =/usr/local/apache (Note: Do not add the "/" number at the end of the uplink) # make install (3) start #/usr/local/apache/bin/apachectl start3. Open your Firefox browser and enter http://localhost/ , Press Enter. Haha, see the familiar color goose logo. Congratulations! The first step went very smoothly! 4. Configure the current configuration file of your Apache server:/usr/local/apache/conf/httpd. conf edit the file: (1) Change the user's web directory to/var/www/html (the var/www/html directory in the future will be your web file storage location, of course, you can also specify another directory.) Use # unregister DocumentRoot "/usr/local/apache/htdocs" near line 307 and add a line below: documentRoot "/var/www/html" (2)add the index file name index.htm.pdf to the near directoryindexline and then add index.htm DirectoryIndex index.html. var index.htm (3) Save and quit (4) restart the web server: httpd-k restart (command Description: start server: httpd-k start close server: httpd -K stop) reminder: For convenience, we recommend that you create a desktop link to start and close the server. 5. re-test the file using vi or text editor to edit the following content: My test pageThis is my first test page!
This is my first test webpage!Save as/var/www/html/index.htm and enter http://localhost/ See your test page. If garbled characters appear, adjust the character encoding of your browser. Now OK. Happy now! Ii. MySQL database (MySQL Ver4.1.10) MySQL v4.1.10 for Linux is a multi-threaded, Structured Query Language (SQL) database server. It features high execution performance, fast running, and easy to use. At present, many commercial web virtual host Products in China provide support for it. http://down.chinaz.com/S/12030.asp 1. decompress the mysql installation file to a directory. For example,/usr/local/src/2. Add User Groups and users # groupadd mysql // Add mysql user group # useradd-g mysql // Add User mysql in mysql user group 3. Create original program directory link # cd/usr/local/# ln-s/usr/local/src/mysql-standard-4.1.10-pc-linux-gnu-i686/mysql // create a directory to the original program under/usr/local/directory Link 4. Create the mysql authorization table # cd mysql # scripts/mysql_install_db -- user = mysql 5. mysql directory program root and mysql user authorization # chown-R root. # chown-R mysql data # chgrp-R mysql. 6. Start mysql service # cd/usr/local/mysql/ Support-files/#./mysql. server start 7. Test #/usr/local/mysql/bin/mysql. The installation and running of mysql are successful. Enter select now (); Press enter to see the following input interface. + -------------------- + | NOW () | + -------------------- + | 20:00:03 | + ---------------------- + 1 row in set (0.00 sec) mysql> enter quit at the prompt to exit the friendship prompt: for more MySQL operation commands, see the MySQL manual. 8. Disable mysql service #/usr/local/mysql/support-files/mysql. server stop friendly reminder: You can create a connection to open and close MySQL applications on your desktop to improve your work efficiency. Iii. PHP script language (PHP Ver5.0.3) PHP v5.0.3 For Linux PHP is a new type of CGI programming language. It is easy to learn and use, and runs fast. It provides powerful editing functions conveniently and quickly, it runs fast and can run Web Background programs on Windows, Unix, and Linux platforms at the same time.: http://down.chinaz.com/S/7001.asp1 , Extract the file to/usr/local/src/2, enter the directory # cd/usr/local/src/php-5.0.3 3, configuration #. /configure -- prefix =/usr/local/php5 -- with-mysql =/usr/local/mysql -- with-mail -- with-apxs2 =/usr/local/apache/bin/apxs 4 compile # make 5, install # make install 6, and copy php. INI file # cp php. ini-dist/usr/local/lib/php. ini 7. Edit/usr/local/apache/conf/httpd. conf (1) Add the index to the DirectoryIndex line near 397. phpDirectoryIndex index. php index.html. var index.htm (2) near 827 # AddType application/x-tar. add two lines below tgz: AddType application/x-httpd-php. php. phtmlAddType application/x-httpd-php-source. phps 8. Test (1) delete/var/www/html/index. * file, edit index. php is saved here with the following content: (2) restart the web server # httpd-k stop # httpd-k start (3) input in the Firefox Address Bar http://localhost/ , Press Enter. Have you seen the PHP5 configuration table? Okay. Let's take a break. We still have a lot of work to do. 4. MySQL management tool (phpMyAdmin Ver 2.6.1 RC2) phpMyAdmin 2.6.1 RC2 for Linux phpMyAdmin is a set of PHP programs that can be used to manage MySQL-server and a single database, it is a convenient management tool for those who are not familiar with MySQL Command column commands. http://dl.163.com/html/25/25370.html 1. Install phpmyadmin-2.6.1-rc2.tar.gz to/var/www/html/and change the directory phpMyAdmin-2.6.1-rc2 to phpMyAdmin. 2. Make sure that the Apache server is started. Open the Firefox browser and enter in the address bar: http://localhost/ PhpMyAdmin. Press enter to display the main interface of phpMyAdmin. 3. For security reasons, we recommend that you change the root logon password of MySQL immediately following these steps. (1) Click the portrait icon on the right of the root record in the central table on the first page. (2) Open the permission editing page. In the central "Change Password" text box, enter the password twice and click "execute ". (3) Open/var/www/html/phpMyAdmin/config in the editor. inc. php 85th line $ cfg ['servers'] [$ I] ['Password'] enter the password you just entered in single quotes. Save and exit. In this way, you can log on automatically. (4) If you want to log on manually, modify the following variable values in the file: 60th rows: $ cfg ['blowfish _ secret'] = 'cookies'; 83rd rows: $ cfg ['servers'] [$ I] ['auth _ type'] = 'cooker'; row 85th: $ cfg ['servers'] [$ I] ['Password'] = ''; Save and exit. 5. Zend Optimizer (V.2.5.5) is the PHP Optimizer and its pseudo-compiled script decoder. After all PHP script files are pseudo-compiled by ZendEncoder, irreversible binary format files are generated. As long as we upload the compiled files to the server, others will not be able to view the script program, it has played a very good role in encryption. At the same time, pseudo-compiled PHP scripts can greatly improve the execution efficiency (I have not tested and verified it :)). Apache installed with Zend Optimizer can parse and run normally regardless of whether the PHP file is pseudo-compiled or not. On the contrary, PHP files that have been pseudo-compiled and processed will only output a bunch of garbled characters in your browser. 1. to download the software, you need to download Zend Optimizer V2.5.5 or later to support PHP5. Zend Optimizer V2.5.5 For Linux http://soft.0zones.com/SoftView/SoftView_19371.html 2. After preparing for Uncompressing .rar, uncompress the .tar.gz file in the header to a directory. 3. Enter the Directory and run./install. sh. In the graphical installation interface of the terminal, press enter to specify the path. Check whether the default path is consistent with your machine implementation path. If the default path is different, change it. For example, Specify the Apache bin directory, change the following path to your Apache bin directory:/usr/local/apache/bin. Then, press enter all the way to finally prompt that the installation is successful and restart apache. The installation directory of Zend is/usr/local/Zend /. 4. test and install the index. php file edited in step 8th of section 3 above. The file is still in your/var/www/html/directory. In the Firefox address bar, enter http://localhost/ , Press Enter. Whether the following text segments are displayed on the left of the Zend Engine2 icon at the bottom of the non-scrolling screen: This program makes use of the Zend Scripting Language Engine: Zend Engine v2.0.3, Copyright (c) 1998-2004 Zend connector ieswith Zend Extension Manager v1.0.4, Copyright (c) 2003-2004, by Zend connector ieswith Zend Optimizer v2.5.5, Copyright (c) 1998-2004, by Zend Technologies if any, the installation is successful. The Zend Optimizer parameter table is displayed on the scrolling screen. If there are no more than two lines of text above, it indicates that there is a problem with the installation. Zend Optimizer does not find your php. ini file. In the above text section, find the specific Path behind the Configuration File (php. ini) Path, copy your php. ini, and restart Apache. This is generally solved. Kindly advise: you can install ZendEncoder on your machine and use it to pseudo-compile PHP web files. I am not going to discuss the installation and use of ZendEncoder here, otherwise it will be a little far away from the question. 6. java Development Kit (J2SDK Ver.1.4.2) to provide server support for jsp scripting language, we must also install Java Development Kit. 1. Install J2SDK. For details, see another article titled linuxsky.net/ftopic1245.html "target =" _ blank ">. http://www.linuxsky.net/ftopic1245.html 2. Configuration editing ~ /. Add the following lines to the bash_profile file: JAVA_HOME =/usr/share/j2sdk1.4.2PATH = $ JAVA_HOME: $ JAVA_HOME/bin: $ PATHCLASSPATH =.: $ JAVA_HOME/lib/tools. jar: $ JAVA_HOME/lib/dt. jarexport PATH JAVA_HOME CLASSPATH 3. Test (1) Use a text editor to edit HelloWorldApp. java, content: class HelloWorldApp {public static void main (String args []) {System. out. println ("Hello, World! ") ;}} (2) Compile: # javac HelloWorldApp. java (3) Run: # java HelloWorldApp if you enter a line of Hello, World !, The configuration is successfully installed! 7. Tomcat (Tomcat 5.0.30) Tomcat is another outstanding JSP server developed on the basis of SUN's JSWDK. It not only supports Servlet, but also provides Web server functions. 1. Download: http://download.enet.com.cn/html/232192000121401.html 2. Install: Decompress the downloaded package to/usr/local/. We recommend that you change the directory name to tomcat5.0.30. 3. Start: #/usr/local/tomcat5.0.30/bin/startup. sh 4. Test: enter in the Firefox address bar: http://localhost:8080 , Press Enter. If you see a pretty kitten in the upper left corner, it means OK. 8. Tomcat and Apache Integrator (jakarta-tomcat-connectors Ver.2.0.4) 1. Download container "target =" _ blank "> http://apache.linuxforum.net/dis ... -Src-current.tar.gz 2. Install (1) decompress the downloaded package to/usr/local/src. (2) enter the directory # cd/usr/local/src/jakarta-tomcat-connectors-jk2-2.0.4-src/jk/native2 (3) Compile and install #. /configure -- with-apxs2 =/usr/local/apache/bin/apxs # make # cd .. /build/jk2/apache2 #/usr/local/apache/bin/apxs-n jk2-I mod_jk2.so (4) edit the Apache configuration file/usr/local/apache/conf/httpd. add the following line to the LoadModule In the conf file: LoadModule jk2_module modules/mod_jk2.so (5) edit and save a text file named workers2.properties in the/usr/local/apache/conf/directory. The content is: [logger] level = ERROR [config:] file =/usr/local/apache2/conf/workers2.properties debug = 0 debugEnv = 0 # Alternate file logger [logger. file] # level = DEBUG level = ERROR file =/var/log/httpd/jk2.log [shm:] info = Scoreboard. required for reconfiguration and status with multiprocess servers file =/var/log/httpd/jk2.shm size = 1048576 debug = 0 disabled = 0 [channel. socket: localhost: 8009] info = Ajp13 forwarding over socket debug = 0 tomcatId = localhost: 8009 keepalive = 1 [ajp13: localhost: 8009] channel = channel. socket: localhost: 8009 debug = 0 [status:] info = Status worker, displays runtime informations [uri: /jkstatus/*] info = Display status information and checks the config file for changes. worker = ajp13: localhost: 8009 [uri :/*. jsp] worker = ajp13: localhost: 8009 context =/(6) Modify/usr/local/tomcat5.0.30/conf/server. xml, in Add this line below: Save and exit. (7) Test A) Method 1: Enter http: // localhost/examples/In the Firefox address bar to see the JSP Samples and its two-column icon links. B) Method 2: edit a test under/var/www/html. jsp file with the following content: <% @ page language = "java" contentType = "text/html; charset = gb2312" %> <% out. print ("This is JSP's test page!

"); %> Hello! The time is now <% = new java. util. Date () %> then input http: // localhost/test. jsp In The Firefox address bar. Do you have any output of The following two lines of files? This is JSP's test page! Hello! The time is now Wed Mar 09 02:34:15 CST 2005OK. All The work has come to an end! Web Server construction is a very complicated task. The above is just the preliminary completion of debugging HTML, PHP, JSP and the server environment that calls MySQL on the local machine. There is no doubt that there is still much work to be done to truly complete the web servers used on the Internet.
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.