Linux Virtual machine Configuration development/server Environment complete
9. CentOS Upgrade Git
Http://www.cnblogs.com/grimm/p/5368777.html
A.
Download the git2.2.1 and add git to the environment variable
># wget https://github.com/git/git/archive/v2.2.1.tar.gz
># tar zxvf v2.2.1.tar.gz
># cd git-2.2.1># make configure
># ./configure --prefix=/usr/local/git --with-iconv=/usr/local/libiconv
># make all doc
># make install install-doc install-html>
# echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
># source /etc/bashr
B.
This error occurred while installing the Perl module:
Can ' t locate extutils/makemaker.pm in @INC
Here's how to fix it:
1234567 |
Cd/rootwget Http://files.directadmin.com/services/9.0/ExtUtils-MakeMaker-6.31.tar.gztar Xvzf EXTUTILS-MAKEMAKER-6.31.TAR.GZCD Extutils-makemaker-6.31perl Makefile.plmakemake Install |
C.
If you have an error in the previous step
Yum Install Perl-extutils-makemaker
D.
Also will be error, tip not to curl
For CentOS, use Yum to install curl after developing the relevant library:
$ yum Install Libcurl-devel
E. Unable to find AsciiDoc, note add path
wget http://sourceforge.net/projects/asciidoc/files/asciidoc/8.6.9/asciidoc-8.6.9.tar.gz
F. And a lack of bags
Yum Search XSLTPROC
Then install, add environment variables ...
G. warning:failed to load external entity "http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"
Prompt to have an address file not found, workaround:
yum-y Install docbook-style-xsl
H. #yum-y install Xmlto
Otherwise the compilation does not pass:
/bin/sh:line 1:xmlto:command not found
I. Git init prompt???? , and did not create a successful
chmod 777 folder used because the current user does not have permissions
At last finally ....... ..... It's going to work.
8. Deploying Flask
Encounter problems 1:uwsgi prompt cannot load configurtion from Xx.ini This configuration file can not be called Uwsgi class file name, called Myxx.ini Bar 2. Prompt cannot find manager.py, normal because there is no this file, It should be called manage.py.
1. Installing Nginx
Install the GCC compiler and related tools before installing Nginx, it is very convenient to install with Yum.
$ sudo yum-y install gcc gcc-c++ make autoconf automake
Nginx modules require third-party library support, such as gzip requires Zlib,rewrite module requires PCRE library, SSL function requires the OpenSSL library. Install it directly with Yum.
$ sudo yum-y install zlib zlib-devel OpenSSL openssl-devel pcre pcre-devel
Go to nginx official website nginx.org Download the latest version, the author download is 1.2.7 version.
$ wget http://nginx.org/download/nginx-1.2.7.tar.gz
Unzip the installation
$ tar-zxv-f nginx-1.2.7.tar.gz
$ CD nginx-1.2.7
$./configure
$ make
$ sudo make install
Here configure use the default parameters, can be modified according to their own needs. You can use the./configure–help to view help instructions.
Start the Nginx server
Sudo/usr/local/nginx/sbin/nginx-c/usr/local/nginx/conf/nginx.conf
Where/usr/local/nginx/sbin/nginx represents the start-up program, where the full path is more intuitive, you can make a soft link to the system path according to your own habits.
Using the browser to access the HTTP://127.0.0.1/, if you see the Welcome to nginx! Word, it means that the installation was successful.
2, Installation Uwsgi
Install dependent Python-devel, Setuptools,libxml2-devel, and install it directly with Yum. If you are compiling your own Python installation, you may not have to install Python-devel.
$ sudo yum-y install python-devel python-setuptools libxml2-devel
Former website http://projects.unbit.it/uwsgi/download Uwsgi, although the page is in English, but it is not difficult to find the download page.
$ wget http://projects.unbit.it/downloads/uwsgi-1.9.tar.gz
Unzip the installation:
$ tar-zxv-f uwsgi-1.9.tar.gz
$ CD uwsgi-1.9
$ python setup.py Install
3, installation Flask
Go to official website http://flask.pocoo.org/download flask.
$ wget http://pypi.python.org/packages/source/F/Flask/Flask-0.9.tar.gz
Unzip the installation
$ tar-zxv-f flask-0.9.tar.gz
$ CD Flask-0.9
$ sudo python setup.py install
Create a new Flask project, app.py a program file with the following:
from
flask
import
Flask
app
=
Flask(__name__)
@app
.route(
"/"
)
def
hello():
return
"Hello World!"
if
__name__
=
=
"__main__"
:
app.run()
Make sure that the Web server that comes with flask can run.
4. Configuring Nginx and Uwsgi
This step is more troublesome, but it is not difficult to understand the principle.
Uwsgi in Nginx 1.2.7 is a standard module, so no installation is required. Edit the Nginx configuration file so that it loads UWSGI.
Location/{
Include Uwsgi_params;
Uwsgi_pass 127.0.0.1:3031;
root HTML;
Index index.html index.htm;
}
After the modification is complete, you can test the configuration file for no errors.
$ sudo/usr/local/nginx/sbin/nginx-t-c/usr/local/nginx/conf/nginx.conf
After the configuration is complete, restart Nginx. First find the Nginx main process number:
$ PS-EF | grep nginx
The author on the computer is 13367 and then restarted
$ sudo kill-hup 13367
Create a new profile app_config.xml under the Flask project to set UWSGI related parameters, and a uwsgi will need to indicate this configuration file at startup, as follows:
<
uwsgi
>
<
pythonpath
>/home/chenjiebin/web/flaskdemo</
pythonpath
>
<
module
>app</
module
>
<
callable
>app</
callable
>
<
socket
>127.0.0.1:3031</
socket
>
<
master
/>
<
processes
>4</
processes
>
<
memory-report
/>
</
uwsgi
>
One of the parameters indicates:
- Pythonpath indicates the project directory
- Module represents the project startup module, as in the example above is app.py, here is the app
- Callable represents the instance name of the Flask project, the app = Flask (__name__) in the example code, so this is the app
- The socket represents the address and port of the Nginx communication, and the Uwsgi_pass in the Nginx configuration is consistent.
- Processes indicates how many child processes are opened to process the request.
Start Uwsgi:
$ sudo/usr/local/bin/uwsgi-x/home/chenjiebin/web/flaskdemo/app_config.xml
Where the-x parameter represents the loaded configuration file path.
This time in the browser to access http://localhost, see output Hello world! is done.
Tip: If you need to let Uwsgi run as a daemon, use the-D parameter and indicate the log path.
$ sudo/usr/local/bin/uwsgi-x/home/chenjiebin/web/flaskdemo/app_config.xml-d/var/log/uwsgi/uwsgi.log
Summary
The communication between Nginx and Uwsgi here is to use the port to communicate, or you can use the socket file. UWSGI configuration can also use other configuration files, not necessarily XML, here is no longer explained. There is a problem that can be exchanged for letters.
detailed description of Nginx : please click here
Nginx : please click here.
For more information on CentOS, see the CentOS feature page http://www.linuxidc.com/topicnews.aspx?tid=14
This article permanently updates the link address : http://www.linuxidc.com/Linux/2014-05/101529.htm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7.centos upgrade python, and install Pip
1. Install the necessary preparation packages
The installation process will use GCC for convenience, install "Development Tools"
Yum Groupinstall "Development tools"
In addition, some of the dependencies required in Python installation
Yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel
2. Download and install Python2.7
The latest version of Python2.7 is now 2.7.11. Can be queried at the following website:
https://www.python.org/ftp/python/
The download links for 2.7.11 are:
Https://www.python.org/ftp/python/2.7.11/Python-2.7.11.tgz
wget https://www.python.org/ftp/python/2.7.11/Python-2.7.11.tgz
Tar vxf python-2.7.11.tgz
CD python-2.7.11.tgz
./configure --prefix=/usr/local --enable-unicode =ucs4--enable-shared ldflags ="-wl,-rpath/usr/local/lib" make && make Altinstall
After the installation is complete, you can see the version by running Python
>>> import sys>>> sys.version ' 2.7.11 (default, May 6, 01:38:00) \N[GCC 4.4.7 20120313 (Red Hat 4.4. 7-16)] '
3. Install Pip
Pip is a Python installation tool, and many common Python tools can be installed via PIP.
To install PIP, first install Setuptools. The link below will give you the information, the latest version is 21.0.0:
Https://pypi.python.org/pypi/setuptools
Download Link:
https://pypi.python.org/packages/ff/d4/209f4939c49e31f5524fa0027bf1c8ec3107abaf7c61fdaad704a648c281/ Setuptools-21.0.0.tar.gz#md5=81964fdb89534118707742e6d1a1ddb4
Similarly, to install:
Tar vxf setuptools-21.0.0.tar.gz cd setuptools-21.0.0python setup.py install
After the installation is complete, download PIP. Its information is on the following website:
Https://pypi.python.org/pypi/pip
The latest version is 8.1.1, download link:
https://pypi.python.org/packages/41/27/9a8d24e1b55bd8c85e4d022da2922cb206f183e2d18fee4e320c9547e751/ Pip-8.1.1.tar.gz#md5=6b86f11841e89c8241d689956ba99ed7
Similarly, the installation
Tar vxf pip-8.1.1.tar.gz cd pip-8.1.1python setup.py install
After the installation is complete, run PIP
[[Email protected] pip-8.1.1]# pip do not upgrade PIP, will error
5. View version Information
[Plain]View PlainCopyprint?
- #/usr/local/bin/python2.7-v
6. Establish a soft connection so that the system default Python points to python2.7
[Plain]View PlainCopyprint?
- #mv/usr/bin/python/usr/bin/python2.6.6
- #ln-S/usr/local/bin/python2.7/usr/bin/python
7. Re-examine the Python version
[Plain]View PlainCopyprint?
- #python-V
8 Resolve system Python soft link to Python2.7 version, since Yum is not compatible with Python 2.7, Yum does not work properly and we need to specify the Python version of Yum
[Plain]View PlainCopyprint?
- #vi/usr/bin/yum
The file header is
#!/usr/bin/python
Change into
#!/usr/bin/python2.6.6
At this time run virtualenv may error, cannot find command, need to switch to normal user, cannot use root
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
****************************************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6.
New project hosting built Python virtual environment ~ ~
1. Coding.net New Project Zblog3
2. Local initialization of Git
Git init
3. Remote Storage
A. Create an SSH Key (if necessary)
b. Git clone-o myremotename https://git.coding.net/xiaofeier312/zblog3.git
4. Local Virtualenv zblog3env
5. Export and import the environment version (pending)
Pip Freeze >requirements.txt
Pip Install-r requirements.txt
6. Git operation (http://www.ruanyifeng.com/blog/2014/06/git_remote.html)
git add XX. X
Git commit-m "commentxxx"
git push myremotename Master/banrch
Git pull myremotename master/...
git Add. This can be put so that files and folders are put into the commit cache, "." Show All
5.PYCHARM activation Method Two:
One:
0x1, install 0x2, adjust the time to 2038 years. 0x3, apply for 30 days trial 0x4, exit Pycharm 0x5, time adjustment back.
Two: The activation code is as follows:
43b4a73yyj-eyjsawnlbnnlswqioii0m0i0qtczwvlkiiwibgljzw5zzwvoyw1lijoibgfuihl1iiwiyxnzawduzwvoyw1lijoiiiwiyxnzawduzwvfbwfpbc I6iiisimxpy2vuc2vszxn0cmljdglvbii6ikzvciblzhvjyxrpb25hbcb1c2ugb25sesisimnozwnrq29uy3vycmvudfvzzsi6zmfsc2usinbyb2r1y3rzijp Beyjjb2rlijoisukilcjwywlkvxbubyi6ijiwmtctmditmjuifsx7imnvzguioijbqyisinbhawrvcfrvijoimjaxny0wmi0ynsj9lhsiy29kzsi6ikrqtiis Inbhawrvcfrvijoimjaxny0wmi0ynsj9lhsiy29kzsi6ilbtiiwicgfpzfvwvg8ioiiymde3ltaylti1in0seyjjb2rlijoire0ilcjwywlkvxbubyi6ijiwm Tctmditmjuifsx7imnvzguioijdtcisinbhawrvcfrvijoimjaxny0wmi0ynsj9lhsiy29kzsi6iljtmcisinbhawrvcfrvijoimjaxny0wmi0ynsj9lhsiy2 9kzsi6iljdiiwicgfpzfvwvg8ioiiymde3ltaylti1in0seyjjb2rlijoiuemilcjwywlkvxbubyi6ijiwmtctmditmjuifsx7imnvzguioijstsisinbhawr Vcfrvijoimjaxny0wmi0ynsj9lhsiy29kzsi6ildtiiwicgfpzfvwvg8ioiiymde3ltaylti1in0seyjjb2rlijoireiilcjwywlkvxbubyi6ijiwmtctmdit Mjuifsx7imnvzguioijeqyisinbhawrvcfrvijoimjaxny0wmi0ynsj9xswiagfzaci6ijmzotgyotkvmcisimdyywnlugvyaw9krgf5cyi6mcwiyxv0b1byb 2xvbmdhdGVkIjpmYWxzZSwiaXNBdXRvUHjvbg9uz2f0zwqiomzhbhnlfq==-keaxikrgxpke4br/zts7s7ukp92lbxre57hvwamu1ehvxtcv1b4f/knqirpopn6dgpjig5emvmpmo7ympl +bmwq8ptzacgfulqchd1ngo6ywhkiqy0nr249sauvacl2wgjwao4jeoh1opux8chzsbvrzbmz0/mgyygi7duyaff9jqqfh3p/ bhdtnm8ekl6z5tnnez8zg5bg1xvqftqwk4fhgsewdk7b+ He44hpjbxkql2gmzaodb6g9yxfthhvrkqy5hq7kpxnvh3ikerhkoal5apgsvbzjotde2kdytnglmqxghfx6l0ofqki6hmr48ergmyfldk6wlngwjvyhlww ==-miiepjccaiagawibagibbtanbgkqhkig9w0baqsfadaymrywfaydvqqdda1kzxrqcm9mawxlienbmb4xdte1mtewmja4mje0ofoxdte4mtewmta4mje0of owetepma0ga1ueawwgchjvzdn5miibijanbgkqhkig9w0baqefaaocaq8amiibcgkcaqeaxcqkq+ zdxlr2mmrybpzgbundmn6oaxixzxiwtmekrjmo/5oufqjbllumsmk0qhfmai37wshyxzcfrcidwxjot4zmnbknlyhoddij/78tmvqfl8noed5+ 07b8veaiu7c3e1n+e1doc6wht4i4+iemtspadoaj5wcqvqbri8ket8m9vcbiwx7fd0fhexfg3zrt0xqwmcxgnp3ddjhio0rcdu+ itv7emtnsvq9jbg1usmsfvmowr25mju2jcpfp1+i4zi+fqgr8gyg8oindyneoabsr3lopi7gruysvkb/xvy/ Voklpck2h0f0gjxfjnye8nt1paywoyl7rmiavre/ Ekwidaqabo4gzmigwmakga1udewqcmaawhqydvr0obbyefgepg9ozgcflmgnbky7sghimggtcmegga1udiwrbmd+afkoetkhnqhi2qb1t4lm0ofkll/ Gzorykgjaymrywfaydvqqdda1kzxrqcm9mawxlienbggka0myxg7kdeeewewydvr0lbawwcgyikwybbquhawewcwydvr0pbaqdagwgma0gcsqgsib3dqebcwu aa4icaqc9wzuygqedsuoc5tousrrigmw4/+wuc5etzbfvdl4ht/8vzmw/oulip4ycva0xkybacj2ix+zcdkopfiyxiasih+ hxapv6j79vvouxkrwg2xv6shftplp+0gpdgq3x9r3+kjbmam8w+fodlwqafjrlvpzmgnedu14ygxiz9bvzmiqbwrba+c/f4tlk/ dv07dsnexihqfoibnqdivntgombau2ddup2gwkdl81ua8eicgnexhe82kjf4zwfadhk3bqvvbfdawxcdy4xbjs3l4raplu3yenszr/oeur1+ jfoxnqsmecmxkxgraq9u55gwjcofkrgoxedek/sk1vfojvs+num4eyerufmfazhzoqiuw4iqggc45ohfh0uuyjycufxxdsu9lmcv8qdhkm+ wnprb0l9l5vxscbduhagyd6ss+ga+ady6f/qxzuuceuoh3qunbbculvisz6+girnt1ka9n2qachl+ 2ybfaquqr8h7z2gsx5lcif5kynsqj0gavxtvywh7pyikx4bs354zqluwwa/cg++2+wnwp+htbhvxmrntdvhsm38aknzld+ ptaswgu9gylmhti2envwgybsd2dxmhxk3ipckhkak+ pl0ewygzwg3tj9mz7sowcxlwdfak0lrjnkgfmtggrwjv8gypw5bq23vmiqqdlgknzuoog==
4.
Install Mac Fonts
CP font File monaco.ttf/usr/share/fonts/truetype/custom/
sudo fc-cache-f-V
1.
After installing MySQL
1. Allow root remote access
Use MySQL;
mysql> Update user Set host = '% ' where user = ' root ';
Mysql> Select Host, user from user;
mysql> flush Privileges;
Permissions must be refreshed
[Open/etc/conf/in [mysqld] to add a sentence: Skip-grant-tables, you can see the user Library] Sometimes, do not have permission to add a password, or, can not be logged in with a password user, or directly MySQL can log in
You need to delete the empty items in the table,
Remember to refresh permissions
and service mysqld restart.
2. Open port
Open the firewall configuration file
1
Vi/etc/sysconfig/iptables
2. Add the following line
1
-A input-m state--state new-m tcp-p TCP--dport 3306-j ACCEPT
3. Restart the firewall
1
Service Iptables Restart
Firewall must be restarted
2.
Virtual machine Installation linux/python3.4 Pit
VM player is not useful
VM workstations 12 needs to set its own network card (Edit menu > virtual machine Network Settings)
Vituralbox currently unable to install new CentOS
Virtual machine tools need to be restarted for Linux to work
When selecting a hard drive, you can customize it or "use all Space"
Automatic separation
Python with 3.4 own PIP, etc.
python3.5 not good to install PIP and other tools
python3.4 Installation
http://www.jianshu.com/p/6199b5c26725
3.
Installing Apache HTTPD
Installing MOD_WSGI
Yum Install Mod_wsgi
There was no Apxs file after the installation.
(Find the latest version yourself)
yourself with the Yum list "httpd*", you can find the Httpd-devel kit package, which provides the necessary items for editing the software
#添加mod_wsgi. So module
#LoadModule Wsgi_module modules/mod_wsgi.so
#指定myweb项目的wsgi. py configuration file path
Wsgiscriptalias//usr/local/projects/send/send/wsgi.py
#指定项目路径
wsgipythonpath/usr/local/projects/send/send/
4.
(13) Permission Denied:mod_wsgi (pid=6026, process= ", application= ' localhost.localdomain| '): Call-to-fopen () failed for '/US r/l
Replace Require all granted with the following
1
2
Order Deny,allow
Allow from all
Linux virtual machine Configuration development/server Environment complete