Home WeChat Applet Mini Program Development How to build a WeChat mini program server locally

How to build a WeChat mini program server locally

May 11, 2018 pm 01:39 PM
Applets server program

This article mainly introduces the relevant information on the implementation method of building a WeChat applet server locally. I hope this article can help everyone to easily build their own WeChat applet server. Friends who need it can refer to it. I hope it can Help everyone.

How to build a local WeChat applet server

Now development requires purchasing a server, which is still a bit expensive. You can build a server at a small cost. Used to develop small programs, blogs, etc.

1. Domain name (registered)
2. Alibaba Cloud registers a free https certificate
3. Configure local nginx
4. Intranet mapping (locally install wampserver server)

1. Domain name

Register Peanut Shell. It costs 8 yuan to activate intranet mapping (I needed it when I activated it, but I don’t know if I still need it now). You can register 2 in it. Free domain names are free of registration. For specific information, please refer to Baidu, peanut shell registration address

2. Apply for Alibaba Cloud’s free https certificate

Alibaba Cloud’s free https certificate address

This step is relatively simple, and there are not many things to pay attention to. Follow the official instructions of Alibaba Cloud, and the operation will be successful. It is worth noting that when you apply for a certificate, the certificate is free and you do not need to pay, but you need to place an order. After the order is placed, you need to complete your domain name information and then submit it for review. After the review is completed, the official will automatically issue you a certificate, which can be done within an hour if everything goes well.


Note:

1. Through the peanut shell, the intranet maps the local access address

2. After filling in the domain name of the Alibaba Cloud certificate completion information, Alibaba Cloud will enter the review process and you need to download one of its fileauth.txt files

i. On the progress query page, click the fileauth.txt verification file and download it locally.

ii. Create .well-known/pki-validation in the root directory of your site server. The Windows command to create the folder is md ".well-known" subdirectory pki-validation.

iii. Upload the fileauth.txt verification file to the directory under the .well-known/pki-validation directory. Once completed, it can be accessed through the verification URL address (http://a.com/.well-known/pki-validation/fileauth.txt). Refer to how to configure domain name authorization verification?

3. Configure local nginx (mainly Apache’s https configuration is too cumbersome)

Download the certificate file

image.png
Configure the nginx.conf file in nginx. The certificate should be placed in the conf/cert directory. The specific code

server {
 listen 443;
 server_name 11.168.1.150;
 ssl on;
 root "D:/works/wamp";
 charset utf-8;
 index index.html index.htm;
 ssl_certificate cert/214296869710097.pem;#替换成你的文件
 ssl_certificate_key cert/214296869710097.key;#替换成你的文件
 ssl_session_timeout 5m;
 ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
 ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
 ssl_prefer_server_ciphers on;
 location / {
  root "D:/works/wamp";
  index index.html index.htm index.php;
  proxy_pass http://11.168.1.150:8081;
 }
}
Copy after login

4. Configure the intranet mapping of Peanut Shell

Note:

The mapping of Peanut Shell cannot be set to the mapping of port 80 (I have not found the reason, the customer service feedback is To set a custom port)

After success, the address for external access

After the last configuration is successful, Request the effect now!

Related recommendations:

an example of node building a server through express

One Notes tutorial for novices to build a server from scratch

Nginx+Tomcat+Redis+NFS to build a server cluster

The above is the detailed content of How to build a WeChat mini program server locally. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to make Google Maps the default map in iPhone How to make Google Maps the default map in iPhone Apr 17, 2024 pm 07:34 PM

The default map on the iPhone is Maps, Apple's proprietary geolocation provider. Although the map is getting better, it doesn't work well outside the United States. It has nothing to offer compared to Google Maps. In this article, we discuss the feasible steps to use Google Maps to become the default map on your iPhone. How to Make Google Maps the Default Map in iPhone Setting Google Maps as the default map app on your phone is easier than you think. Follow the steps below – Prerequisite steps – You must have Gmail installed on your phone. Step 1 – Open the AppStore. Step 2 – Search for “Gmail”. Step 3 – Click next to Gmail app

How to solve the problem that eMule search cannot connect to the server How to solve the problem that eMule search cannot connect to the server Jan 25, 2024 pm 02:45 PM

Solution: 1. Check the eMule settings to make sure you have entered the correct server address and port number; 2. Check the network connection, make sure the computer is connected to the Internet, and reset the router; 3. Check whether the server is online. If your settings are If there is no problem with the network connection, you need to check whether the server is online; 4. Update the eMule version, visit the eMule official website, and download the latest version of the eMule software; 5. Seek help.

Solution to the inability to connect to the RPC server and the inability to enter the desktop Solution to the inability to connect to the RPC server and the inability to enter the desktop Feb 18, 2024 am 10:34 AM

What should I do if the RPC server is unavailable and cannot be accessed on the desktop? In recent years, computers and the Internet have penetrated into every corner of our lives. As a technology for centralized computing and resource sharing, Remote Procedure Call (RPC) plays a vital role in network communication. However, sometimes we may encounter a situation where the RPC server is unavailable, resulting in the inability to enter the desktop. This article will describe some of the possible causes of this problem and provide solutions. First, we need to understand why the RPC server is unavailable. RPC server is a

Detailed explanation of CentOS installation fuse and CentOS installation server Detailed explanation of CentOS installation fuse and CentOS installation server Feb 13, 2024 pm 08:40 PM

As a LINUX user, we often need to install various software and servers on CentOS. This article will introduce in detail how to install fuse and set up a server on CentOS to help you complete the related operations smoothly. CentOS installation fuseFuse is a user space file system framework that allows unprivileged users to access and operate the file system through a customized file system. Installing fuse on CentOS is very simple, just follow the following steps: 1. Open the terminal and Log in as root user. 2. Use the following command to install the fuse package: ```yuminstallfuse3. Confirm the prompts during the installation process and enter `y` to continue. 4. Installation completed

Clock app missing in iPhone: How to fix it Clock app missing in iPhone: How to fix it May 03, 2024 pm 09:19 PM

Is the clock app missing from your phone? The date and time will still appear on your iPhone's status bar. However, without the Clock app, you won’t be able to use world clock, stopwatch, alarm clock, and many other features. Therefore, fixing missing clock app should be at the top of your to-do list. These solutions can help you resolve this issue. Fix 1 – Place the Clock App If you mistakenly removed the Clock app from your home screen, you can put the Clock app back in its place. Step 1 – Unlock your iPhone and start swiping to the left until you reach the App Library page. Step 2 – Next, search for “clock” in the search box. Step 3 – When you see “Clock” below in the search results, press and hold it and

How to configure Dnsmasq as a DHCP relay server How to configure Dnsmasq as a DHCP relay server Mar 21, 2024 am 08:50 AM

The role of a DHCP relay is to forward received DHCP packets to another DHCP server on the network, even if the two servers are on different subnets. By using a DHCP relay, you can deploy a centralized DHCP server in the network center and use it to dynamically assign IP addresses to all network subnets/VLANs. Dnsmasq is a commonly used DNS and DHCP protocol server that can be configured as a DHCP relay server to help manage dynamic host configurations in the network. In this article, we will show you how to configure dnsmasq as a DHCP relay server. Content Topics: Network Topology Configuring Static IP Addresses on a DHCP Relay D on a Centralized DHCP Server

Best Practice Guide for Building IP Proxy Servers with PHP Best Practice Guide for Building IP Proxy Servers with PHP Mar 11, 2024 am 08:36 AM

In network data transmission, IP proxy servers play an important role, helping users hide their real IP addresses, protect privacy, and improve access speeds. In this article, we will introduce the best practice guide on how to build an IP proxy server with PHP and provide specific code examples. What is an IP proxy server? An IP proxy server is an intermediate server located between the user and the target server. It acts as a transfer station between the user and the target server, forwarding the user's requests and responses. By using an IP proxy server

Can't allow access to camera and microphone in iPhone Can't allow access to camera and microphone in iPhone Apr 23, 2024 am 11:13 AM

Are you getting "Unable to allow access to camera and microphone" when trying to use the app? Typically, you grant camera and microphone permissions to specific people on a need-to-provide basis. However, if you deny permission, the camera and microphone will not work and will display this error message instead. Solving this problem is very basic and you can do it in a minute or two. Fix 1 – Provide Camera, Microphone Permissions You can provide the necessary camera and microphone permissions directly in settings. Step 1 – Go to the Settings tab. Step 2 – Open the Privacy & Security panel. Step 3 – Turn on the “Camera” permission there. Step 4 – Inside, you will find a list of apps that have requested permission for your phone’s camera. Step 5 – Open the “Camera” of the specified app

See all articles