由于美国空间的各种问题,因此目前准备迁移到香港空间,由香港vps来提供博客服务。
迁移过程:SourceByrd's Weblog-https://note.t4x.org/project/site-use-hkserver/
美国空间:
0 1 2 3 |
/usr/local/mysql/bin/mysqldump -uroot -p'admin' --set-gtid-purged=OFF --triggers --routines -B site >/tmp/site$(date +%F).sql #备份数据库名为site的数据库 [root@Byrd ~]# cd /home [root@Byrd home]# tar -cjf /home/admin.tar.bz2 /home/admin/ #压缩网站目录 ####通过ftp、sz、scp等工具将.sql与admin.tar.bz2下载到本地、或者远程服务器#### |
香港空间:
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
[root@HKServer ~]# yum install vim gcc pcre* openssl* gcc-c++ wget -y #解决ngingx依赖包 [root@HKServer ~]# yum install vim gcc gcc-c++ wget tree lsof ncurses-devel cmake libaio* -y #解决mysql依赖包 [root@HKServer ~]# yum install zlib libjpeg freetype libpng gd curl zlib-devel libxml2-devel libjpeg-devel freetype-devel libpng-devel gd-devel curl-devel gcc gcc-c++ wget libxml* libtool* libxslt* -y #解决php依赖包 [root@HKServer ~]# cd /byrd/tools/ [root@HKServer ~]# wget http://nginx.org/download/nginx-1.7.1.tar.gz [root@HKServer ~]# tar zxf nginx-1.7.1.tar.gz [root@HKServer ~]# wget http://www.openssl.org/source/openssl-1.0.1h.tar.gz [root@HKServer ~]# tar zxf openssl-1.0.1h.tar.gz [root@HKServer ~]# cd openssl-1.0.1h [root@HKServer openssl-1.0.1h]# ./config [root@HKServer openssl-1.0.1h]# make [root@HKServer openssl-1.0.1h]# cd .. [root@HKServer tools]# cd nginx-1.7.1 [root@HKServer nginx-1.7.1]# useradd nginx -s /sbin/nologin -M [root@HKServer nginx-1.7.1]# ./configure --user=nginx --group=nginx --prefix=/byrd/server/nginx-1.7.1 --with-openssl=/byrd/server/openssl-1.0.1h --with-pcre --with-http_ssl_module --with-http_spdy_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_stub_status_module [root@HKServer nginx-1.7.1]# make && make install MYSQL数据库安装请参考:http://note.t4x.org/system/centos-nginx-mysql-php/ php安装请参考:http://note.t4x.org/system/config-hypertext-preprocessor/ mysql> create database t4x default character set utf8 collate utf8_general_ci; #建立t4x数据库 mysql> create user 't4x'@'localhost' identified by 'admin'; #建立用户名为t4x,密码admin mysql> GRANT ALL ON t4x.* TO 't4x'@'localhost'; #这条命令,或者下面一条命令均可实现 mysql> grant all on t4x.* to 't4x'@'localhost' identified by 'admin'; #用户t4x对数据库t4x有所有权限 [root@HKServer tmp]# /usr/local/mysql/bin/mysql -uroot -p'admin' site < /tmp/site-2014-06-17.sql [root@HKServer tmp]# /usr/local/mysql/bin/mysql -uroot -p'admin' -h localhost mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | site | +--------------------+ 5 rows in set (0.00 sec) mysql> use site Database changed mysql> show tables; +------------------------+ | Tables_in_site | +------------------------+ | wp_baidusubmit_sitemap | | wp_baidusubmit_urlstat | | wp_commentmeta | | wp_comments | | wp_links | | wp_options | | wp_postmeta | | wp_posts | | wp_stt2_meta | | wp_term_relationships | | wp_term_taxonomy | | wp_terms | | wp_usermeta | | wp_users | +------------------------+ 14 rows in set (0.01 sec) mysql> |
修改Uid、Gid:
0 1 2 3 4 5 6 7 8 9 |
mysql> update users set Uid = 401 -> ; mysql> update users set Gid = 401 ; mysql> select * from users; +--------+----------+-----+-----+-----------+ | User | Password | Uid | Gid | Dir | +--------+----------+-----+-----+-----------+ | imbyrd | imbyrd | 401 | 401 | /home/www | +--------+----------+-----+-----+-----------+ 1 row in set (0.00 sec) |
申明:本文由BYRD原创(基于NGINX1.7.1、MYSQL5.5.37、PHP5.5.11),未经许可禁止转载!SourceByrd's Weblog-https://note.t4x.org/project/site-use-hkserver/ SourceByrd's Weblog-https://note.t4x.org/project/site-use-hkserver/
申明:除非注明Byrd's Blog内容均为原创,未经许可禁止转载!详情请阅读版权申明!