����Linux�Ż�
Linux����

��Ѷ��LNMP+wordpress�������վ

����ʱ��:2017-08-29 09:35:41��Դ:linux��վ����:Lesealy
�����˺ü���Сʱ��Ū�ã�php nginx��֪һ��������ʵһ�㶼���ѣ��Դ˼�¼һ�£��׸��״δ�������ǣ�
 
1��׼������������Ϊ�����õ�ubuntu16.04 LTSϵͳ  ��������debian��̳�������
1.������Ѷ�� ����CVM ѡ������þͺ��ˣ���ѡ�����ubuntu16.04������Ϊ˳��ѧϰһ�£���
2.��������������Ҫ������������ʹ�ã���
����������ʽ��ʼ��װ����װ����װ�ٰ�װ�����ã����������ã���
��������Զ����������϶���Ը��ʹ���Ǹ���ҳ��Ŀ���̨�ģ��������Լ��������Ӱɣ�
���ն� ����
ssh -i "/home/ubuntu/ssh" ubuntu@127.0.0.1  /home/ubuntu/ssh ����ĵ�¼��Կ  ��ubuntu�������û����� 127.0.0.1 ����������ַ��
ssh��Կ��ô����أ���������Ʒ�����ҳ�������sshѡ�� ���ȥ����һ�� Ȼ���������������Ǹ���Կ������ú���ҳ���������Ʒ�������
��¼���˺����Ȱ�װ��Ҫ����(nginx php7.0-fpm mysql mysql-client php-mysql wordpress)
��ôװ�Ͳ�˵�� һ��apt-get�����ˡ�
wordpress��װ -��  wget http://wordpress.org/latest.tar.gz 
Ҳ�����İ��  wget https://cn.wordpress.org/wordpress-4.7.4-zh_CN.tar.gz 
��ѹ��/var/www/ ���û�оʹ���һ�� Ȼ����Ȩ�� 
chown -R www-data:www-data /var/www  ʵ�ڲ��оͣ� chomd 777  ������
������������ô���ã�
Nginx���ã�
sudo vim /etc/nginx/sites-available/default 
�滻server���֣�
ע���滻�����е�����ip ����fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; ��ط��Ƿ�������ȷ��
server {
listen       80;
root   /var/www/wordpress;
server_name  www.xxx.com ����ip;
#charset koi8-r;
#access_log  /var/log/nginx/log/host.access.log  main;
location / {
index index.php index.html index.htm;
}
#error_page  404              /404.html;
#redirect server error pages to the static page /50x.html
#
error_page   500 502 503 504  /50x.html;
location = /50x.html {
root   /usr/share/nginx/html;
}
#pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ .php$ {
fastcgi_pass    unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index   index.php;
fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
include        fastcgi_params;
}
}
�����༭���ļ������ʾ������ǿ�Ʊ��棨�û�Ȩ�����⣩ :wq��ôҲ����ʹ�� û��ϵ��������������  :w ! sudo tee %  ����֮��ǿ���˳��ͺ��ˡ�
wordpress���ã�
cd /var/www/wordpress/
cp wp-config-sample.php wp-config.php
vim wp-config.php
�޸����¼��� �������ݿ��� �û��� ���� ���ݿ�������ַ����Ѷ�Ƶ�mysqlҲһ����������ַ��Ϊ�����ݿ�������ַ��
define('DB_NAME', 'wordpress');
/** MySQL database username */
define('DB_USER', 'wordpress');
/** MySQL database password */
define('DB_PASSWORD', 'xxx');
/** MySQL hostname */
define('DB_HOST', 'localhost');
�����������
service nginx restart
service ftp7.0-fpm restart
service mysql restart
������������ʾͳ���wordpress��װ��������
��������� ��һ������װ�ɹ���ѡ�����⣬�Զ������⣺�������󹦸�ɣ���Ϊshale����
��Ѷ��LNMP+wordpress�������վ
��Ѷ��LNMP+wordpress�������վ
��Ѷ��LNMP+wordpress�������վ
 
�ܽ᣺
�õ������
Զ�̵�¼  ssh -i ��/ssh�� �������û���@������ַ��;
�û����޸�  chown -R   ubuntu:ubuntu /xxx  -R �����޸�Ƕ����Ŀ¼Ȩ��
Ȩ���޸�   chomd 777   ��777����ʲô���� ��7   = rwx����r = read = 4����w = write = 2����x = Execute permission = 1��
������� service �������� ����
vim �� ��i�� insertģʽ ��esc�� �˳���ǰģʽ ��:wq�� �����˳� ��:q!�� ǿ���˳� ��:w ! sudo tee % ����ͨ�û�ǿ��д��
cp -r ����Ŀ¼
rm -rf ��Ĭɾ��Ŀ¼���ļ�
df -h ��ʾ�豸��Ϣ
ls -lh ��ʾ��ϸ�ļ���Ϣ
ls -h ��ʾ���ļ���
du -h --max-depth=1 | grep  ��ʾ���������µ��豸��Ϣ ������ʽ����Ѷ��Ӳ���õ���
tar -czf ѹ����tar.gz   ��c = ѹ����+��z = gzip��or��j = bzip2��or��Z = compress��+��f = �ļ�������
tar -xzvf ��ѹtar.gz�� ��x = ��ѹ��+��z = gzip��or��j = bzip2��or��Z = compress��+ ��v = ��ʾ������Ϣ��+��f = �ļ�������
xz -z ��tar��ѹ����tar.xz�� ��ѹ xz -d ��ѹ��tar��
scp ubuntu@������ַ:/home/�ļ�  ����Ŀ¼             ssh��¼Զ�̿����ļ���ò�Ʋ���ʹ һ��û�ɹ���������ftpԶ�̲����ˣ�
 
�������ø��µ�ַ��//m.ajphoenix.com/linux/32440.html