In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to use Git, and the content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
After there is something wrong with the stupid deployment, how should we build the website? In fact, JD.com Cloud engine itself has given the answer, that is Git. On what Git is we do not introduce too much, it is similar to the role of previous FTP tools such as FlashFXP, but also more powerful than these tools, and understand the site construction friends for FlashFXP such tools must be no stranger, because you want to build the site on the server, you need to use FTP tools.
Guidelines for the full use of Git
So next, we will introduce in detail how to use Git. At the same time, this article takes ZBlog as an example to explain how to use Git, so whether it is Zblog, or WordPress, or Discuz, or a website designed by yourself, you can directly deploy to virtual servers such as JD.com Cloud engine.
All right, let's not talk too much, let's get down to business.
What are the first preparations for the construction of a Git station?
Before using Git to deploy the website, you first need to prepare the following installation files:
1. Go to the ZBlog official website to download the ZBlog package.
two。 Download the Git Bash installation package from JD.com Cloud engine.
3. Search SourceTree to download the installation package.
Secondly, you need to have the following conditions:
1. The virtual server of this tutorial takes JD.com Cloud engine as an example, so you need to have a JD.com account.
two。 Build a PHP application in JD.com Cloud engine.
3. Set up a MySQL database in JD.com Cloud engine.
(for more information, please see "pupils can read and teach you to build a free personal website.")
When these two steps are ready, let's start this tutorial.
There is no more to say about the installation process and method of Git Bash. After you directly click on the installation, you can always take the next step. The interface after Git Bash is installed and opened is shown in the following figure. OMG, how do we use this interface?
The interface after Git Bash is installed, er... How do you use this?
Don't panic, Git Bash is certainly not easy for rookies like the author, but the SourceTree we download can make Git Bash a familiar way to use it. What are you waiting for? Click on the SourceTree installation package to install it.
Fill in the basic information
After starting the installation, you will encounter these interfaces above and below, which can be kept consistent with the author except for the custom filling in of the user information.
You can choose PuTTY/Plink by default.
Hosting service provider you can fill in if you have, no and no impact, just click finish. However, after clicking, you will be prompted to test the hosting service provider, so just click and skip it. In addition, during the installation process, you may be asked if you want to load a SSH key, which can be skipped without adding it for the time being.
If you don't have it, click the finish button directly.
Just upgrade and install it.
If the above dialog box appears during installation, select the option marked in the red box. The installation of SourceTree and Git is very simple. SourceTree is actually a graphical client of Git. With SourceTree, we don't have to worry about the imperative operation of Git. After installation, open the SourceTree client and leave it.
How to establish the connection between Git and JAE?
Next, let's go to JD.com Cloud engine (JAE). The previous article on how to use Cloud engine has been very clear (please still refer to: "Primary School students can read and teach you to build a free personal website"). I won't repeat it here.
After entering Cloud Rock, you need to build a PHP application, because ZBlog, an example of building a site in this article, is also available in PHP.
First click the "New App" button in the upper right corner of the image below, select the second PHP app in the pop-up page, and then feel free to fill in the secondary domain name below. After it is established, it will look like the following, and at the same time to see if the state is normal, if it is normal, you can move on, and if it is not normal, you can build it a few more times (it is really the only way).
Go to JD.com Cloud Rock to create the PHP application, and then click the Git address "Click to visit" under step 2.
After establishing the PHP application, we click on the "Git address: click to access" text chain identified by the figure 2 above. You will then go to the code base page you created, as shown in the following figure:
Go to the code base page (there are not so many files initially)
The newly established code base does not have as many files as shown in the figure above, so there is no doubt that there are only three files such as readme.txt and index.php at the beginning. Click your user name on this page, for example, the author's user name is "yinhangwwq". After clicking, you will go to the page shown below:
Click ssh Management, and then click add
After entering this page, first click the "ssh Management" tab, then you can see the green "add" button, and then click the add button to go to the next page.
Open SoureTree, click "Clone / New" in the upper left corner, and click "create New Warehouse" in the right dialog box.
Let everyone open SourceTree before, no cheap off, right? Let's go back to SourceTree, first click the "Clone / New" button marked in the red box in the upper left corner, then the right dialog box pops up, and click the "create New Warehouse" button on the right dialog box. Then you can create a warehouse directory on your hard drive, for example, in the CDN folder in the JAE folder of the D disk. After selecting the appropriate path, click the create button.
Once established, you can unzip the ZBlog package you downloaded earlier to here.
Create a SSH password
After creating the new warehouse, locate the tools button on the SourceTree toolbar and click create or Import SSH password in the drop-down menu. After clicking, the dialog box shown in the following figure will pop up:
Click the Generate button
Click the "Generate" button in the dialog box, and then a green progress bar will pop up. SSH has been generated for a long time, so be patient for a while.
You may have some questions about the "new warehouse". What is a warehouse? In fact, it is very simple, since you want to build a website, then you need to put the documents involved in the website in one place, and this warehouse is actually the place where your website files are stored. Then some friends may ask, what is the SSH key? I just want to say please Baidu, this is not our focus.
Brand: Asustek laptop 3 how to configure the code base key?
How do I configure a code base key?
After reading the progress bar, you will see the dialog box shown in the following figure. At this time, you should first Copy the contents of the SSD key identified by the number 1, and it is best to put it in the TXT to avoid tragedy. Then click the Save Private Key button identified by the number 2 to save your key, the Key file name can be set by yourself, the location to save must be remembered, do not forget where to save it.
Copy the code shown in the code box in step 1, then save the code in step 2 and remember where to save it
Do you still remember the SSH add page that I asked you to open here? As shown in the following figure, paste the SSH key of your Copy into the public key bar and choose the name yourself. After filling it out, click Save.
Paste the previous code into the public key bar of the ssh add page, and click Save.
After saving it, let's go back to SourceTree, and the key dialog above can be turned off if it is not closed. Please click the option button under the tool button at this time.
Click the tool → option button
Add SSH key
After clicking the option button, you will see the above dialog box, and all the check boxes are consistent with the author. SSH key part, please click the button on the right, find you just saved to the local key file to add, after these things are done, please click on the lower right corner of the place blocked by ZOL watermark "OK" button, to this step, the local code base, as well as the local SSH key and server SSH key connection has been completely done.
The next step is how to use Git to build a website.
Deploy the website to a virtual server
Of course, the construction of a website here does not teach you how to design a website, but through some free resources available, it will certainly be more interesting if you understand Dreamwaver and can make a website on your own. at the same time, you do not need to read this article for beginners.
At present, the common free website resources include the WordPress introduced earlier, the ZBlog used as an example this time, and the Discuz of the forum. According to the author's actual test, JD.com Cloud Rock's current support for Discuz is not very good, and many Discuz permissions are not fully open. Although it can be deployed smoothly, it is troublesome to modify some code and files if it is fully installed. However, at the time of the release of this article, JD.com Cloud engine may have been able to support the one-click installation function of Discuz, if there is no support, then it is not far from support.
With so much nonsense, let's go back to the content of this article. Once the Git is set up, we can go to the website to deploy. Before you do that, you need to download ZBlog's zip file, WordPress, Discuz and other free resources.
Copy the address in the lower right corner of the code base
The first step is to return to the code base page (your associated code base, of course, rather than anything else, this time the author is related to the jae_zolzblog code base). There is an address in the lower right corner where it is again covered by the ZOL watermark, and copy it.
Clone warehouse
In the second step, let's return to SourceTree, click the "Clone / New" button in the upper left corner, open the dialog box on the right, select the clone repository, and paste the copied address here in the address bar on the right side of the source path / URL.
After that, SourceTree will be automatically detected, and an account name / password input dialog box will pop up. Enter your JD.com Cloud engine account / password at this time. Here, I would like to remind everyone that if you have concerns about the security of your account, it is recommended to apply for a new account.
Fill in the account password and it will be tested in a moment, then click the "Clone" button in the lower right corner.
After cloning, it will be displayed in the left column (as marked in the red box)
After cloning, you will see your code base name in the left column. At this point, we need to do the third step, right-click your code base name, and a dialog box will pop up. Then click the "Open in Explorer" option.
Right-click the warehouse name, and then click "Open tab in Explorer"
Clicking on it will bring up the folder page shown below, which you automatically created under disk C after you cloned the repository. After opening it, first find the ZBlog package you just downloaded, then unzip the package to get the files inside, and then copy the files in the root directory to the folder opened by Explorer (the folder shown in the following figure).
It should be noted here that the files copied in must be the root directory and do not have any folders. In addition, do you see a red .ico file in the following picture? This file can be replaced with the icon you want.
Copy the file to the folder opened by Explorer
At this stage, there is only the final sprint from the construction of the website. Although it may be troublesome to read the tutorial for the first time, after you have mastered the method of using it, you will find that it is very simple and convenient to deploy the website in Git, and it is also very convenient to manage. After any changes to the website files, you only need to drag the modified content here. Then upload through Git will be able to make changes directly, very convenient, we will slowly understand this point after mastering it.
Enter the final sprint.
Due to some unexpected situations, the author hung up the computer in the course of operation, resulting in the loss of some pictures. At present, the computer is still under maintenance, so take the screenshot of the previous Discuz to use temporarily. Although the code base has changed, the specific method of operation is the same.
For example, in the figure below, you can see that the zblog code base I built earlier is gone in the left sidebar, but this does not affect the next steps.
After copying the files in the compressed package of the website to the folder opened by the explorer above, you can click the "add / delete" button in SourceTree. Ignore the pop-up query dialog box, just click OK.
Start uploading website files
After clicking on it, you will see a progress bar, and you can wait a little longer to complete the addition. After that, you will see that the "submit" button on SourceTree (in the red box below) is lit, and you can click submit without hesitation.
The "submit" button in the red box in the upper left corner lights up
After clicking submit, your website has been deployed in JD.com Cloud engine. In fact, to put it bluntly, it is to upload the files in the website compression package to JD.com Cloud engine's database. After the submission is completed, you will see that the "push" button marked in the red box below shows a number. Don't panic, click the push button to upload the remaining files that have not been fully uploaded.
Click to push the rest of the files.
After uploading, you can go back to JD.com Cloud Rock's code base and check it. As shown in the following figure, you can see that all the files in the compressed package have been uploaded to JD.com Cloud Rock code base.
These are all the documents that make up your website.
Click to access, or enter the HTTP address directly to access
After confirming that the website files have been deployed, go back to the application list page shown above, and then click "Click to visit" marked in the red box to log in to the site you have built. Of course, you can also directly enter your website domain name on the browser to access, for example, the author's secondary domain name is zolzblog.jd-app.com.
In addition, some friends asked if they could not use the domain name of jd-app.com, of course, but you need to rent another server and map the address to JD.com Cloud engine.
How to configure a built website?
Some friends may encounter the following page when they visit the website for the first time. What should I do? Also, don't panic. If you encounter this situation, go back to Jingdong Cloud engine's application page, find the quick deployment and quick restart button on the right side of your application, deploy it quickly, and then restart the application. After the waiting status shows "normal", the problem should have been solved. If it hasn't been solved, it will be better to repeat the reboot a few times.
When this page appears, click Quick deploy App and then restart the App.
Normally, after setting up the ZBlog, you will go to the page shown in the following figure, and seeing this page shows that you have succeeded. Next, let's go to the installation of ZBlog:
ZBlog installation
ZBlog installation
Just take a look at the previous two steps, and clicking the next step twice will take you to the page shown below. The method of filling out the form has been described in detail in the article "pupils can read and teach you to build a free personal website". Let's talk about it briefly this time.
First of all, the item of database host is consistent with the author. The table prefix does not need to be changed, but the default is fine.
Secondly, the user name, user password and database name need to go to the "Cloud Database" page of Jingdong Cloud Rock to find the corresponding database name, then click the database name, copy the corresponding content on the pop-up page and paste it here. (if you still don't understand, please refer to the last two pictures of "pupils can read and teach you to build a free personal website.")
Finally, the five items under the website settings (website name, user name, password, etc.) are free to fill in according to preferences and habits.
ZBlog installation
ZBlog installation
After filling in, click next to go to the page shown above, and then click finish to OK.
When you are finished, you will go to the home page of ZBlog, which is actually similar to WordPress. There is not much to say.
ZBlog initial page
Optimize yourself after logging in.
After logging in to your own account, you can manage ZBlog. It is convenient and intuitive to use in the background, and you can download more topics directly through the theme management options. However, most of the good themes in ZBlog are free of charge. Compared with WordPress, you feel that it is more convenient to use. With regard to the use of ZBlog, I think there is no obstacle for everyone to explore by themselves, so I won't say much here.
About the use of Git is how to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.