UbuntuLAMP configuration instance + VSFTPD virtual user management website

Source: Internet
Author: User
UbuntuLAMP configuration instance + VSFTPD virtual user management site: 1. Update apt-getupdate2, install a required package apt-getinstallphp5apt-getinstallapache2mysql-servermysql-clientphp5-mysqlphp5-curlphp5-gdlibapache2-mod-php5php5-mysql3 ,/

Ubuntu LAMP configuration instance + VSFTPD virtual user management website:

1. Update

Apt-get update

2. install required packages

Apt-get install php5

Apt-get install apache2 mysql-server mysql-client php5-mysql php5-curl php5-gd libapache2-mod-php5 php5-mysql

3. Add/etc/apache2/httdpd. conf:

AddType application/x-httpd-php. php

AddType application/x-httpd-php-source. phps string 6

4. ln-s/etc/apache2/mod-available/php5. */etc/apache2 // mod-enabled string 5

5. apt-get install apache2-mpm-prefork

6./etc/init. d/apache2 restart

Website management (VSFTPD ):

1. install required software packages

Apt-get install vsftpd mysql-server mysql-client libpam-mysql

The libpam-mysql package allows PAM to read MySQL Data to verify user information. Other software packages at www.britepic.org do not need to be interpreted!

2. Set FTP user permissions and Home Directories

After step 1 is completed, the system automatically creates the System user name ftp, which is the default anonymous user of vsftpd and has no other permissions. In my work environment, the home directory of the user name is/home/ftp, and the home directory of the RH system ftp is/var/ftp. This is irrelevant. You can set it as needed! You can also customize anonymous ftp users and make relevant modifications. In the download tutorial, the user ftp should also be changed to your custom user name.

The default/home/ftp permission is not the user's ftp. We need to modify it.

# Mkdir/home/ftp/temp

# Chown-R ftp. nogroup/home/ftp

3. Configure the MySQL database

I am also ashamed to talk about mysql. I don't know anything about databases! I have always understood the database as a large information warehouse. That is to say, we have to think of security as information! Mysql is insecure by default. I can only set the password here. For mysql optimization, please read the mysql manual!

# Mysqladmin-u root-p password 123456 modify the root password of mysql. The first change is unnecessary because the root password is empty.

Connect to the database:

# Mysql-h 127.1-u root-p use the root user to connect to the local mysql Server

Enter password: Enter the root user password. Note: it is not the root user of the system.

Mysql> connection successful! If this prompt does not appear, the preceding two steps are not correct.

Mysql> create databases vsftpd; create a database name. Remember, there must be ";" at the end of a command in the mysql environment. If you forget to enter ";", you are not afraid. If you forget to enter ";", it is a line break, in mysql, commands can be divided into several lines for execution. Enter ";" again for the same purpose.

Mysql> show databases; check whether the database name is set up. If not, run the previous step again.

Mysql> use vsftpd; open the database vsftpd. The following operations are performed on the vsftpd database.

Mysql> create table users (name varchar (20) not null, password varchar (20) not null, primary key (name) type = myisam; create a table named users, two keys are set: name and password. This is hard to understand. Let me explain it one by one! Varchar (20) not null sets the key length to 20 and cannot be blank. primary key (name) sets the table's primary key (the primary key cannot be assigned the same value, because the ftp user name cannot be the same ). Type = myisam: Set the table type (MyISAM new binary portable table processor). www.britepic.org is the default type and can be omitted.

Mysql> show tables; check whether the table is successfully created. If not, return to the previous step.

Mysql> insert into users values ('admin', 'admin'); create a virtual user admin with the password admin.

Mysql> insert into users values ('Download', 'Download ');

Mysql> insert into users values ('upload', 'upload ');

Mysql> insert into users values ('web', 'web ');

Mysql> select * from users; verification result. If you cannot see the created virtual user, return to the previous step.

MySQL Data has been created, but we cannot directly use the root user. We need to create a user for pam.

Mysql> grant select on vsftpd. users to vsftpd @ localhost identified by 'vsftpd ';

Grant command

Select on vsftpd. users all permissions. Here, the permission is set to use select only in the users table of the vsftpd database.

To vsftpd @ localhost vsftpd user on the local machine (mysql distinguishes users by user name and IP address, root and root @ % are not the same user .)

Identified by 'vsftpd 'sets vsftpd @ localhost user's password to vsftpd.

Mysql> quit; exit mysql and complete mysql configuration.

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.