Because we need to migrate some data for staff, we thought of using WordPress for multiple sites. This feature was available after wordpress3.0.
Software System and other information: OS: Linux Debian wheezy
PHP: 5.4.4-14
MySQL: 5.5.37
Server: nginx1.2.1/Apache 2.2.2
First download wordpress3.9. During installation, note that my WWW directory is/home/WWW, And the WordPress path is/home/www/WordPress.
My nginx does not configure anything by default, so you can enter
127.0.0.1/WordPress/WP-admin/install. PHP can be installed. however, this is not the case here, because the nginx rewrite Based on localhost on multiple sites is invalid, so we need to configure the nginx virtual host first.
In Debian, The nginx configuration file is/etc/nginx. conf to manage global. in/etc/nginx/Site-available and/etc/nginx/CONF. D is used to manage Virtual Hosts
Here we create a new WP file in/etc/nginx/Site-available/WP
# Touch/etc/nginx/Site-available/WP
Add the following content. Note that here we are a practical domain name-based.
{ listen 80; server_name wp.com www.wp.com *.wp.com; charset utf-8; index index.html index.htm index.php; root /home/www/wordpress; location / { autoindex on; autoindex_exact_size on; autoindex_localtime on; index index.php index.html; if (!-f $request_filename) { rewrite ^(.*)$ /index.php?_rp_=$1 last; break; } } location ~ .*\.(git|jpg|jpeg|png|bmp|swf)$ { expires 1d; } location ~ .*\.(js|css)?$ { expires 12h; } location ~ \.php$ { fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /home/www/wordpress$fastcgi_script_name; include fastcgi_params; } location /doc/ { alias /usr/share/doc/; autoindex on; allow 127.0.0.1; allow ::1; deny all; }}
Then, because it is a local test, you need to modify the hosts of the above server name.
# Vim/etc/hosts
Add the following line in hosts
127.0.0.1 *.wp.com www.wp.com wp.com
Then reload nginx
# Nginx-t pass the test and then reload
#/Etc/init. d/nginx reload
Now you can use wp.com to access the initial WordPress installation interface.