Linux-VPs installation and configuration

Source: Internet
Author: User
Tags vps

After logging on to VPs remotely, configure the environment. Here we will accept the simplest PHP environment Configuration:

Step 1:

Enter the command "yum-y install Yum-fastestmirror" and press Enter.

The installation has started:

After the installation is successful, the cursor will return to [root @ localhost ~] # Back

Then enter the command "yum-y install GD * PHP * httpd * MySQL * vsftpd *", for example:

Enter the following information:

This indicates that the software has been installed. After the installation is complete, the cursor will return to [root @ localhost ~] # Following, for example:

Restart Apache, MySQL, vsftp, and other services.

[Root @ localhost ~] # Service httpd restart apahce

[Root @ localhost ~] # Service mysqld restart MySQL

[Root @ localhost ~] # Service vsftpd restart vsftp (FTP service)

Step 2:

Modify the root password of MySQL:

[Root @ localhost ~] # Mysqladmin-u Root Password '000000' enter [enter the password in quotation marks]

In this way, simple MySQL and Apache are configured.

The configuration file of Apache is/etc/httpd/CONF/httpd. conf.

You can use the cat command to view:

[Root @ localhost ~] # Cat/etc/httpd/CONF/httpd. conf

Edit using the VI command:

[Root @ localhost ~] # Vi/etc/httpd/CONF/httpd. conf

Install Zend

Install Zend:

You can use the wget command to download

[Root @ localhost ~] # Wget ftp://ftp.de.netclusive.de/pub/zend/ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz carriage return

With: http://www.zhztk.com/uploads/soft/zend/ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz

Ftp://ftp.de.netclusive.de/pub/zend/ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz

Http://www.filewatcher.com/m/ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz.10208541.0.0.HTML

Http://downloads.PHPchina.com/zend/optimizer/3.3.3/ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz

Http://www.zhztk.com/a/ruanjianxiazai/2010/0726/338.HTML

After the download is complete

[Root @ localhost ~] # Tar xzvf ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz Decompression

[Root @ localhost ~] # Cd ZendOptimizer-3.3.3-linux-glibc23-i386 to enter the Zend directory

[Root @ localhost ~] #./Install. Sh Installation

Press enter until installation is complete without any operation.

Disable SELinux after installation

The method is as follows:

Modify SELinux = "" in the/etc/SELinux/config file to Disabled

Execute the command: setenforce 0

You can disable SELinux without restarting it.

Or:

[Root @ localhost ~] #/Usr/sbin/setenforce 0 press ENTER "note that the following Zero is not because of letters"

Step 3:

Configure vsftp to create an FTP user:

[Root @ localhost ~] # Useradd-g ftp-D/var/www/html-S/sbin/nologin phpwindd press ENTER

The following warning may be reported:

Useradd: warning: the home directory already exists.

Not copying any file from skel directory into it.

Ignore

Or you can create a user step by step.

[Root @ localhost ~] # Useradd-g ftp phpwind123 press enter to create a phpwind123 user. He belongs to the FTP group and is created in this way. He has SSH permission and the directory is under/home.

Next we will modify his permissions and directory:

[Root @ localhost ~] # Usermod-S/sbin/nologin phpwind123 press enter to modify phpwind123 permissions cancel his SSH permissions so that he only has FTP logon Permissions

[Root @ localhost ~] # Usermod-D/var/www/html phpwind123 press enter to modify the phpwind123 root directory. Other "var/www/html" means that the phpwind123 FTP root directory is configured according to the above Environment

The root directory of the website is under/var/www/html;

Then modify the phpwind123 logon password:

[Root @ localhost ~] # Passwd phpwind123 press ENTER

The following prompt appears:

Changing password for user phpwind123.

New Unix Password: phpwind123 enter the password here we will set it to phpwind123 and press ENTER

Retype new Unix Password: phpwind123 Confirm Password press enter if both passwords are consistent, the following prompt will appear

Passwd: All authentication tokens updated successfully. The password is set successfully;

Step 4:

Modify SELinux Parameters

[Root @ localhost ~] # Setsebool ftpd_disable_trans 1 Press ENTER

[Root @ localhost ~] # Service vsftpd restart vsftp

Note: If this parameter is not modified, a prompt is displayed during connection.

500 Oops: cannot change Directory:/MPEG

500 Oops: child died

Step 5:

Modify website directory/var/www/html permissions and configure vsftp

[Root @ localhost ~] # Chomd-r 755/var/www/html the website directory is generally set to 755 permissions. "-R" indicates that all the folders and files in HTML are set to 755 permissions. undo-R

[Root @ localhost ~] # Chown-r phpwind123: ftp/var/www/html set the website directory running user permissions here we set/var/www/html to run in user phpwind123 and FTP group

"-R" indicates that all folders and files in the HTML are set. You can cancel-R if you do not need it.

In this way, users can view other directories. To ensure security, we need to lock users to the corresponding FTP root directory and modify the vsftp configuration file:

[Root @ localhost ~] # Vi/etc/vsftpd. conf: edit the vsftp configuration file. The path is/etc/vsftpd. conf.

Modify the content

Set anonymous_enable = No to restrict anonymous user logon.

Local_enable = yes # enable local user logon

Write_enable = yes # Set the write operation.

Local_umask = 022 # Set the permission mask for uploaded files

Userlist_enable = yes # Enable User Logon Control

Chroot_local_user = Yes chroot_list_enable = No chroot_list_file =/etc/vsftpd/chroot_list

After modification, restart vsftp. If you have previously connected to the FTP tool, disable the FTP tool and re-open the connection.

Here, the user is locked to the FTP root directory. In this way, you can also modify the files in the FTP.

For example:

Step 6:

Bind a domain name to a website: The following is the simplest method to bind a domain name.

Open the Apache configuration file and edit it.

[Root @ localhost ~] # Vi/etc/httpd/CONF/httpd. conf press ENTER

Find

# Modify namevirtualhost *: 80

Namevirtualhost 61.164.140.243: 80

Remove "#" And change * to the IP address of VPs.

Add at the bottom of the file:

<Virtualhost 61.164.140.243: 80>

You can customize the directory of the DocumentRoot/var/www/html/bbs1 website.

Servername cesih.ibmf.cn Host Name

Serveralias ceshi.ibmf.cn ceshi2.ibmf.cn: domain names bound to multiple domains are separated by spaces.

</Virtualhost>

Restart apahce after modification.

[Root @ localhost ~] # Service httpd restart

If there are multiple websites, add the directory configuration to the back and restart Apache. For example, if I have another website under the/var/www/html/BBS directory, configure the following two websites:

<Virtualhost 61.164.140.243: 80>

DocumentRoot/var/www/html/bbs1

Servername cesih.ibmf.cn

Serveralias ceshi.ibmf.cn ceshi2.ibmf.cn

</Virtualhost>

<Virtualhost 61.164.140.243: 80>

DocumentRoot/var/www/html/BBS

Servername bbs.zhztk.com

Serveralias bbs.zhztk.com

</Virtualhost>

[Root @ localhost ~] # Service httpd restart

The installation is complete.

For instructions on downloading and installing Webmin, refer:

Http://www.zhztk.com/a/ruanjianxiazai/2011/0217/634.HTML

Http://www.zhztk.com/a/xitongjiagou/Linuxxitong/2011/0217/636.HTML

Http://www.zhztk.com/a/xitongjiagou/Linuxxitong/2011/0217/637.HTML

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.