Cat learn iOS (56) Network basics and how to build a server

Source: Internet
Author: User

Cat Share, must boutique

Original articles, welcome reprint. Reprint Please specify: Sanayu's Blog
Address: http://blog.csdn.net/u013357243?viewmode=contents

One: Why to learn network programming

On this question, why to learn the network programming, Cat's understanding is that this thing is the development of the times necessary, nothing, is to learn, unless you want to play a stand-alone, but it is a single machine will also have to buy coins and other network needs, simply speaking, with the network, so you are no longer a person in the fight.

Network programming is a kind of common method to update application data in real time.
Network programming is the precondition and foundation of developing excellent network application.
In short, network programming is very important, must learn, must learn.

Second: The first knowledge of network 1: The basic concepts to remember

There are several basic concepts that must be mastered in network programming.

Client: Mobile apps (apps like IOS, Android, etc.).

Server: A machine that provides services to clients, provides data, and provides resources.

Request: A behavior of the client requesting data from the server.

Response (Response): The response of a server to a client's request generally refers to returning data to the client.

As a mobile development engineer, the main focus is on the front-end development, which is the fruit mobile phone operation of those.

2: Server

A: Classification of servers

According to the software development phase, the server can be roughly divided into 2 kinds of

(1) Remote server

Aliases: Extranet servers, official servers

Use stage: The server used after the app is online

Use the crowd: for all users

Speed: Server performance, user's speed

(2) Local server

Alias: Intranet server, test server

Use stage: Apply a server that is in use during development and testing

Use the crowd: for internal developers, testers only

Speed: Because it is a local area network, it is fast and helps to improve the efficiency of development testing

B: choice of local server

If you are in the learning and development phase, you can build a local server

(1) What kind of local server do you choose?

In the company development phase, already has the specialized backend personnel development Server program, cannot help you choose

In the learning phase, choose what local server can be, can be used on the line

(2) In order to easily start the Java server on the Mac, there are roughly the following steps

1) Install JDK (Java development Kit)

2) Install Java Development tool: Eclipse:http://www.eclipse.org/downloads, choose 64bit, Java EE version of the

3) Write a set of server programs using Java

4) Configure the server's container: Apache tomcat:http://tomcat.apache.org/download-60.cgi

5) Launch Apache Tomcat

C: Host address of the local server

The host address of the local server is generally written in 3 ways:

(1) 127.0.0.1: The IP address built into each machine refers to the machine itself.

(2) localhost: 127.0.0.1 equivalent to the 1th case

(3) switch \ Router assigned IP address: True machine test must use this, and the real machine and the server in the same LAN.

Building a local server

The first step: Prepare the relevant software:

apache-tomcat-6.0.41.tareclipse-jee-kepler-SR2-macosx-cocoa-x86_64.tar.gzjdk-8u5-macosx-x64.dmg

Step Two: Install Eclipse:
1: Make a plain English path to the folder.
2: Put eclipse-jee-kepler-sr2-macosx-cocoa-x86_64.tar.gz in the folder and double-click to open, he will antidote to the current directory.

3: Install JDK:

4: Open Eclipse

5: Set Workspace (Full English path)

6: Start importing the project and put MJ's written code into it (if you're not sure if you write Java EE, the cat will use it on the back of MJ.)

7: Import Project from Eclipse:

8: After importing the project, the project error and the format is garbled, the following adjustments.

9: Configure the Tomcat server:
Put the downloaded Tomcat decompression into the full English path:

Open servers


Click OK to create a new container

The path to the selection container is the file path of Tomcat

After success:

10: Start the server in debug mode

11: Load Project:
See the last red number in the background no, that thing Tomcat start time

12: At this time we can visit our site:
Firefox input: Http://192.168.1.53:8080/MJServer
Or: Http://127.0.0.1:8080/MJServer

Cat learn iOS (56) Network basics and how to build a server

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.