In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the example analysis of crm deployment code in linux, which has a certain reference value, and interested friends can refer to it. I hope you can learn a lot after reading this article.
Linux basic configuration
Python3's linux environment compiles and installs software under 1.linux-the preferred yum tool is convenient to solve the dependency between the software, automatically download and install 1. Configure yum source (that is, a software repository with a bunch of rpm software packages). You can choose Ali Yunyuan. Tsinghua yum source configures the first warehouse, which contains a large number of commonly used system software wget-O / etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo. You also have to configure a second warehouse that carries a lot of third-party software (nginx,redis,mongodb). Mairadb et al.) wget-O / etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo 2. You need to know the yum repository directory cd / etc/yum.repos.d/ # the repo file on the first layer of this directory will be identified and asked yum Software Warehouse 3. Clear the yum cache and centos's official yum software cache yum clean all 4. Generate a new yum cache of Aliyun yum makecache-wget in a resource url command-yum under apt-get ubuntu-use the yum repository, you can not only use a third-party yum repository, but also specify an official yum source (such as the official yum source of the mariadb database, the latest software package)-rpm manual installation, have to deal with dependencies-free choice of version And can extend the installation of third-party functions, called source code compilation and installation.
View dependency module
The requirements.txt file pip3 freeze > requirements.txt# is a module dependency file known to python programmers.
The first step。 Start the mariadb database
Configure yum Feed
1.yum configures yum source yum install mariadb-server mariadb- y 2. How to start systemctl start mariadb # systemctl start/stop/status/restart mariadb 3 through the software installed by yum. Log in to the database cmd login
Export the windows database and import it to the linux machine
Cmd login export command mysqldump-uroot-p se_crm > se_crm.sql # specify database export to se_crm.sql this data file to transfer to linux, import simple use lrzsz tool to transfer or download xftp tool import data command mariadb installation yum install mariadb-server mode 1:1. Create a se_crm database create database se_crm; # command mysql-uroot-p se_crm to import data
< /opt/se_crm.sql #指定se_crm数据库,导入一个sql文件 方式2:登陆数据库之后,用命令导入数据 1.创建一个se_crm数据库 create database se_crm; 2.切换数据库 use se_crm; 3.读取sql文件,写入数据集 mareiadb>Source / opt/se_crm.sql
Step 2: prepare the python3 environment and the virtual environment
Compile and install python3 to resolve environment variables
The way to compile and install python3 under centos7
1. The basic development environment required for compilation must be solved.
Yum install gcc patch libffi-devel python-devel zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel-y
two。 Download the coding package of python3
Decompress
Wget https://www.python.org/ftp/python/3.6.7/Python-3.6.7.tar.xz
Xz-d Python-3.6.7.tar.xz
Tar-xf Python-3.6.7.tar
4. Go to the source folder generated by the decompression
Cd Python-3.6.7
5. Execute the command to compile the trilogy
The first song: find a [configured executable file, configure], execute it, and specify the location of the software installation
. / configure-- prefix=/opt/python367/
The second song: in the previous step, a makefile will be generated, compiled and installed, which must be compiled with the gcc tool under linux, and make when using the command
Make
Song 3: this step is to perform the installation, which will generate a / opt/python367 folder, where all the available interpreters are available.
Make install
6. Configure environment variables to facilitate quick use of python3
1. First get the current PATH variable, and then add the bin directory of python3
Echo $PATH
/ usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/root/bin
two。 Permanently modify the value of PATH
-the first is a soft connection.
-directly modify / etc/profile, the global configuration file of the system, which will be loaded when each user logs in to the system.
Vim / etc/profile
Write a new PATH variable
PATH= "/ opt/python367/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/root/bin"
3. You have to log in again, or read this / etc/profile manually
Source / etc/profile # let the variables in this file take effect
Download the virtualenvwrapper tool
Virtualenvwrapper, an upgraded version of virtual environment tool
1. Install, do not activate the virtual environment
Pip3 install-I https://pypi.douban.com/simple virtualenvwrapper
two。 Modify the configuration file to load the virtualenvwrapper tool every time you boot
1. Open a user's personal environment variable profile
Global profile / etc/profile # takes effect for every user login
User personal profile ~ / .bash_profile
Vim ~ / .bash_profile # root will read the code in this file when you log in
two。 Fill in the following information and modify it for your own python environment
Export WORKON_HOME=~/Envs # sets the unified management directory for virtualenv
Export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages' # add parameters to virtualenvwrapper to create a clean and isolated environment
Export VIRTUALENVWRAPPER_PYTHON=/opt/python367/bin/python3.6 # specify the python interpreter
Source / opt/python367/bin/virtualenvwrapper.sh # execute virtualenvwrapper installation script
3. At this point, you can use this tool to quickly create a virtual environment
Mkvirtualenv virtual environment name # create a virtual environment
Lsvirtualenv # lists the name of the virtual environment
Workon virtual environment name # activate or switch virtual environment
Lssitepackages # lists the module information in the virtual environment, which is
Cdvirtualenv # enter the virtual environment home directory
Cdsitepackages # enter the directory of third-party modules in the virtual environment
Use the mkvirtualenv command to create a new virtual environment to start crm
Mkvirtualenv s23_crm
Copy the crm code to the linux machine
Rz # drag the crm project package to linux,# for decompression
Solve the dependent environment, django and other modules needed for crm operation, and pymysql
Solution 1:
Stupid way, one by one to report mistakes to read, to solve
Pip3 install-I https://pypi.douban.com/simple django==1.11.23
Pip3 install-I https://pypi.douban.com/simple pymysql
Pip3 install-I https://pypi.douban.com/simple django-multiselectfield
Pip3 install-I https://pypi.douban.com/simple django==1.11.23
A less stupid way:
Command to export the python interpreter module
Pip3 freeze > requirements.txt # this requirements.txt file is a module dependency file recognized by python programmers
Install all the modules in this requirements.txt file
Pip3 install-r requirements.txt # specifies dependent file installation and reads all module information in the file
What is Linux system Linux is a free-to-use and free-spread UNIX-like operating system, is a POSIX-based multi-user, multi-task, multi-threaded and multi-CPU operating system, using Linux can run major Unix tools, applications and network protocols.
Thank you for reading this article carefully. I hope the article "sample Analysis of crm deployment Code in linux" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
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.