Move the php website to CentOS 6.7 [2]: deploy the website to the server, centos6.7
First, make sure that the lamp environment is installed. Prepare the project source code and database backup files. Because VNC is not installed, you can only deploy it using ssh.
Decompress the project source code. By default, Linux supports SFTP and uses SFTP to upload the source code compressed package to the/var/www/html directory. For FTP software, I think it is very convenient to use the NPPFtp plug-in of Notepad ++.
Next, use ssh to decompress the source code package. Because I package the source code into a zip package, you can use the unzip command. For other types of compressed packages, you need to find the corresponding decompression command:
# Cd/var/www/html # unzip source.zip
Then, upload the database backup file to a directory on the server and remember the path. Then:
# Mysql-u username-pEnter password: password mysql> set names utf8; mysql> create database database1; mysql> use database1; mysql> source directory where the SQL file is stored/database1. SQL;
Now you can open the browser to access the page. If an error is reported on the page, follow the prompts to solve the error. Common problems include database information configuration errors and insufficient folder permissions. Today, I encountered a folder permission problem. Now I have posted a record.
Error details: the runtime directory has insufficient permissions.
The solution is to add the read and write permissions of other persons to the runtime directory:
# Chmod o + rw/var/www/html/specific path/runtime
For more information about permission settings, see article 1, article 2.