Precautions for lamp + vsftp + Zend optimizer Configuration

Source: Internet
Author: User
Tags builtin vps server
1> standard configuration under/etc/vsftpd. conf

# Example config file/etc/vsftpd. conf
#
# The default compiled in settings are fairly paranoid. This sample file
# Loosens things up a bit, to make the FTP daemon more usable.
# Please see vsftpd. CONF.5 for all compiled in defaults.
#
# Read this: this example file is not an exhaustive list of vsftpd options.
# Please read the vsftpd. CONF.5 manual page to get a full idea of vsftpd's
# Capabilities.
#
# Allow Anonymous FTP? (Beware-allowed by default if you comment this out ).
Anonymous_enable = No
#
# Uncomment this to allow local users to log in.
Local_enable = Yes
#
# Uncomment this to enable any form of FTP write command.
Write_enable = Yes
#
# Default umask for local users is 077. You may wish to change this to 022,
# If your users CT that (022 is used by most other ftpd's)
Local_umask = 022
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# Has an effect if the above global write enable is activated. Also, you will
# Obviously need to create a Directory Writable By the FTP user.
# Anon_upload_enable = Yes
#
# Uncomment this if you want the anonymous FTP user to be able to create
# New directories.
# Anon_mkdir_write_enable = Yes
#
# Activate directory messages-messages given to remote users when they
# Go into a certain directory.
Dirmessage_enable = Yes
#
# Activate logging of uploads/downloads.
Xferlog_enable = Yes
#
# Make sure port transfer connections originate from Port 20 (ftp-data ).
Connect_from_port_20 = Yes
#
# If you want, you can arrange for uploaded anonymous files to be owned
# A different user. Note! Using "root" for uploaded files is not
# Recommended!
# Chown_uploads = Yes
# Chown_username = whoever
#
# You may override where the log file goes if you like. The default is shown
# Below.
# Xferlog_file =/var/log/vsftpd. Log
#
# If you want, you can have your log file in standard ftpd xferlog format
Xferlog_std_format = Yes
#
# You may change the default value for timing out an idle session.
# Idle_session_timeout = 600
#
# You may change the default value for timing out a data connection.
# Data_connection_timeout = 120
#
# It is recommended that you define on your system a unique user which
# Ftp server can use as a totally isolated and unprivileged user.
# Nopriv_user = ft1_cure
#
# Enable this and the server will recognize asynchronous Abor requests. Not
# Recommended for Security (the code is non-trivial). Not enabling it,
# However, may confuse older FTP clients.
# Async_abor_enable = Yes
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# The request. Turn on the below options to have the server actually do ASCII
# Mangling on files when in ASCII mode.
# Beware that on some FTP servers, ASCII support allows a Denial of Service
# Attack (DOS) via the command "size/big/file" in ASCII mode. vsftpd
# Predicted this attack and has always been safe, reporting the size of
# Raw file.
# ASCII mangling is a horrible feature of the Protocol.
# Ascii_upload_enable = Yes
# Ascii_download_enable = Yes
#
# You may fully customise the login banner string:
Ftpd_banner = welcome to my FTP service.
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# Useful for combatting certain DoS attacks.
# Deny_email_enable = Yes
# (Default follows)
# Banned_email_file =/etc/vsftpd/banned_emails
#
# You may specify an explicit list of local users to chroot () to their home
# Directory. If chroot_local_user is yes, then this list becomes a list
# Users to not chroot ().
Chroot_local_user = Yes
Chroot_list_enable = Yes
# (Default follows)
Chroot_list_file =/etc/vsftpd/chroot_list
#
# You may activate the "-R" option to the builtin ls. This is disabled
# Default to avoid remote users being able to cause excessive I/O on large
# Sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# The presence of the "-R" option, so there is a strong case for enabling it.
# Ls_recurse_enable = Yes

#
# You may activate the "-R" option to the builtin ls. This is disabled
# Default to avoid remote users being able to cause excessive I/O on large
# Sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# The presence of the "-R" option, so there is a strong case for enabling it.
# Ls_recurse_enable = Yes
#
# When "listen" directive is enabled, vsftpd runs in standalone mode and
# Listens on IPv4 Sockets. This directive cannot be used in Conjunction
# With the listen_ipv6 directive.
Listen = Yes
#
# This Directive enables listening on IPv6 Sockets. To listen on IPv4 and IPv6
# Sockets, you must run two copies of vsftpd whith two configuration files.
# Make sure, that one of the listen options is commented !!
# Listen_ipv6 = Yes

Pam_service_name = vsftpd
Userlist_enable = Yes
Tcp_wrappers = Yes
Userlist_deny = Yes
Use_sendfile = No

Certificate ------------------------------------------------------------------------------------------------------------------------------------

2> Add under chroot_list
An FTP user

3>
1. Add a virtual user
Useradd kaqi-r-m-g FTP-D/var/www/html/ftpsite-S/sbin/nologin
Passwd kaqi

2.
Ll/var/www/| grep kaqi1
Chown kaqi/var/www/html/ftpsite
Chmod 777/var/www/html/ftpsite

4> restart vsftpd

Command: Service vsftpd restart

5> this place is very important
After Apache and vsftpd are installed, only files in the default root directory can be accessed.
The SELinux problem occurs after you find the information, so you need to disable this service.
VI/etc/sysconfig/SELinux
SELinux = enforcing --> SELinux = disabled

Restart command reboot takes effect after restart

Certificate --------------------------------------------------------------------------------------------------------------------------------------------------------
Extended knowledge:

Commands for calling services in Linux:

Ntsysv

Certificate ----------------------------------------------------------------------------------------------------------------------------------------------------------------

Install MySQL command: Yum install mysql-Server
// When MySQL is installed for the first time
1. mysql-u root;
2. Use MySQL;
3. Set the password update user SET Password = passwror ('new password') where user = "root ";
4. Flush privileges; // This command is required. Otherwise, the password will be lost after Linux is restarted.
Certificate ------------------------------------------------------------------------------------------------------------------------------------------------

ETC/httpd/conf // directory where HTTP. conf is configured
Where HTTP. conf needs to be configured:
Namevirtualhost *: 80 // open public port 80
Adddefacharcharset GBK // garbled information for the gb2312 webpage

// Configure the virtual directory
<Virtualhost *: 80>
DocumentRoot "/var/www/html/shanghaizx/upload"
Servername www.85zx.com
Serveralias 85.whzx120.com
Errorlog logs/www.85zx120.com-error_log
Customlog logs/www.85x120.com-access_log common
</Virtualhost>

Var/log/httpd // directory where the log file is saved

Certificate ----------------------------------------------------------------------------------------------------------------------------------------------

DNS Configuration:
Path:/etc/resolv. conf

Search localdomain
Nameserver 202.103.24.68

Certificate ----------------------------------------------------------------------------------------------------------------------------------------------
Logrotate is the log polling service in Linux. The main configuration file is the files in/etc/logrotate. conf and/etc/logrotate. D.
How does one rotate a log file by file size?
You can modify the/etc/logrotate. d/httpd configuration file. After the modification is as follows (size = 10 m, rotate 4 is added)
/Var/log/httpd/* log {
Size = 10 m // increase
Rotate 4 // Add
Missingok
Notifempty
Sharedscripts
Postrotate
/Bin/kill-HUP 'cat/var/run/httpd. PID 2>/dev/null' 2>/dev/null | true
Endscript
}

Certificate ----------------------------------------------------------------------------------------------------------------------------------------------

Install Zend Optimizer

Install atomic repository on VPs Server:

 

Wget-Q-o-http://www.atomicorp.com/installers/atomic | sh

 

CD/etc/yum. Repos. d

Yum Update (update related services, such as PHP upgrade and MySQL upgrade)

 

 

Yum search "pacakge name"
Yum install "pacakge name"

 

Php-V

 

PHP 5.1.6 (CLI) (built: Jul 16 2008 19:52:52)
Copyright (c) 1997-2006 the PHP Group
Zend engine v2.1.0, copyright (c) 1998-2006 Zend Technologies
As you see it dose not say with Zend optimizer.

 

 

Yum install PHP-Zend-Optimizer

 

 

Php-V

PHP 5.2.9 (CLI) (built: Mar 11 2009 08:22:06)
Copyright (c) 1997-2009 the PHP Group
Zend engine v2.2.0, copyright (c) 1998-2009 Zend Technologies
With Zend optimizer v3.3.3, copyright (c) 1998-2007, by Zend Technologies

 

Certificate ----------------------------------------------------------------------------------------------------------------------------------------------

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.