Install and download the required software and configurations on a Linux Server

Source: Internet
Author: User

It is particularly worth mentioning that there are many things worth learning about Linux servers. Here we mainly introduce Linux servers, including Linux servers. I will introduce the FTP installation method here. The installation method is faster than the installation from cdrom, and will not appear during the installation process and cannot continue the installation.

1. Install the Linux Server

① First install FTP server software similar to Serv_U on a windows system, then specify the user directory, and allow anonymous access; then copy the three CDs of RedHat 9 to the user directory according to the root directory of the disc. After copying the second and third CDs, the system will prompt that the directory contains the same folder or file, if you want to overwrite the data, answer yes. After the copy is complete, enable the FTP server and enter the ftp: // ftp ip address in the browser, for example, <ftp: // 192.168.100.100> to verify the correctness of the FTP server configuration.

② Place the CD in the optical drive of the server on which the system is to be installed, so that the system can boot from the CD and enter the Linux Installation Wizard Page for a moment. Enter the command line Linux askmethod and press Enter .... Specify the IP address of the server to be in the same network segment as the ftp server) and the default gateway. When the system prompts you to select the installation method, select the ftp method, then you need to specify the IP address of the ftp server and the storage directory of RedHat 9. After the installation is correct, proceed to the next step. The subsequent steps are similar to the installation with a CD.

We recommend that you install less kits (but install mysql) during installation. For example, do not install httpd. After installation, download a new version from the Internet. After a while, the system installation is complete.

2. download the required software and download the following software to a windows machine.

 
 
  1. 1、httpd-2.0.54.tar.gz // apache server
  2. 2、php4.3.11.tar.gz // php interpreter
  3. 3. j2sdk-1.4.2-01-linux-i586-rpm.bin // java Runtime Environment
  4. 4、Jakarta-tomcat-5.0.28.tar.gz // jsp Interpreter
  5. 5、Fedora-Core-1-i386.tar.gz // Connection Program between apache and tomcat. The general method is to use
  6. Jakarta-tomcat-connectors-jk2-src-current.tar.gz, but this process is very troublesome, but also need to rely on several other packages, so it is recommended to use this file.

3. upload and download software to the Linux Server

On the above windows machine, install the ssh client software. I use SecureCRT4.1.5 for registration. It is very convenient to use this software to remotely control Linux servers. Start the software secureCRT, create a session, enter the IP address of the Linux server to be connected to and controlled, enter the user name as root, enter the root password of the Linux server, and connect to the Linux server in a moment, then, perform the same operations on the Linux server. Create the directory/tmp/upload on the Linux server to receive files uploaded from the windows server.

Use the command # mkdir/tmp/upload to create a directory and then go to this directory # cd/tmp/upload, use the upload tool provided by secureCRT to transfer files to/tmp/upload on the Linux server. upload files: click "Transfer" and "Zmodem upload list…" in the SecureCRT menu ...", The Select File to be transferred dialog box appears.

Press Ctrl to select multiple files. After this step is completed, click "Transfer" in the SecureCRT menu to start zmodem upload ", in a few minutes, you can remotely control the selected file secureCrt. the Linux Server creates the directory/tmp/upload and transfers it to the linux directory/tmp/upload. run the # ls-al command on/tmp/upload to verify that the file is correctly uploaded. I uploaded the five files httpd-2.0.54.tar.gz, php4.3.11.tar.gz, j2sdk-1.4.2-01-linux-i586-rpm.bin, fedora-core-1-i386.tar.gz.

Iv. installation and configuration of Linux servers

During the configuration process of the Linux server, some configuration files may need to be modified multiple times, such as the apache configuration file httpd. conf. To make the description more logical, I am here to install all the software first, and then configure it at one time.

1) Linux Server Installation

Run the command #./j2sdk-1.4.2-01-linux-i586-rpm.bin in the current directory/tmp/upload, enter yes and generate the file j2sdk-1.4.2-01-linux-i586-rpm in the current directory. Run the command # rpm-ivh j2sdk-1.4.2-01-linux-i586-rpm, jdk will be installed in the directory/usr/java/j2sdk1.4.2.

2 install tomcat: Extract files in the current directory, use the command # tar-zxvf Jakarta-tomcat-5.0.28.tar.gz, decompress the completion of the generated directory Jakarta-tomcat-5.0.28, and then move this directory to the directory/usr/local, run the command # mv/tmp/upload/Jakarta-tomcat-5.0.28/usr/local to install tomcat.

③ Install apache: in the current directory/tmp/uploadload unzip httpd-2.0.54.tar.gz, use the command # tar-zxvf httpd-2.0.54.tar.gz, decompress the package and go to the directory/tmp/upload/httpd-2.0.54, use the command
# Cd httpd-2.0.54; Execute Command #. /configure-prefix =/usr/local/apache-enable-module = most-enable-shared = max (note that the prefix and enable are two,
If the error message is not displayed, run # make; and # make install to install apache.

④ Install php: Return to the directory/tmp/upload, # cd .. because just transferred to the directory httpd-2.0.54), decompress the file php-4.3.11.tar.gz, # tar-zxvf php-4.3.11.tar.gz, decompress the package to the directory php-4.3.11, # cd php-4.3.11, execute command #. /configure-prefix =/usr/local/php-with-apxs2 =/usr/local/apache/bin/apxs, then run the command # make and # make install to install php. After these processes are completed, the file php. ini-dist file. Copy this file to # cp php. ini-dist/usr/local/lib/php. ini.

Decompress fedora-core-1-i386.tar.gz: two files in this directory need to be decompressed. # Tar-zxvf Fedora-Core-1-i386.tar.gz. Command Used for Installation Summary assuming the current directory is/tmp/upload)

 
 
  1. #./J2sdk-1.4.2-01-linux-i586-rpm.bin # rpm-ivh j2sdk-1.4.2-01-linux-i586-rpm
  2. # Tar-zxvf Jakarta-tomcat-5.0.28.tar.gz // unzip the file # cd Jakarta-tomcat-5.0.28 #
  3. Music/tmp/upload/Jakarta-tomcat-5.0.28/usr/local
  4. # Cd .. # tar-zxvf httpd-2.0.54.tar.gz // unzip the file # cd httpd-2.0.54
  5. #./Configure-- Prefix=/Usr/local/apache-- Enable-module=Most
  6. -- Enable-shared=Max# Make // compile # make install // install
  7. # Cp php. ini-dist/usr/local/lib/php. ini // copy the file # cd ..
  8. # Tar-zxvf Fedora-Core-1-i386.tar.gz # cp
  9. Fedora-Core-1-i386/usr/lib/httpd/modules/*. so/usr/local/apache/modules/put the module
  10. Add to apache # cp Fedora-Core-1-i386/etc/httpd/conf/workers. properties
  11. /Usr/local/apache/conf // This file is a script for tomcat to work with apache.
  12. Modify
  13. # Tar-zxvf php-4.3.11.tar.gz // unzip file #./configure-- Prefix=/Usr/local/php
  14. With-apxs2=/Usr/local/apache/bin/apxs // normal // After completion,/usr/local/apache/modules
  15. And add a line to the configuration file httpd. conf of // apache.
  16. LoadModule php4_module // modules/libphp4.so # make // compile # make
  17. Install // install

V. Linux Server Configuration

① Configure jdk: to modify the environment variable file/etc/profile, add the following lines to the original file. Export JAVA_HOME =/usr/java/j2sdk1.4.2 exportCLASSPATH =/usr/java/j2sdk1.4.2/lib command # vi/etc/profile. modify the environment variable to save the file. Run # source/etc/profile to make the change take effect immediately. Use the command # java-version to verify the configuration correctness.

② Configure tomcat: This process is complicated and involves several steps.
A. Modify the file web. xml. # vi/usr/local/Jakarta-tomcat/conf/web. xml and put the following part in the web. xml file:

 
 
  1. <! --
  2. <Servlet>
  3. <Servlet-name>Invoker</Servlet-name>
  4. <Servlet-class>
  5. Org. apache. catalina. servlets. InvokerServlet
  6. </Servlet-class>
  7. <Init-param>
  8. <Param-name>Debug</Param-name>
  9. <Param-value>0</Param-value>
  10. </Init-param>
  11. <Load-on-startup>2</Load-on-startup>
  12. </Servlet>
  13. -->
  14. And <! --
  15. <Servlet-mapping>
  16. <Servlet-name>Invoker</Servlet-name>
  17. <Url-pattern>/Servlet /*</Url-pattern>
  18. </Servlet-mapping>
  19. -->

Remove the comments of the two parts to <! --> Remove ). The reason for this step is that the servlet caller switch in Versions later than tomcat 4.1.12 is disabled by default.
B. Modify the file jk2.properties. # Vi/usr/local/tomcat/conf/jk2.properties

 
 
  1. # This file may be overriden at runtime. MAKE SURE TOMCAT IS STOPED
  2. # When you edit the file.
  3. # Comments will be _ LOST _
  4. # Documentation of the format in JkMain javadoc.
  5. # Set the desired handler list
  6. Handler. list=Apr, Request // remove the annotator #
  7. # Override the default port for the socketChannel
  8. ChannelSocket. port=8009// Remove the annotator #
  9. # Default:
  10. #ChannelUnix. file=$ {JkHome}/work/jk2.socket
  11. # Just to check if the config is working
  12. Shm. file=/Usr/local/apache/logs/jk2.shm // manually added
  13. # In order to enable jni use any channelJni direve ve
  14. #ChannelJni. disabled=0
  15. # And one of the following ctictives:
  16. #Apr. jniModeSo=/Opt/apache2/modules/mod_jk2.so
  17. # If set to inprocess the mod_jk2 will Register natives itself
  18. # This will enable the starting of the Tomcat from mod_jk2
  19. #Apr. jniModeSo=Inprocess

Verify whether tomcat works properly. Start tomcat # sh/usr/local/jakarta-tomcat-5.0.28/bin/startup. sh and output tomcat and jdk directories normally.
Start Tomcat and input the ip address and port number of the Linux server in the browser of the windows computer, for example,

③ Configure apache: Because php and jsp must be integrated into apache, apache can be considered as a container.) This step of Linux server configuration is also very complicated. Verify apache before configuration to see if it works properly. The test is similar to tomcat, but you do not need to enter the port number, as shown in

A. Modify the workers2.properties file. The purpose is to make tomcat and apache systems work. Run the command # vi/usr/local/apache/conf/workers2.properties to edit the file: [shm]
Info = Scoreboard. Requried for reconfiguration and status with multiprocess servers.

File =/usr/local/apache/logs/shm. file // the size of this line is changed = 1048576 // manually added # Defines a load balancer named lb. use even if you only have one machine.
[Lb: lb] # Example socket channel, override port and host. [channel. socket: localhost: 8009] port = 8009 host = 127.0.0.1 # define the worker [ajp13: localhost: 8009]
Channel = channel. socket: localhost: 8009 group = lb # Map the Tomcat examples webapp to the Web server uri space

[Uri :/*. jsp] // the jsp script is handed over to the tomcat interpreter. Others are processed by apache. If not, the php script in/usr/local/Jakarta-tomcat/webapps/ROOT cannot be correctly parsed. Thank you for your great help. [Uri:/servlet/*] [uri :/*. do] worker = ajp13: localhost: 8009 // manually added group = lb [status:] info = Status worker, displays runtime information [uri: /jkstatus/*] worker = ajp13: localhost: 8009 // manually added info = The Tomcat/jkstatus handler group = status:

B. modify the configuration file/etc/httpd/conf/httpd of the apache Linux server. conf. # vi/usr/local/apache/conf/httpd. conf, loadModule jk2_module modules/mod_jk2.so // jk2 run DirectoryRoot "/usr/local/Jakarta-tomcat-5.0.28/webapps/ROOT" in apache module mode // default ///var/www/ html "TypeAdd application/x-httpd-php. php3 // Let apache explain the php script //, note. there is a space in front of php3

Vi. Linux server testing

Do some work by yourself *. php and *. copy the jsp file to the directory and start apache and tomcat respectively. # sh/usr/local/apache/bin/apachectl start // start apache (unfortunately not a helicopter) # sh
/Usr/local/Jakarta-tomcat/bin/startup. sh // start tomcat and enter the Linux ip address in the address bar of any computer browser, such as http: // 192.168.0.100/index. jsp,
Http: // 192.168.0.100/index. php. If it can be normally displayed in the browser, congratulations !!!

  1. The Linux server operating system is the main force against Microsoft's "overlord"
  2. Linux desktops should have been using Linux servers five years ago.
  3. Introduction to Ubuntu Linux Server Operating System
  4. Manually release Linux Server Memory
  5. Linux Server (Webmin)

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.