"SSH online Mall project Combat 27" domain name space application and project deployment and release

Source: Internet
Author: User
Tags buy domain

In front of the continued completion of the online shopping mall some basic functions, although there are many places to be perfected, but does not affect the deployment and release of the project, we can first play, this section mainly introduces the application of the domain name space and the deployment and release process of the project.

1. Application of domain name space

As a great dick Silk, certainly no money to buy domain space, it is natural to think to apply for a free, now free domain name space is also a lot, I applied for a trial period in the best JSP technology online is 15 days, we can also go to apply for a play, anyway as learning, which is enough, of course, If you want to pay for a long-term affirmation. The registration process I cut a few diagrams, as follows:


Then next, the final opening is as follows:

Suggest that the above information with a TXT document, especially the domain name, there are some temporary application information, because it is not long-term use, may not notice, the next day to land, found that may even the simplest login user name password forgot yo hello ... To have the habit of recording important information at any time, to have the habit of recording important information at any time, to have the habit of recording important information, important things to say three times, you understand ~
Then click into the JSP Control Panel, which has a lot of information related to the application of the account, you can go to see, the following our project deployment is also deployed here. As follows:

There are several important information to be recorded, such as: the domain name is needless to say, theweb directory , this is our project finally deployed to the server after a directory, the server's IP to remember, this to the back to know what is the use of.
Here, we have applied for 15 days of free space, and he also sent the domain name and database, then we will start to deploy our own projects.

2. Deployment and release of projects

Although we have applied for the domain name space, but not directly throw our project up on the line, first of all we certainly can not directly throw the project's source code, and secondly, even if the source is still up, OK can run? The answer must be no, there are places in the local project that need to be changed. Next, I'm going to go over this project to make a specific description of what needs to be changed.

2.1 Local Project + Local database test   

Just at the time of application, he gave us the web directory, this is very important, that is, when we deploy the project to his server, he gave the directory below the root directory, this root is the default root directory, if we directly put the code to be passed to root, we can directly use http://域名/ To visit the. If there are other subdirectories, it needs to be http://域名/子目录/ accessed.
So, first we have to test locally, throw the project code into the local tomcat root can run, first redeploy the project E_shop (my project name), then open the Tomcat server, and then see the Tomcat directory \webapps\ The directory has root and e_shop two directories, this is the Earth people know, and then turn off Tomcat, e_shop everything in the copy, paste into root (turn off Tomcat and then copy paste, or else may report a wrong, mine is), Then will be deployed under the Tomcat server E_shop kill (do not kill can ~), restart Tomcat, and then enter in the browser: http://localhost:8080/E_shop/index.jsp hang up, because I just killed the tomcat under the E_shop (not to kill the words are accessible), input http://localhost:8080/index.jsp will be able to access the normal, indicating that I put the original e_shop in the root of the thing can be directly access to the domain name (because index.jsp can be omitted). It is not a problem to explain this local test.
"Note" In the Tomcat Directory project is a class file and some JSP files, there is no source Java files, so the following if we use FTP upload is also a tomcat under the project directory under all the files.

2.2 Local Project + remote database testing

OK, just in the local test is normal, this has nothing to do with the remote, and now we want to use the remote database testing, the remote database is just registered when he sent the database, including the database name and the user name password used to connect to us, you just remember it?
When we develop with myeclipse, we use the DB browser window and the SQL Result window, which makes it easy for us to connect to the database in MyEclipse and view the data in the database (if you don't know these two gadgets, you can take a look: Struts2, Hibernate4 and Spring4 integration), we create a new connection in DB Browser, as follows:
  
We can see, here we create a new connection is to connect just he gave us the remote database, the URL, user name and password are he gave us, after the successful connection, we want to test the remote database can be inserted in our own database data, So I'm going to copy all the contents of my project Shop.sql file to the new Remote.sql, open the Remote.sql to connect the newly built remote database driver, execute all the commands in the SQL file, if you can The result window sees that the same information is inserted in the database stating that the connection was successful and that it works as expected.
OK, the remote database connection, the next thing to do is to modify the connection database configuration file, because we are currently local configuration file is connected to the local database, so certainly not, we deployed the project, he should automatically connect to the remote database, And then the data is read and written in that remote database. Let's take a look at the local database connection configuration file Conn.properties:

Datasource=com.mchange.v2.c3p0.combopooleddatasource
Driverclass=com.mysql.jdbc.driver
Jdbcurl=jdbc:mysql://localhost:3306/shop
User=root
Password=root

We create a new remote.properties:

Datasource=com.mchange.v2.c3p0.combopooleddatasource
Driverclass=com.mysql.jdbc.driver
Jdbcurl=jdbc:mysql://115.238.249.172:3306/sq_eson
User=sq_eson
password=squ138

The basic parameters are given to us so that we can connect to the remote database and modify the configuration in Beans.xml:

<Bean class=" Org.springframework.beans.factory.config.PropertyPlaceholderConfigurer ">        < property name="Locations">            <array>                <!--<value>classpath:conn.properties</value> --                <value>Classpath:remote.properties</value>            </array>        </Property >     </Bean>

Here you can appreciate the benefits of using the properties configuration file, if you want to modify only need to modify the configuration file, do not change the program in large areas of the original things! In addition to a friendship hint, try not to delete the original, such as Conn.properties file, because the project later if you want to change, testing time or in the local, as far as possible to do not delete, if you can comment on the comment off, do not affect the words should not be deleted, unless not deleted.
After the above modification, the project will automatically connect to the remote database after the start, then we open the Tomcat server, opened the homepage, select a product, click to Buy, of course, do not pay, click on the purchase will be put into storage, We can check whether the remote database has added a new shopping information can be judged normal. Here we have completed the local project + remote database testing, no problem is going down.
  

2.3 Modifying the contents of a local project that was originally written dead

This is very well understood, because originally we write the project in order to facilitate testing, some places directly to the data to test the function is normal. This has to be combined with their own actual project to determine, such as my online Mall project, before the e-mail and send text messages are my own email address and mobile phone number, so now to generate a user in the user table, mail and mobile phone number are filled their own, when the deployment is finished I use this user login to buy, Then I will be able to receive e-mails and text messages, etc., there is the purchase is finished after the order to update the status of the payment, I have been testing is just a random meaning, these details should be noted , there is a change in the price of a commodity of 0.01 yuan, because after deployment to test whether the function is normal, if the price is hundreds of thousands of, has been crying in the toilet ~ In addition, my project has a place, is to add the product will have a product image saved to a server address, We have to change to the corresponding directory on the remote server:

#原来的basePath注释掉#basePath=E\:\\web\\apache-tomcat-8.0.26\\webapps\\E_shopbasePath=E\:\\www1\\eson-0b44449e54c855b40154dbd2b0b906d9\\webapps\\ROOT\\filePath=\\filesbankImagePath=\\files\\bankImages

So at the time of development, if a place later needs to be modified, at that time is to test the convenience of manually give a parameter and so on, it is best to have a note in the corresponding location, in order to facilitate the post-deployment of the time to modify, otherwise it will definitely fall off the back.

3. Uploading Project Files

Preparation work is done, the next step is to upload the project files, here are mainly two ways to upload: FTP upload and the provider's website online upload.

3.1 FTP upload

FTP is a file upload protocol, you can upload files to a specified location or download files from a specified location (provide free, inside cracked key), FTP upload is relatively simple, but the time may be a little longer, recommended 1.1 points of transmission, so that data can not easily lost. Let me introduce the FTP upload process:

  • Copy the deployed project from the Tomcat directory to the desktop, for example, my project is E_shop
  • Open FTP upload software, select Desktop \e_shop on the left, navigate to the project directory below
  • Configure the address you want to upload to the right, as shown in
  • Then drag the left file to the right window to complete the upload

Let's take a look at the FTP upload interface, the main step is to see the third link above:

Connection is ready to upload, note: After the connection, the right window to locate the root directory, can not locate the wrong. Then slowly wait to pass the good, and then directly access the domain name provided in the previous application can be accessed.

3.2 Online uploads

Just registered, you can upload in the JSP Control Panel, but this requires that we first export the project as a war package, and then upload the war package, export the project as a war package is very simple, in MyEclipse click File->export-> Input War, Then select the location you want to export (select Desktop) and you can export it successfully. Then let's look at the online deployment of the good luck JSP technology to us as follows:

Next you can directly use the domain name to access the project has just been deployed, when the page pop out that moment, that pleasure, not the Tokyo thermal gave the ~ ~ Of course, can not preach the whole project, or even only a index.jsp play a, see the effect, go down the process also line ~
Well, the application of the domain space and the deployment of the project is introduced here! I will go back to the simple improvement of some places, almost can upload source code.
  
(Note: To the end to provide the entire project source code download!) Welcome to our collection or attention)
Related reading: http://blog.csdn.net/column/details/str2hiberspring.html

-Willing to share and progress together!
-More articles please see: http://blog.csdn.net/eson_15

"SSH online Mall project Combat 27" domain name space application and project deployment and release

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.