Wordpress blog migration Alibaba cloud server configuration

Source: Internet
Author: User
Tags fpm memcached socket mysql database phpmyadmin wordpress blog

Other operations after migration:

Disabled functions in PHP

The code is as follows: Copy code

Example, php_sapi_name, example, example, php_uname, exec, system, passthru, shell_exec, example, example, proc_close, proc_open, ini_alter, dl, example, example, disk_free_space, chown, diskfreespace, getrusage, get_current_user, getmyuid, getmypid, dl, leak, listen, chgrp, link, symlink, dlopen, proc_nice, response, proc_terminate, shell_exec, sh2_exec, response, locate, posix_kill, repair, mkfifo, dbmopen, dbase_open, filepro, filepro_rowcount, posix_mkfifo, putenv, sleep

Proftpd Upload 550 error

The directory permission is incorrect. You can change the user and user group to the FTP account you have created.

Redirect a domain name without www to a domain name with www in nginx

The code is as follows: Copy code

If ($ host = '111cn. Net '){
Rewrite ^/(. *) $ http://www.111cn.net/$1 permanent;
    }

Wordpress background option 404 in nginx

For wordpress pseudo-static rules, edit/usr/local/nginx/conf/wordpress. conf as follows:

The code is as follows: Copy code


Location /{
If (-f $ request_filename/index.html ){
Rewrite (. *) $1/index.html break;
        }
If (-f $ request_filename/index. php ){
Rewrite (. *) $1/index. php;
        }
If (! -F $ request_filename ){
Rewrite (. *)/index. php;
        }
}
Rewrite/wp-admin $ scheme: // $ host $ uri/permanent;

Vnstat monitoring traffic:

The code is as follows: Copy code

Wget https://acelnmp.googlecode.com/files/vnstat-1.10.tar.gz
Tar xvzf vnstat-1.10.tar.gz
Cd vnstat-1.10/
Make & make install
/Usr/bin/vnstat-u-I eth0
Vim/etc/cron. d/vnstat
0-55/5 * root vnstat-u-I eth0
0-55/5 **** root vnstat -- dumpdb-I eth0>/var/lib/vnstat/vnstat_dump_eth0
Wget http://www.sqweek.com/sqweek/files/vnstat_php_frontend-1.5.1.tar.gz
Tar-zxf vnstat_php_frontend-1.5.1.tar.gz
Music vnstat_php_frontend-1.5.1.tar.gz vnstat

Put vnstat in the root directory of the website, and then you can access it through your domain name/vnstat.

Edit vnstat/config. php

The code is as follows: Copy code


Error_reporting (E_ALL | E_NOTICE );
 
$ Locale = 'en _ US.UTF-8 ';
$ Language = 'en ';
 
$ Iface_list = array ('venet0 ');
 
$ Iface_title ['venet0'] = 'internal ';
// $ Iface_title ['sixxs'] = 'sixxs IPv6 ';
 
$ Vnstat_bin = '/usr/bin/vnstat ';
$ Data_dir = '/var/lib/vnstat /';
 
$ Graph_format = 'PNG ';
 
Define ('graph _ font', dirname (_ FILE _). '/VeraBd. Ttf ');
 
Define ('svg _ font', 'verdana ');
 
Define ('default _ COLORSCHEME ', 'light ');

Nginx VM configuration field

The code is as follows: Copy code


Log_format 111cn.net '$ remote_addr-$ remote_user [$ time_local] "$ request "'
'$ Status $ body_bytes_sent "$ http_referer "'
'"$ Http_user_agent" $ http_x_forwarded_for ';
Server
        {
Listen 80;
Listen 443;
Server_name 111cn.net www.111cn.net;
Ssl on;
Ssl_certificate/usr/local/nginx/conf/ssl/www_xj123_info.crt;
Ssl_certificate_key/usr/local/nginx/conf/ssl/xj123.KEY;
Index index.html index.htm index. php default.html default.htm default. php;
Root/home/wwwroot/111cn.net;
 
If ($ host = '111cn. Net '){
Rewrite ^/(. *) $ http://www.111cn.net/$1 permanent;
                        }
 
Include wordpress. conf;
Location ~ . *. (Php | php5 )? $
                        {
Try_files $ uri = 404;
Fastcgi_pass unix:/tmp/php-cgi.sock;
Fastcgi_index index. php;
Fcinclude GI. conf;
                        }
 
Location ~ . *. (Gif | jpg | jpeg | png | bmp | swf) $
                        {
Expires 30d;
                        }
 
Location ~ . *. (Js | css )? $
                        {
Expires 12 h;
                        }
 
Access_log/home/wwwlogs/111cn.net. log 111cn.net;
        }


 

My. cnf configuration

The code is as follows: Copy code

[Client]
Port = 3306
Socket =/tmp/mysql. sock
[Mysqld]
Port = 3306
Socket =/tmp/mysql. sock
Skip-external-locking
Key_buffer_size = 16 M
Max_allowed_packet = 1 M
Table_open_cache = 64
Sort_buffer_size = 512 K
Net_buffer_length = 8 K
Read_buffer_size = 256 K
Read_rnd_buffer_size = 512 K
Myisam_sort_buffer_size = 8 M
Log-bin = mysql-bin
Binlog_format = mixed
Server-id = 1
[Mysqldump]
Quick
Max_allowed_packet = 16 M
[Mysql]
No-auto-rehash
[Myisamchk]
Key_buffer_size = 20 M
Sort_buffer_size = 20 M
Read_buffer = 2 M
Write_buffer = 2 M
[Mysqlhotcopy]
Interactive-timeout

Lnmp information

/Root/vhost. sh // add a VM
Rm/usr/local/nginx/conf/vhost/domain name. conf // delete a VM
LNMP-related software installation directory
Nginx Directory:/usr/local/nginx/
MySQL Directory:/usr/local/mysql/
MySQL database Directory:/usr/local/mysql/var/
PHP Directory:/usr/local/php/
PHPMyAdmin Directory: for version 0.9,/home/wwwroot/phpmyadmin/1.0 is/home/wwwroot/default/phpmyadmin/. We strongly recommend that you rename this directory as a name that is hard to guess. Phpmyadmin can download and replace the new version from the official website.
Default website directory:/home/wwwroot/0.9/home/wwwroot/default/
Nginx log Directory:/home/wwwlogs/
/Root/vhost. sh:/usr/local/nginx/conf/vhost/
PureFtpd Directory:/usr/local/pureftpd/
PureFtpd web Management Directory:/home/wwwroot/default/ftp/0.9/home/wwwroot/default/ftp/
Proftpd Directory:/usr/local/proftpd/
LNMP configuration file location
Nginx main configuration file:/usr/local/nginx/conf/nginx. conf
/Root/vhost. sh:/usr/local/nginx/conf/vhost/domain name. conf
MySQL configuration file:/etc/my. cnf
PHP configuration file:/usr/local/php/etc/php. ini
Php-fpm configuration file:/usr/local/php/etc/php-fpm.conf
PureFtpd configuration file:/usr/local/pureftpd/pure-ftpd.conf
PureFtpd MySQL profile:/usr/local/pureftpd/pureftpd-mysql.conf
Proftpd configuration file:/usr/local/proftpd/etc/proftpd. conf
Proftpd user configuration file:/usr/local/proftpd/etc/vhost/user name. conf
LNMPA directory file location
Apache Directory:/usr/local/apache/
Apache configuration file:/usr/local/apache/conf/httpd. conf
Apache virtual host configuration file directory:/usr/local/apache/conf/vhost/
LNMP status management command:
LNMP status management:/root/lnmp {start | stop | reload | restart | kill | status}
Nginx status management:/etc/init. d/nginx {start | stop | reload | restart}
MySQL status management:/etc/init. d/mysql {start | stop | restart | reload | force-reload | status}
Memcached status management:/etc/init. d/memcached {start | stop | restart}
PHP-FPM status management:/etc/init. d/php-fpm {start | stop | quit | restart | reload | logrotate}
PureFTPd status management:/etc/init. d/pureftpd {start | stop | restart | kill | status}
ProFTPd status management:/etc/init. d/proftpd {start | stop | restart | reload}
For example, restart LNMP and run/root/lnmp restart to restart mysql:/etc/init. d/mysql restart separately.
LNMPA status management command:
LNMPA status management:/root/lnmpa {start | stop | reload | restart | kill | status}
Nginx status management:/etc/init. d/nginx {start | stop | reload | restart}
MySQL status management:/etc/init. d/mysql {start | stop | restart | reload | force-reload | status}
Memcached status management:/etc/init. d/memcached {start | stop | restart}
PureFTPd status management:/etc/init. d/pureftpd {start | stop | restart | kill | status}
ProFTPd status management:/etc/init. d/proftpd {start | stop | restart | reload}
Apache status management:/etc/init. d/httpd {start | stop | restart | graceful-stop | configtest | status}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.