How to Configure ftp, Apache, and MySQL in Linux

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.