### Introduction: This experiment is based on the Mac environment test, server purchase, configure nginx, etc. Please see my other article portal, follow the operation, this is to prepare for the future. 🤡

Now that the portal is configured, we can prepare the other environments that need to be configured.

1. To configure the Swift environment on Ubuntu 16.04, visit 👉Swift official website

Copies of the connection

2. After reading the portal article, let’s go ahead and open the remote connection with the Mac terminal and type in the following code, which can be copied and pasted.

~$ wget https://swift.org/builds/swift-4.1.1-release/ubuntu1604/swift-4.1.1-RELEASE/swift-4.1.1-RELEASE-ubuntu16.04.tar.gz
Copy the code

Unpack when done

~$ sudo tar xzf swift-4.1.1-RELEASE-ubuntu16.04.tar.gz
Copy the code

3. Install the Clang

~$ sudo apt-get install clang
Copy the code

4. Set Swift environment variables

~ $echo "The export PATH = ~ / swift - 4.4.1 - RELEASE - ubuntu16.04 / usr/bin:"${PATH}"" >> ~/.profile

~$ source ~/.profile
Copy the code

5. Check the Swift version

~$ swift --version
Copy the code

6. Install Perfect’s dependencies

~$ sudo apt-get install openssl libssl-dev uuid-dev
Copy the code

7. Clone Perfect’s github template project

~$ git clone https://github.com/PerfectlySoft/PerfectTemplate.git
Copy the code

Sudo apt-get install git sudo apt-get install git sudo apt-get install git

8. Prepare to compile the project

~$ sudo apt-get install libcurl4-openssl-dev
~$ cd PerfectTemplate
~$ swift build
Copy the code

Perfect template project, the first compilation will wait a little under……

Above 👆 is the second time to come in, there is no need to add
swift buildThe effect of
~$ .build/debug/PerfectTemplateIt will appear when it’s done
Starting HTTP server on 0.0.0.0:8181At this point in Safari we access our domain name (add :8181): http://www.crios.cn:8181

If Hello, World! Is not set up port 8181 problem, you can visit my other article -> Swift + Perfect in Ubuntu to solve the problem of not accessing port 8181