RedHatLinux network server architecture practice (III)

Source: Internet
Author: User
Article Title: RedHatLinux network server architecture practice (III ). Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Procedure
Step 1 RedHat 7.2 install
  
My suggestions:
  
1. Create a separate partition for/home during installation. Because/home is the place where user data is stored, the installation files of the software are stored in this directory. Therefore, in this way, when you reinstall the system next time, you can keep the partition and the data will be saved;
2. Use the custom installation method and select the 'everything 'option, which is especially suitable for beginners. Otherwise, a package or command may not be found during subsequent installation; however, if you are configuring an Internet server, you should select only the required packages to ensure security as much as possible;
3. When selecting a language, we recommend that you select simplified chinese (P. r. CHINA) option. In this way, when you configure the server, no declaration is required in the program code, and Chinese characters are supported without garbled characters;
4. Use Gnome as the login manager, use KDE as the default Session, and set the default startup to X. This is done to facilitate remote control;
5. IP Address: 192.168.1.2. This is the IP address I used in this document. You can set it as needed.
6. No firewall settings are involved in this document. After the system is installed, you can use the ntsysv or chkconfig command to disable iptables and ipchains, otherwise, telnet and remote login will become unavailable;
  
Of course, if you are familiar with firewall settings, you can handle them yourself.
  
Step 2 X setup
  
# After completing this step, restart the server and then you can use Extra! Remote control software such as X performs server configuration on the Microsoft platform on a graphical interface. This allows you to control the server and client at the same time without having to run between two machines. If you cannot perform remote control according to the following settings, it is very likely that your firewall policy does not allow this. Disable iptables and ipchains.
  
Vi/etc/X11/TPD. conf // enable remote control
[Xdmcp]
Enable = 1
  
Vi/etc/X11/TPD/Sessions/Default // set the Default Session
Exec/etc/X11/xdm/Xsession kde
  
Vi/etc/X11/xdm/Xaccess // sets the broadcast object
192.168.1 .*
  
Step 3 Services setup
  
Shell> ntsysv
Run the ntsysv command to enable the named, telnet, and wu_ftpd services, disable httpd, mysqld, iptables, ipchains, and other services that are not needed, and then restart the server with reboot.
  
Step 4 Dns setup
  
Vi/etc/named. conf
  
1. Create a standard Region
# You can name it based on your preferences. The suffix I use here is. loc is mainly used to avoid conflicts with registered domain names on the Internet. You can decide your suffix on your own.
# Add the following text to/etc/named. conf
  
Zone yesgo. loc {
Type master;
File "yesgo. loc ";
}
Zone 1.168.192.in-addr. arpa {
Type master;
File "192.168.1 ";
}
  
2. Create a domain name library file
Touch/var/named/yesgo. loc
Touch/var/named/192.168.1
  
# Edit the forward domain name library file and create the Host Name and host alias
Vi/var/named/yesgo. loc
  
@ In soa ns. yesgo. loc. root. ns. yesgo. loc .(
2001050801; Serial
28800; Refresh
14400; Retry
3600000; Expire
86400); Minimum
In ns ns. yesgo. loc.
In mx 0 ns. yesgo. loc.
  
Ns in a 192.168.1.2
Ftp in cname ns. yesgo. loc.
Mail in cname ns. yesgo. loc.
Pop in cname ns. yesgo. loc.
Smtp in cname ns. yesgo. loc.
  
# Edit the Reverse Domain Name library file and create a Host Name Pointer
Vi/var/named/192.168.1
  
@ In soa ns. yesgo. loc. root. ns. yesgo. loc .(
2001050801; Serial
28800; Refresh
14400; Retry
3600000; Expire
86400); Minimum
In ns ns. yesgo. loc.
In mx 0 ns. yesgo. loc.
  
2 in ptr ns. yesgo. loc.
  
3. Restart the DNS service.
/Etc/rc. d/init. d/named restart
  
4. domain name query
# Test whether the domain name is successfully resolved. This is an interactive command line. You can enter a domain name or IP address to query nslookup-sil in both forward and reverse directions.
  
Step 5 KDE setup
  
  
This step is dispensable, because you can ignore it and directly use the default Interface. The general procedure is to perform general settings according to the KDE Configuration Wizard, and then use the KDE control center for detailed configuration. You can use Windows Manager in the KDE Control Panel to set the default Session. You can also use the configuration file to set the default Session.
  
Step 6 Ftp setup
  
Vi/etc/shells
# Add the following line to/etc/shells as the FTP user's shell, so that it cannot use commands and telnet Service/dev/null
  
# Add the ftpchroot group. Users in this group will use their home directory as the FTP root directory.
  
Groupadd ftpchroot
  
# Add an FTP user who can only use the FTP service and use his/her home directory as the root directory
Useradd src-s/dev/null-g ftpchroot // This account is used to store software packages
Passwd src
  
/*
I am used to placing the software package in the Custom/home/src directory. The main purpose is to solve the data preservation and software upload problems mentioned above. If I put the software package in the/usr/local/src directory, these two points can also be implemented, but they are inconvenient. If you are used to putting the software package in/usr/local/src, you can delete/usr/local/src and create a symbolic connection for/home/src.
*/
Rm-R-f/usr/local/src
Ln-s/home/src/usr/local/src
  
Step 7 MySQL, Apache and php Unistall
  
Use the Package Manager or rpm command to uninstall MySQL, Apache, and PHP. It is recommended that you use the Package Manager for beginners to find these three keywords until all related software packages are uninstalled. We will then compile and install these software.
  
Step 8 MySQL install
  
1. Prepare the user
Userdel mysql
Useradd mysql-s/dev/null-g ftpchroot
Passwd mysql
  
2. Install MySQL
Cd/home/src
Tar xvzf my * // unpack
Cd my *
./Configure -- prefix =/usr/local/mysql // Configuration
Make // compile
Make install // install
./Scripts/mysql_install_db // create a database
  
3. Modify folder Permissions
# Modify the related folder permissions below. Otherwise, the MySQL service cannot be started, or you do not have the write permission on the database.
Chown-R root/usr/local/mysql
Chgrp-R mysql/usr/local/mysql
  
Chown-R root/usr/local/mysql/bin
Chgrp-R mysql/usr/local/mysql/bin
  
Chown-R root/usr/local/mysql/var
Chgrp-R mysql/usr/local/mysql/var
Chmod 770/usr/local/mysql/var
  
Chown-R root/usr/local/mysql/var/mysql
Chgrp-R mysql/usr/local/mysql/var/mysql
Chmod 770/usr/local/mysql/var/mysql
  
Chown-R root/usr/local/mysql/var/mysql /*
Chgrp-R mysql/usr/local/mysql/var/mysql /*
Chmod 770/usr/local/mysql/var/mysql /*
  
Chmod 770/usr/local/mysql/lib/mysql/libmysqlclient.
  

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.