Linux Server Setup Common environment (i)

Source: Internet
Author: User
Tags dovecot nameserver apache tomcat

Reprinted from:http://blog.163.com/hlz_2599/blog/static/142378474201341394955248/

Reprint is mainly afraid of link failure, later see.

1. Setting up Telnet Server

2. Build a DHCP server

3. Build a DNS server

4, build SendMail server

5. Build FTP Server

6. Build a Web server to install Apache Tomcat

7. Build Samba Server

First, build Telnet server

1. See if there is a Telnet service

Rpm–qa|grep Telnet

Display: Telnet-0.17-39.el5 also need to install Telnet-server-0.17-39.el5

2. Mounting

Mkdir/mnt/cdrom

Mount–t Iso9660/dev/cdrom/mnt/cdrom

3. Locate the server folder

Cd/mnt/cdrom/server

4. Install Telnet Service

LS telnet*

RPM–IVH telnet-server-0.17-39.el5.i386.rpm

5. Check the installation

Rpm-qa|grep Telnet

6. Open Port 23

Chkconfig--list to see if the port is open

Chkconfig telnet on or service telnet start or NTSYSV

7. Log in with "Telnet IP address" and exit Ctrl + D

Second, build a DHCP server

1. See if there is a DHCP service

Rpm–qa|grep DHCPT

2. Mounting

Mkdir/mnt/cdrom

Mount–t Iso9660/dev/cdrom/mnt/cdrom

3. Locate the server folder

Cd/mnt/cdrom/server

4. Install DHCP service

LS dhcp*

RPM–IVH dhcp-3.05-18.el5.i386.rpm

5, check the installation.

Rpm-qa|grep DHCP

6. Configuration Files

Instance file Vi/usr/share/doc/dhcp-3.05/dhcpd.conf.sample

Lease Effectiveness Document Vi/var/lib/dhcpd/dhcpd.leases

Copying a configuration file

Cp/usr/share/doc/dhcp-3.05/dhcpd.conf.sample/etc/dhcpd.conf

Vi/etc/dhcpd.conf

① Modify subnet subnet, subnet mask netmask, route routers, DNS server

② can assign address segments

③ Lease

④ reserved IP for the specified computer

7. Open port

Chkconfig--list to see if the port is open

Chkconfig dhcpd on or service dhcpd start or NTSYSV

Third, build a DNS server

1. Check if there is a DNS service

Rpm–qa|grep bind

2. Mounting

Mkdir/mnt/cdrom

Mount–t Iso9660/dev/cdrom/mnt/cdrom

3. Locate the server folder

Cd/mnt/cdrom/server

4. Install the DNS service

LS bind*

RPM–IVH bind-9.3.4-10.el5.i386.rpm

RPM–IVH bind-chroot-9.3.4-10.p1.el5.i386.rpm

LS caching*

RPM–IVH caching-nameserver-9.3.4-10.p1.el5.i386.rpm

5. Check the installation

Rpm-qa|grep bind

Rpm-qa|grep Caching

6, 4 configuration files

(1) cd/var/named/chroot/etc

Copy Master profile cp-p named.caching-nameserver.conf named.conf

VI named.conf

Modify 15 behavior listen-on port, {any;} ;

27 behavior Allow-query {any;};

(2) Cd/var/named/chroot/etc

VI Named.rfc1912.zones

Modify the name of a forward, reverse file

(3) Configuring forward parsing files

Cd/var/named/chroot/var/named

Cp-p Localdomain.zone Fendou.zone (forward parsing file name)

VI Fendou.zone (forward parsing file name)

(4) Configuring Reverse parsing files

Cd/var/named/chroot/var/named

Cp-p named.local 11.168.192 (Reverse parse file name)

VI 11.168.192 (reverse parse file name)

7. Open port

Chkconfig--list to see if the port is open

Chkconfig named on or service named start or NTSYSV

Iv. Building SendMail Server

First add the forward, reverse region in the Named.rfc1912.zones file, and add the corresponding content in the forward and reverse files.

(i) Installation of SendMail

1. See if there is a SendMail service

Rpm–qa|grep SendMail

2. Mounting

Mkdir/mnt/cdrom

Mount–t Iso9660/dev/cdrom/mnt/cdrom

3. Locate the server folder

Cd/mnt/cdrom/server

4. Installation SendMail Service

LS sendmail*

RPM–IVH sendmail-cf-8.13.8-2.el5.i386.rpm

RPM–IVH sendmail-doc-8.13.8-2.el5.i386.rpm

5. Check the installation

Rpm-qa|grep SendMail

6. Configuration Files

Vi/etc/mail/sendmail.mc

: Set Nu

: 116

Modify addr = 0.0.0.0 Open

52-Line Safety certification

7. MC SENDMAIL.MC > SENDMAIL.CF

8, Vi/etc/mail/local-host-names

Add fendoul.com, save.

In IP settings, change hostname in DNS to fendou.com

9. Service SendMail Start

(ii) Installation of Dovecot

1. See if there is a dovecot service

Rpm–qa|grep Dovecot

2. Mounting

Mkdir/mnt/cdrom

Mount–t Iso9660/dev/cdrom/mnt/cdrom

3. Locate the server folder

Cd/mnt/cdrom/server

4. Installation Dovecot Service

RPM–IVH perl-dbi-1.5.2-2.el5.i386.rpm

RPM–IVH mysql-5.045-7.el5.i386.rpm

RPM–IVH postgresql-libs-8.1.11-1.el5_1.1.i386.rpm

RPM–IVH dovecot-1.0.7-7.el5.i386.rpm

5. Check the installation

Rpm-qa|grep Dovecot

6. Configuration Files

Vi/etc/dovecot.conf

: Set Nu

: 20

Remove the # 20 lines before

Change to Protocols = Imp Imps POP3 pop3s

7. Open Service

Service named start

Service SendMail Start

Service Dovecot Start

(iii) sending mail using SendMail

1. Create user

Useradd-g mail-s/sbin/nologin Test1 does not have logon rights

passwd test1

Useradd-g mail-s/sbin/nologin Test2

passwd test2

2. Send mail

3. View Mail

Vi/var/spool/mail/test2 or Vi/var/spool/mail/root

V. Building an FTP server

1. See if there is an FTP service

Rpm–qa|grep vsftp

2. Mounting

Mkdir/mnt/cdrom

Mount–t Iso9660/dev/cdrom/mnt/cdrom

3. Locate the server folder

Cd/mnt/cdrom/server

4. Installation Vsftp Service

LS vsftp*

RPM–IVH vsftpd-2.0.5-12.el5.i386.rpm

5. Check the installation

Rpm-qa|grep vsftp

6. Configuration Files

Vi/etc/vsftpd/vsftpd.conf

Allow Anonymous Logon

Log on Locally

Allow Write

Permissions

Project Description:

(1) Connection options

Listen_address

Listen_port

(2) Timeout option

57 Line: Idle_session_timeout

(3) Load control

Max_clients Maximum number of login users

MAX_PER_IP number of links under the same IP

Anon_max_rate Anonymous Logon maximum download rate

user_config_dir=/etc/vsftpd/userconf/creating a storage directory for files with the same name

(4) User options

Anonymous_enable Allow anonymous Logins

anon_root=/var/ftp/pub Show Users

7. Open Service

Chkconfig vsftpd on or service vsftpd start

8. Anonymous login using FTP

VI. Building a Web server

1. See if there is an HTTP service

Rpm–qa|grep httpd

2. Mounting

Mkdir/mnt/cdrom

Mount–t Iso9660/dev/cdrom/mnt/cdrom

3. Locate the server folder

Cd/mnt/cdrom/server

4. Installation httpd Service

LS httpd*

RPM–IVH apr-1.2.7-11.el5.i386.rpm

RPM–IVH postgresql-libs-8.1.11-1.el5_1.1.i386.rpm

RPM–IVH apr-util-1.2.7-7.el5.i386.rpm

RPM–IVH httpd-2.2.3-22.el5.i386.rpm

5. Check the installation

Rpm-qa|grep httpd

6. Configuration Files

Vi/etc/httpd/conf/httpd.conf

①57 Line: ServerRoot http Run Directory

②68 Line: Timeout timed out

③134: Listen Monitor port (80)

④251 Line: ServerAdmin Email address

⑤265 Line: ServerName write domain name or IP address

⑥281: DocumentRoot access to the Web directory

⑦391 Line: DirectoryIndex default access page (home)

⑧747 line: Adddefaultcharset default font encoding

⑨ Directory settings:

<Directoryf>

Order Allow.deny

Allow from 192.168.1.0/24

Deny from 192.168.1.200

</Directory>

⑩ virtual directory: 958 rows

<virturalhost*: 80> Note: * Refers to the current local IP address (can not be written)

ServerName www.fendoujiaoyu.com

Documentroot/var/www/html

</VirturalHost>

<virturalhost*: 80>

ServerName bbs.fendoujiaoyu.com

Documentroot/var/www/html/pbbs

</VirturalHost>

7. Open Service

Chkconfig httpd on or service httpd start

Installing Apache Tomcat

1, first put the installation file under Linux, and then find its directory;

CD apache+tomcat+jdk_for_linux/

2. Decompression

TAR-XF apache-tomcat-5.5.27.tar.gz

3. Implementation

./jdk-6u1-linux-i586.bin

4. Configure Environment variables

Cd/etc

VI Profile

(1) Add the following content:

java_home=/home/loocao/software/java/jdk1.6.0_01//write on the correct path

Jre_home= $JAVA _home/jre

classpath=.:$ java_home/lib:$ jre_home/lib:$ CLASSPATH

path=$ java_home/lib:$ jre_home/lib:$ PATH

(2) Add Java_home jre_home after line 45 CLASSPATH

(3): wq! save exit.

(4) Reboot restart

(5) Java-version If the Java version "1.6.0_01" is displayed to indicate a successful configuration

(6) CD Apache-tomcat-5.5.27/bin

(7) Execute under the bin./startup.sh

./shutdown.sh Close

Vii. setting up a Samba server

1. See if there is a samba service

Rpm–qa|grep Samba

Default installation:

Samba-common-3.0.33-3.7.el5

Samba-c L i e n t-3.0.33-3.7.el5

2. Mounting

Mkdir/mnt/cdrom

Mount–t Iso9660/dev/cdrom/mnt/cdrom

3. Locate the server folder

Cd/mnt/cdrom/server

4. Installing Samba Services

LS samba*

RPM–IVH samba-3.0.33-3.7.el5.i386.rpm

RPM–IVH perl-convert-asn1-0.20-1.1.noarch.rpm

5. Check the installation

Rpm-qa|grep Samba

6. Configuration Files

Vi/etc/samba/smb.conf

(1) Modification

74 Rows: Workgroup = Group Name

75 Lines: Explanation

77 Line: Another name

80 rows: Allowed IP and subnets to access

Semicolon as Comment

(2)

101 Rows: Set Secure (share accessible for everyone, user access for specified users)

(3)

124 Rows: Domain name accessible

(4)

249 Rows: Set home directory comment = home directories

250 Rows: Visible

251 Rows: Writable

252 Rows: Fixed user

253 line: Fixed user's domain name

(5)

283 rows: Setting the home directory

284 rows: Setting the home directory path

285 rows: Set to Public

286 Rows: Writable

287 rows: Whether it can be printed

288 Rows: Writable list: such as user name + group name, indicates that both user and group members are writable.

(6) Set up the master directory and change it with all users to the set group, change the permission to 777;

(7) Use the command Testparm to test whether the configuration is correct.

7. Open Service

Service SMB Start

8, under the Linux graphical interface,

⑴ Select Places→connect to Server ...

⑵ in the window that appears, service type: Select Windows share;

⑶ Enter the IP address after the server, connect.

9. Double-click the SMB icon that appears.

Linux Server Setup Common environment (i)

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.