Next we will introduce how to configure FTP, Apache, and MySQL after installing Linux in VPs.
1. FTP Server Configuration
1. First, vsftp has been installed on the server.
2. You can directly log on to the server and use the adduser command to set an FTP account. Specific command: useradd ABC-D/var/WWW;/var/WWW is the file path uploaded by the specified FTP.
3. Use the passwd command to set the FTP account password. Specific command: passwd ABC.
4. Delete the FTP user command: userdel ABC.
5. The command is interpreted as follows:
Useradd udxxxx add account
Passwd udxxxx change account password
Cd ~ Enter the account directory with udxxxx
Mkdir htdocs
Chmod 755 udxxxx modify directory attributes
Chown udxxxx. udxxxx htdocs modify directory permissions
Ii. Apache configuration site
1. Path of the Apache configuration file on the server:/usr/local/Apache/CONF/httpd. conf
2. Website configuration in Apache:
Use VI/usr/local/Apache/CONF/httpd. conf to enter the Apache configuration file and modify the following Configuration:
<Virtualhost *: 80>
Serveradmin webmaster@dummy-host.example.com --- server administrator mailbox
DocumentRoot/www/docs/dummy-host.example.com --- main directory corresponding to the webpage File
Servername dummy-host.example.com --- host domain name
Errorlog logs/dummy-host.example.com-error_log -- Record Error Log File Path
Customlog logs/dummy-host.example.com-access_log common -- Client Access Log Path
</Virtualhost>
After modification, save the preceding configuration.
3. Restart Apache with the following command:/usr/local/Apache/bin/apachectl restart. After restart, you can view your webpage files normally.
4. Restart Apache as follows:
/Usr/local/Apache/bin/apachectl Stop --- stop the apache service
/Usr/local/Apache/bin/apachectl start --- start the apache service
Iii. MySQL Database Configuration
if you use your MySQL database as the root user, you can directly upload your MySQL database file to the/usr/local/MySQL/data directory, modify the connection file of your database to use the MySQL database.
to create a MySQL user, follow these steps:
1. Enter the MySQL database directory: CD/usr/local/MySQL/Data
2. mkdir aaa_db (Create a database directory)
3./usr/local/MySQL/bin/MySQL-uroot-P ***** (log on to MYSQL as a root user)
4. Run the following command:
mysql> use MySQL;
database changed
mysql> grant all on aaa_db. * To AAA @ localhost identified by 'abc1234'; --- configure the user database and related permissions
query OK, 0 rows affected (0.02 Sec)
mysql> flush privileges; --- save and restart MySQL Server
query OK, 0 rows affected (0.02 Sec)
5. After creating the database user and the corresponding database, modify the database connection file to use it.