Linuxfedoracore3 basic service configuration process

Source: Internet
Author: User
Tags apache php ftp client
The basic service configuration process of Linuxfedoracore3-Linux Enterprise Application-Linux server application information. For details, refer to the following section. Requirements:
Apache + php + zend + mysql + phpmyadmin + proftpd (mysql verification)

Preliminary work:

Vi for file Compiler: vi/etc/http/conf/httpd. conf
If the file has not been modified, run the return command: Press esc, enter: q and press enter to exit.
Save and exit after file modification: Press esc, enter: wq and press enter to exit
If the file is not saved after modification, Press esc and enter q! Press enter to exit


Login Server:
The default port 22 for ssh logon. For details about how to modify the port, see:
Common Logon tools: penguinet putty securecrt

Server # setup enter graphical interface
Remove unnecessary services. If you have no special requirements, only the following services are retained.

Crond
Iptables
Network
Sshd
Syslog

After modification, exit and restart the server:
Server # init 6
Log on to the server again and check the current system service listening port.
Server # netstat-an # Now we should see the following information, listening to port 22 only.

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
Tcp 0 0: 22: * LISTEN
Tcp 0 204: ffff: 207.210.70.25: 22: ffff: 218.83.83.8: 2518 ESTABLISHED

Now let's start working on the subject:

# Mkdir-p/home/soft # create a directory for saving the Installation File
# Cd/home/soft # Enter the directory just created
Download and install the software (use the wget command to download the software. The following uses the mysql installation package as an example)
Server # wget http://dev.mysql.com/get/D...
Download the following software in the same way (the following software is the most stable version of the directory ):
Mysql-standard-4.1.12-pc-linux-gnu-i686.tar.gz
Httpd-2.0.54.tar.gz
Php-5.0.4.tar.gz
ZendOptimizer-2.5.10-linux-glibc21-i386.tar.gz
PhpMyAdmin-2.6.3-pl1.tar.gz

Install mysql
# Tar-zxvf mysql-standard-4.1.12-pc-linux-gnu-i686.tar.gz # unzip the installation package to generate a mysql-standard-4.1.12-pc-linux-gnu-i686 directory
# Music mysql-standard-4.1.12-pc-linux-gnu-i686/usr/local/mysql
# Groupadd mysql
# Useradd-g mysql
# Cd/usr/local/mysql
#./Scripts/mysql_install_db
# Chown-R root.
# Chown-R mysql data
# Chgrp-R mysql.
#./Bin/safe_mysqld -- user = mysql & press ENTER
# Cp./support-files/mysql. server/etc/rc. d/init. d/mysql
# Cd/etc/rc. d/init. d
# Chmod + x mysql
# Cd/sbin
#./Chkconfig -- del mysql
#./Chkconfig -- add mysql
# Cd/usr/local/mysql/bin
#./Mysql
Mysql> show databases;
+ ---------- +
| Database |
+ ---------- +
| Mysql |
| Test |
+ ---------- +
2 rows in set (0.00 sec)

If the above information is displayed normally, mysql has just been installed!

Apache installation (cd/home/soft return to the installer directory)
# Tar-zxvf httpd-2.0.54.tar.gz
# Cd httpd-2.0.54
#./Configure -- prefix =/usr/local/apache -- enable-modules = most -- enable-shared = max
# Make
# Make install
#/Usr/local/apache/bin/apachectl start
Open IE and test access in the form of http: // 192.168.0.1. If you can enable the server to open the apache test page normally, your installation is successful!

Php installation (cd/home/soft return to the installer directory)
# Tar-zxvf php-5.0.4.tar.gz
# Cd php-5.0.4
#./Configure -- prefix =/usr/local/php -- with-apxs2 =/usr/local/apache/bin/apxs -- with-mysql =/usr/local/mysql
# Make
# Make install

# Cp php. ini-dist/usr/local/php/lib/php. ini

# Vi php. ini (modify register_globals Off-> On)

# Vi/usr/local/apache/conf/httpd. conf (Add the following content)

DirectoryIndex index.html. var index.htm index. php index.shtml index. cgi index. phtml index. php4

AddType application/x-httpd-php4. php4. phtml
AddType application/x-httpd-php4-source. phps

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

Modify adddefacharcharset to gb2312

ZEND Installation
# Tar-zxvf ZendOptimizer-2.5.10-linux-glibc21-i386.tar.gz
# Cd ZendOptimizer-2.5.10-linux-glibc21-i386
# Install. sh install ZEND as prompted. The system automatically restarts apache


Test whether mysql apache php zend works properly ~~~
# Cd/usr/local/apache/htdocs
# Vi test. php
Add the following content:



Save and exit
Open IE with http: // 192.168.0.1/test. ph... test Access. If you can enable the Service normally and check ZEND, Mysql, and other information, your installation is successful!

PhpMyAdmin Installation
This plug-in is easy to install and decompress.
# Tar-zxvf phpMyAdmin-2.6.3-pl1.tar.gz
# Mv phpMyAdmin-2.6.3-pl1/usr/local/apache/htdocs/phpmyadmin
# Cd/usr/local/apache/htdocs/phpmyadmin
# Vi config. inc. php (modify the following lines)
$ Cfg ['pmaabsoluteuri '] = '7x24 ';
$ Cfg ['pmaabsoluteuri _ DisableWarning '] = FALSE;
$ Cfg ['pmanorelation _ DisableWarning '] = FALSE;
$ Cfg ['servers'] [$ I] ['auth _ type'] = 'cooker ';

Proftpd Installation
Before installing proftp, you must first make a job. mysql in China is compiled by yourself and/etc/ld. so. conf must be modified first. Otherwise, an error will be reported when you run proftp later.
Vi/etc/ld. so. conf
Add the following line:
/Usr/local/mysql/lib/mysql

Note: If the installation path of mysql is different from that of mysql, enter the corresponding path.

1. Download related software
Wget ftp://ftp.proftpd.org/dist...
Download the latest proftp version 1.2.9
Wget http://www.castaglia.org/p...
This is the disk quota module that works with proftp.
2 decompress and compile
Tar zvxf proftpd-1.2.9.tar.gz
Tar zvxf proftpd-mod-quotatab-1.2.11.tar.gz
Cp proftpd-mod-quotatab-1.2.11/mod_quotatab/*. c proftpd-1.2.9/contrib/
Cp proftpd-mod-quotatab-1.2.11/mod_quotatab/*. h contrib/
Vi contrib/mod_ SQL _mysql.c
Find the line # include and change mysql. h to the path of the file in your system, such as/usr/local/mysql/include/mysql. h.
Compile:
./Configure
-- Prefix =/usr/local/proftpd
-- With-modules = mod_ SQL: mod_ SQL _mysql: mod_quotatab: mod_quotatab_ SQL: mod_ratio
-- Enable-force-setpassent
-- With-Primary des =/usr/local/mysql/include/mysql
-- With-libraries =/usr/local/mysql/lib/mysql
Make
Make install

Proftpd user mysql authentication Configuration
Go to the mysql database creation page (you can also perform this operation on the phpmyadmin interface)
> Create database proftpd;
> Grant all on prftpd. * to proftpd @ localhost idenfied by "password ";
> Use proftpd;
Create a table (copy and execute the code on the phpmyadmin Interface)
#--------------------------------------------------------

#
# Data table structure 'groups'
#

Create table groups (
Groupname varchar (255) binary not null default '',
Gid int (11) not null default '0 ',
Members text not null,
Primary key (groupname)
) TYPE = MyISAM;
#--------------------------------------------------------

#
# Data table structure 'users'
#

Create table users (
Userid varchar (255) binary not null default '',
Passwd varchar (255) binary not null default '',
Uid int (11) default NULL,
Gid int (11) default NULL,
Homedir varchar (255) default NULL,
Shell varchar (255) default NULL,
Count int (11) default NULL,
Used double (10, 1) default '0. 0 ',
Quota double (10000000) default '2014. 0 ',
Primary key (userid)
) TYPE = MyISAM;
-----------------------------------------------------------
Create a verification file
Vi/usr/local/proftpd/vhost. conf
# Mysql Authentication
SQLConnectInfo proftpd @ localhost proftpd password # Here, the password is the password set when the proftpd account is created
SQLAuthenticate users *
SQLAuthTypes Plaintext
SQLUserInfo users userid passwd uid gid homedir shell
SQLGroupInfo groups groupname gid members
SQLHomedirOnDemand on

# Quota
SQLQuotaTable users
SQLQuotaInfo localhost proftpd password proftpd # The password here is the password set when the proftpd account is created
SQLQuotaName userid
SQLQuotaUsed used
SQLQuotaQuota quota

Edit the configuration file:
Vi/usr/local/proftpd/etc/proftpd. conf (Add the following content to the comment line)

# Set the user and group under which the server will run.
User nobody
Group nobody

Quotas on
QuotaType hard
QuotaDefault 10485760
Quotac1c on
QuotaBlockSize 1000
QuotaBlockName "K bytes"

AllowOverwrite on
AllowStoreRestart on
UseReverseDNS off
DefaultRoot ~ /
ServerIdent off
MaxClientsPerUser 20
MaxClientsPerHost 3
AllowRetrieveRestart on

Include/usr/local/proftpd/vmysql. conf
RequireValidShell off
PassivePorts 60000 65535 # passive port. Open it in iptables.

DenyFilter *.*/

UseReverseDNS off
IdentLookups off

AllowRetrieveRestart on
AllowStoreRestart on


OK. Now we can start proftp, as long

/Usr/local/proftpd/sbin/proftpd start.

Log on to phpmyadmin and add an ftp user to the user table of the proftpd database.

Use your ftp client to test the following and you should be able to log on normally.

Create a proftpd script

As long as the source code directory in proftp

Proftpd-1.2.9/contrib/dist/rpm/proftpd. init. d/etc/rc. d/init. d/proftpd

Remember to modify the proftpd file. Generally, You need to modify the actual path of proftpd.

Chmod 755/etc/rc. d/init. d/proftpd
OK

You can use this script to start, stop, and restart proftp later.

So far, the configuration of a linux system server is basically complete.
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.