This post will be put here as a backup, in case the other days I forget how to deal with such problem.
What I got is the first thing I should state here. The answer is a complete backups of the previous wordpress fold and a .sql database file. O.K, let’s begin.
Step 1, go to the name server to point the domain name to my Linode IP address.
Step 2, configure name-based virtual hosts. Create a file in the /etc/apache2/sites-available/ directory for each virtual host that you want to set up. Name each file with the domain for which you want to provide virtual hosting. See the following example configurations for the hypothetical “example.com” domain.
<VirtualHost *:80> ServerAdmin email@example.com ServerName example.com ServerAlias www.example.com DocumentRoot /srv/www/example.com/public_html/ ErrorLog /srv/www/example.com/logs/error.log CustomLog /srv/www/example.com/logs/access.log combined </VirtualHost>
After you’ve set up your virtual hosts, issue the following commands:
This command symbolically links your virtual host file from sites-available to the sites-enabled directory. Finally, before you can access your sites you must reload Apache with the following command:
Step 3,change the config file to suit your current environment, the config file locates /srv/www/ducklington.org/public_html/wp-config.php
Step 4, import the .sql file to your mysql database. Issue the following commands:
mysql -u username -p database_name < file.sql
The username and database_name should be change to the other names according to the wp-config.php file.