Solaris10 NETWORK SERVICE

Source: Internet
Author: User
Tags windows download ssh secure file transfer
Solaris10 Network Service-Linux Enterprise Application-Linux server application information. The following is a detailed description. A few years ago, sun Microsystems proposed the famous "Network is a computer" slogan, so that the concept of network gradually became understood by the world and accelerated the pace of Information Network. Today, information networks are everywhere. It is logical to use the solaris 10 with excellent performance to provide a variety of network services. With the further development of the solaris 10 open source, more and more software providers and software developers began to provide support for solaris, which means that the software available under solaris 10 is becoming richer and richer.
Solaris 10, as a mainstream unix operating system, supports almost all popular network services. When we install solaris 10, we will install network services such as apache and nfs to the server by default. However, in actual applications, network services that come with the system are generally not used (by customizing the installation method, selecting the required software package and canceling some of the default system packages, such as apache ), download the source code as needed and install it manually. Compared with automatic installation, manual installation is more flexible and can meet actual needs. Since not every software has a solaris package, but also to take into account other unix/linux platforms, I suggest using a Binary source package for installation.

Set and modify Network Parameters
Compared with linux, it is difficult to set or modify the network of solaris. Follow these steps to set or modify network parameters:

1. view the Interface Name: # ifc? A
-Bash-3.00 # ifc-
Lo0: flags = 2001000849 Mtu 8232 index 1
Inet 127.0.0.1 netmask ff000000
Iprb0: flags = 1000843 Mtu 1500 index 2
Inet 192.168.2.16 netmask ffffff00 broadcast 192.168.2.255
Ether 0: e: c: 9b: cc: 80
The above output shows that the network interface name is iprb0.

2. open the file/etc/hostname. iprb0 and check the corresponding host name. In this example, there is only one name, sery.
# Cat/etc/hostname. iprb0
Sery

3. Modify the/etc/hosts file to mirror the IP address and host name.
  
4. Modify the file/etc/netmasks in the following format:
# The netmasks file associates internet protocol (ip) address
# Masks with ip network numbers.
#
# Network-number netmask
#
# The term network-number refers to a number obtained from the internet netwo
Rk
# Information center.
#
# Both the network-number and the netmasks are specified in
# "Decimal dot" notati e. g:
#
#128.32.0.0 255.255.255.0
#
192.168.2.0 255.255.255.0 // This line is manually added
  
5. Modify the/etc/defaultrouter file and set the default gateway. Only one default gateway can be set. Otherwise, confusion may occur. My example is as follows:
-Bash-3.00 # cat/etc/defaultrouter
192.168.2.254
  
6. Set the dns Client. Because the/etc directory does not have text lines such as file resolv. c 61.135.154.50, three dns servers can be added, which is useless.
7. Change/etc/nsswitch. c file to "hosts: dns file ". Note that there are spaces in the middle. This step is essential, otherwise dns will not work.

8. Verify the network configuration. # Ping www.163.com to check whether it is normal.

Some preparations
To make subsequent operations easier and more convenient, you also need to install some software (such as wget) and make some changes to the environment variable path.

1. install the software package wget, which is used to download files from a remote website to your current directory. By comparison, wget downloads are much faster than windows download tools. Because wget is not installed by default in the system, we need to install it manually. Download the package wget-1.10.2-sol10-x86-local.gz from the http://www.sunfreeware.com/indexintel10.html of the website (downloaded with a windows tool), and then transmit the file to the solaris server through the ssh client tool ssh secure file transfer client; log on to solaris10 remotely and run the command in the directory where package wget-1.10.2-sol10-x86-local.gz is located # gzip? D wget-1.10.2-sol10-x86-local.gz, installation package # pkgadd? D wget-1.10.2-sol10-x86-local.

2. Set the path of the environment variable. The default environment variables of solaris 10 do not meet the actual requirements. You need to modify them. A common situation is to set the path ). Experiment: run the command # make system prompts "make command not found", but the command actually exists. If you do not believe it, use # find/-name make to search. Set path according to the author's style,
-Bash-3.00 # echo $ path
/Usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/ccs/bin:/usr/openwin/bin: /usr/sfw/bin
Modify the/etc/profile file, append the above output line to the file, save and run # source/etc/profile to make the modification of the environment variable take effect. At this time, we are running the command # make to generate the following content: "make: fatal error: no arguments to build". It doesn't matter. It just means that the command is not followed by parameters, it also indicates that the path settings are correct.

Now everything is ready. Next we will introduce several main network services of solaris 10.

Web Service apache
So far, web services are still the largest number of network services on the internet. There are many web server software, but apache, the leading software, occupies more than 70% of web servers.
1. Obtain the apache installation package. # Wget requests. There is no/root directory in the solaris 10 system. This directory is created manually. By modifying the/etc/passwd file, set the root user's home directory to/root (the default directory is root directory /), then modify the/root directory permission to 700.
2. decompress the package. Run # gzip in the directory of the downloaded file (here is/root? D httpd-2.2.3.tar.gz, run # tar xvf httpd-2.2.3.tar after the command is complete.
3. Configure, compile, and install apache. run the command # cd httpd-2.2.3 switch to unzip the generated directory httpd-2.2.3, and then check the directory to see if there are any help files for installation, such as install or readme, fortunately, these two text files are available in the directory. Open the install file to obtain the installation method of the software package.

From this install file, you can obtain methods such as quick installation and startup of apache in unix. Then we will execute the command #./c? in the current directory? Prefix =/usr/local/apache2? Enable-so. Note: c # make; make install can normally complete apache installation within a period of time.
4. modify the configuration file/usr/local/apache2/conf/httpd. c.
5. After modifying the configuration file, run the apachectl command to check for any syntax errors. Run the command #/usr/local/apache2/bin/apachect? T. You can start the apache service without syntax errors.
6. Start and Stop the apache service. It is really interesting to start the apache service. Run the command #/usr/local/apache2/bin/apachect start to start apache. How do you know that apache is started according to our wishes? Verify it. Method 1: view the apache process. The command is # ps? Aef | grep httpd. Method

2. Enter the IP address of the solaris server in the browser of another windows server. If the page content is displayed normally, the result is successful. Experience shows that the most important reason for apache failure to start normally is that the configuration file is modified incorrectly. One suggestion is to first put the configuration file in the same directory (Here c #/usr/local/apache2/bin/apachectl stop) before modifying the configuration file.

Mysql Database Service
Mysql database is a very popular database server in linux. For the solaris 10 operating environment, mysql also supports-mysql has an installation package for the solaris platform. In this case, we use the Binary source code of mysql for installation.
1. Download the source code installation package. # Wget http://mysql.easynet.be/downloads//mysql-4.1/mysql-4.1.21.tar.gz
2. Unpack and decompress mysql. # Gzip? D mysql-4.1.21.tar.gz, # tar xvf mysql-4.1.21.tar.
3. Switch the Directory and perform configuration operations. # Cd mysql 4.1.21 ,#. /C? Prefix =/usr/local/mysql.
4. Compile and install. # make; make install.
5. Add mysql users and groups. # Groupadd mysql, # useradd? G mysql.
6. Change the directory owner. Switch to the/usr/local/mysql directory and run the command # chown? R mysql: mysql lib.
7. initialize the database. #/Usr/local/mysql/bin/mysql_install_db? User = mysql. The following is the initialization:

8. Start the mysql service. #/usr/local/mysql/bin/mysqld_safe? User = mysql &.
9. Verify that the mysql service is properly started. View the process first # ps? Aef | grep mysql: After the mysql process is running, use the mysql client program to connect to the test #/usr/local/mysql/bin/mysql? U root. Because the initial mysql user root does not set a password, you can directly connect to the mysql server. As long as the mysql prompt "mysql>" appears, you can think that the mysql service is normal.
10. other operations. The operation in linux is the same as that in linux.
11. Disable the mysql service. #/Usr/local/mysql/bin/mysqladmin shutdown.
Tip: for some examples of mysql, such as mysql-standard-5.0.18-linux-i686-glibc23.tar.gz, you do not need to configure, compile, and install these processes. After unpacking, decompress the package and initialize the database directly.

Nfs (Network File System)
The previous two network services are open-source software provided by a third party, but network file system (nfs) is sun's own product. Nfs has been installed to solaris 10 by default, so you do not need to install it manually. I tried to install the nfs package of the Binary source code, but it took a lot of effort.

1. Shared File System. Syntax basic format share? F nfs? O <用户权限> <共享的目录> . The following is an example of the shared directory/export/home/sery:
# Share? F nfs rw = 192.168.10.0/24/export/home/sery // open the directory/export/home/sery to the CIDR Block 192.168.10.0 for sharing. Users of This CIDR block have read and write permissions on the shared directory.

2. Enable the nfs service. By default, the nfs service of solaris 10 is started, and the command # svcs? A | grep nfs to check whether its status is online (# svcadm enable svc:/network/nfs/server: default, check whether nfs is enabled after the command is executed

3. Mount the shared directory on the client. you can mount the nfs client either in the solaris environment or in linux. In this case, you must enable the nfs client and then use the mount command to mount the nfs client. The solaris nfs client has two Daemon Processes:/usr/lib/nfs/statd and/usr/lib/nfs/lockd. in linux, you must enable the portmap service (# service portmap start ), next we will link the sharing given in Step 1:
# Mount? F nfs 192.168.10.20:/export/home/sery/mnt/nfs // mount the remote server 192.168.10.20 directory/export/home/sery to the local directory/mnt/nfs
When the client performs the mounting operation, the root account should be used. However, for the shared directory of the remote nfs server, the root account is only a low-permission account of the nfs server (nobody: x: 60001: 60001: nfs an access user:/:). Therefore, you must grant the account with the id of 60001 read/write permission on the nfs server to read and write the mounted directory on the client, this is easily overlooked by beginners, and is also the direct reason why mount mounting cannot be correctly executed. Remember: The system permission must be higher than the application permission.
In the step of setting the shared directory, after the solaris 10 is restarted, the configuration will no longer be valid. To keep the configuration valid, you need to write it to the file. The file path of solaris10 is/etc/dfs/dfstab (linux system is/etc/export). Add the command line to the file to be shared.
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.