Next, let's take a look at some details about the Debian 7 server migration and reconfiguration of the Web service. I hope this article will be helpful to you.
First, install the compilation environment. Although we can easily bypass manual compilation through apt-get, some packages may have built-in compilation commands to compile some extensions, if the compilation environment is not installed, these extensions will become invalid. The following command is usually used to directly install the development and compilation kit:
| The Code is as follows: |
Copy code |
Apt-get install build-essential
|
Because some apps are developed in Python, and the packages it depends on include extensions that can improve performance, the following error occurs during compilation:
Src/XXX. c: 31: 20: fatal error: Python. h: No such file or directory
Compilation terminated.
Error: command 'gcc 'failed with exit status 1
The reason is that we have not installed the Python development environment. Use the following command to solve this problem.
| The Code is as follows: |
Copy code |
Apt-get install python-dev
|
Because MySQL is used, we also need to install the MySQL database. When we use the apt-get command to install the MySQL database, we also need to install the corresponding modules for Python. Otherwise, an error will be reported as follows:
No module named MySQLdb is solved by the following installation command:
| The Code is as follows: |
Copy code |
Pip install mysql-python
|
However, the problem persists. When configuring MySQL-Python, an error is returned:
EnvironmentError: mysql_config not found MySQL installed by apt-get does not contain the development file by default, while mysql_config is located in the Development file. You can install the following package to solve this problem:
| The Code is as follows: |
Copy code |
Apt-get install libmysqld-dev libmysqlclient-dev
|
In addition, a small problem in the Pyramid framework is that import zope. deprecation reports ImportError: No module named deprecation error. You can reinstall zope. deprecation to solve the problem:
| The Code is as follows: |
Copy code |
Pip -- force-reinstall -- upgrade zope. deprecation
|
Well, record it here for a long time.