For developers, web development can be done with Apache web site testing, but when a Web program to publish, Apache poor performance is very prominent, when the configuration of an Nginx server is particularly important.
Here's how to configure the Nginx server:
1. Download Xshell and XFTP for managing Linux systems and uploading files
2. Download Aliyun One-click Web installation package (including Nginx, PHP, Mysql) click here to download
3. Upload the Aliyun one-click installation package to the root directory
4. Execute command: Cd/root into the root directory
5. Execute command: Ls–l View the directory structure to see if aliyunweb.zip exists
6. Execute command: Unzip Aliyunweb.zip for decompression
7. Execute command: CD/ROOT/SH-1.5.5/into sh directory
8. Execute command: chmod +x *-RF plus executable permissions
9. Execute the command:./install.sh performing the installation
10. Next
Enter 1->1->4->3 in turn
Finally enter Y to enter the installation, this process for nearly 30 minutes
After the installation is complete, use the command: Netstat–ln |more to see if the service is started
9000 3306 boot port exists, indicating that the installation has been successful
Execute command after installation: CD/ROOT/SH-1.5.5/enter into sh directory
Execute command: More Account.log view ftp and MySQL account, password
To move the phpMyAdmin directory to WWW, execute the following command:
mv Phpwind/phpmyadmin./
Ls–l command to see if the move was successful
To this end, the Nginx server has been configured successfully, followed by the configuration of a basic web site, before the site configuration, the first password modification of the database:
Execute command:
Mysql-u root-p Enter the MySQL password (that is, the MySQL password in account.log)
Use MySQL;
UPDATE user SET Password=password ("New password");
FLUSH privileges;
Quit
Sometimes the MySQL database needs to be managed from a local Windows computer, and the MySQL database needs to be authorized at this point, in the following ways:
Execute command:
Mysql-u Root-p Enter the password for MySQL (the password just changed)
GRANT all privileges on * * to ' root ' @ '% ' identified by ' password ' with GRANT OPTION;
FLUSH privileges;
Quit
At this point, the MySQL database can be remotely managed.
Next we modify the server configuration and deploy a Web site to this server:
Execute command: Cd/alidata/server/nginx/conf/vhosts into nginx configuration directory
Execute command: VI phpwind.conf into VIM editor
Press the keyboard "I" to enter insert mode and modify the file to the following style:
Finally press ESC to exit the edit, press (: Wq) Enter to save. At this point, the root directory of the current server is:/alidata/www
Execute command: Service nginx reload restart Nginx server
Next upload the website file to the WWW directory
Execute command: Unzip compress package name. zip for decompression
Execute command: Chown www.www Extract folder name-rf Modify the directory owner of the site file
To this site configuration has been completed, only need to access: HTTP://IP address/website file name to run
Build Nginx+mysql+apache under Linux