Linux network server architecture five

zhaozj2021-02-16  50

/ * ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------ Write in front: I see many netizens's questions are related to server configuration, build a reliable and safe application development The server is the foundation of web programming, especially for friends who have developed JSP on Linux.

This document is the crystallization of my multi-year server configuration. I haven't been modified by my N before publishing (the last big revision is just released in RH7.2, and then because I have not found a mistake because I didn't find any mistakes, I didn't have it. Upgrade), documentation

Be reprinted by Tianji.com by the end of 2001 (http://www.yesky.com/200206/217592.shtml), then reproduced multiple Linux and Java communities such as LinuxBYE.NET, CNJsp.COM, have not been discovered since the time test Error, you are as good as

safe to use.

Documentation is not ideal in the web page, if you want to get PDF of this document, or have any comments, you can mail to Roczhao@msn.com

The document is longer, divided into more articles, this is the fifth article, the following is the text: -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ----------------------------------------- * /

1 Create a startup script

## Creating a RESIN service, the truth is the same, but here is the same, but here is to set the relevant environment variables.

## Create a script file

Touch /etc/rc.d/init.d/resin

## Change file permissions

Chmod 701 /etc/rc.d/init.d/resin

## Connect to related startup level

ln -s /etc/rc.d/ininit.d/resin /etc/rc.d/rc5.d/s70resin

## Edit Start Script

vi /etc/rc.d/init.d/resin

## The contents of the file are as follows:

#! / bin / bash

#Set environment parameter:

Java_home = / usr / local / jvm

Resin_home = / usr / local / resin

Class_home = / usr / local / lib / java

ClassPath = $ ClassPath: $ java_home / lib / Tools.jar: $ java_home / lib / dt.jar: $ JAVA_HOME / JRE / LIB: $ RESIN_HOME / LIB: $ Class_Home / Drivers / mm.mysql-2.0.4-bin. JAR.ZIP:1 --class.jar:/class_home/javamail/mail.jar: $ class_home / javamail /smtp.jar: $ class_home / javamail /pop3.jar: $ class_home / javamail / mailapi.jar: $ Class_home / javamail / IMap.jar

PATH = $ path: / bin: / sbin: / usr / bin: / usr / local / bin: / usr / local / jvm / bin: / usr / local / jvm / jre / bin: / usr / local / mysql / bin: / usr / bin / x11: / usr / x11r6 / bin

Export Java_Home Resin_Home Class_Home ClassPath Path

#Start Resin Web Server

Exec /usr/local/resin/httpd.sh start

-------------------------------------------------- ----------------------------------------- Step 2 phpmyadmin install

## phpmyadmin is my favorite mysql client tool. I also use other clients, including Win32 DBTools, MySQLFRONT, etc., and web-based tools, however, I finally found phpMyAdmin still irreplaceable. It is very good based on web-based versatility, free installation, multi-user, platform-independent, stability, open source, and extremely fast upgrade speed. Moreover, this document mainly discusses the configuration of the server, so I still only introduce PHPMYADMIN here.

1 Configure DNS

vi /var/named/yesgo.loc

# 追加 行, of course, you can customize other alias or host names

Mysql in cname ns.yesgo.loc.

/etc/rc.d/init.d/named restart // Restart DNS service

NSLOOKUP / / Test Whether to resolve success

2 establish FTP

## When you install MySQL, we have built an account called MySQL. If you have not yet established, you can establish it according to the following statement:

UserAdd MySQ -S / dev / null -g ftpchroot

Passwd mysql

3 Install phpmyadmin

TAR XVZF / Home / SRC / PHPMY *

Cp / Home / SRC / PHPMYADMIN / * / HOME / MySQL

Chown -r mysql / home / mysql

chown -r mysql / home / mysql / *

CHMOD 701 / HOME / MySQL

CHMOD 701 / HOME / MySQL / *

4 Add a virtual host

vi /usr/local/apache/conf/httpd.conf

ServerAdmin webmaster@yesgo.loc DocumentRoot / home / mysql ServerName mysql.yesgo.loc ErrorLog logs / mysql.yesgo.loc-error_log CustomLog logs / mysql.yesgo.loc-access_log common

5 Add authentication

## Add mysql user

## Use the authentication function, phpMyAdmin needs a starter user, this user has query permissions for MySQL's related tables, and the specific definition is as follows:

Shell> mysql -p

. Mysql> GRANT USAGE ON mysql * TO '' @ 'localhost' IDENTIFIED BY ''; mysql> GRANT SELECT (Host, User, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Reload_priv, Shutdown_priv , Process_priv, File_priv, Grant_priv, References_priv, Index_priv, Alter_priv) ON mysql.user TO '' @ 'localhost'; mysql> GRANT SELECT ON mysql.db TO '' @ 'localhost'; mysql> GRANT SELECT (Host, DB, User, Table_name, Table_Priv, Column_Priv) on mysql.tables_priv to '' @ 'localhost'; ## modify the configuration file

vi config.inc.php

$ cfgservers [1] ['Host'] = 'localhost'; // host name

$ cfgservers [1] ['port'] = '3306'; // Default port

$ cfgservers [1] ['socket'] = '; // Used Socket path

$ cfgservers [1] ['connection_type'] = 'TCP'; // Use TCP or Socket mode to connect

$ cfgservers [1] ['stduser'] = ''; // Standard User Account Name

$ cfgservers [1] ['stdpass'] = ''; // Standard account password

$ cfgservers [1] ['auth_type'] = 'http'; // Specifying the verification method for config, HTTP or cookie, this is a change in version 2.2.3, more secure way is HTTP verification

$ cfgServers [1] ['user'] = 'root'; // mysql account

$ cfgservers [1] ['password'] = ''; // only need to fill in when using the config verification method

$ cfgservers [1] ['Only_DB'] = ''; // If you specify a database here, then only list this database on the left after the login is listed.

6 test phpmyadmin

Apache Restart

Lynx http://mysql.yesgo.loc // Recommended using client browser testing

转载请注明原文地址:https://www.9cbs.com/read-23317.html

New Post(0)