#########################################################################################################
#####################################system update#######################################################
#########################################################################################################
LANG=C
yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-develkrb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers
#########################################################################################################
#####################################jboss###############################################################
#########################################################################################################
1、设置环境变量:
[iyunv@wych-1 configuration]# vi /etc/profile
export JAVA_HOME=/usr/local/jdk
export JBOSS_HOME=/usr/local/jboss
PATH=$JAVA_HOME/bin:$PATH:$HOME/bin:$JBOSS_HOME/bin
[iyunv@wych-1 bin]# vi /etc/hosts
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
10.10.42.211 master wych01
10.10.42.212 wych02
10.10.42.213 wych03
2、修改master的host.xml:
[iyunv@wych-1 configuration]# cd /usr/local/jboss/domain/configuration
[iyunv@wych-1 configuration]# cp host-master.xml host.xml
[iyunv@wych-1 configuration]# vi /usr/local/jboss/domain/configuration/host.xml
......
<subsystem xmlns="urn:jboss:domain:messaging:1.4">
<hornetq-server>
<!--
<cluster-user>jms-user</cluster-user>
<cluster-password>simple-pass</cluster-password>
<cluster-password>${jboss.messaging.cluster.password:CHANGE ME!!}</cluster-password>
-->
<security-enabled>false</security-enabled>
<persistence-enabled>true</persistence-enabled>
......
<subsystem xmlns="urn:jboss:domain:messaging:1.4">
<hornetq-server>
<security-enabled>false</security-enabled>
<persistence-enabled>true</persistence-enabled>
<journal-type>NIO</journal-type>
<journal-min-files>2</journal-min-files>
......
<interfaces>
<interface name="management">
<inet-address value="${jboss.bind.address.management:10.10.42.211}"/>
</interface>
</interfaces>
3、启动domain:
[iyunv@wych-1 configuration]# nohup domain.sh &
4、登陆控制台:
http://10.10.42.211:9990/console
Welcome to EAP 6
The Enterprise Application Platform 6 is running.
However you have not yet added any users to be able to access the admin console.
To add a new user execute the add-user.sh script within the bin folder of your EAP 6 installation and enter the requested information.
By default the realm name used by EAP is "ManagementRealm" this is already selected by default.
After you have added the user follow this link to Try Again.
5、设置控制台密码:
[iyunv@wych-1 bin]# cd /usr/local/jboss/bin/
[iyunv@wych-1 bin]# ./add-user.sh
What type of user do you wish to add?
a) Management User (mgmt-users.properties)
b) Application User (application-users.properties)
(a): a
To represent the user add the following to the server-identities definition <secret value="VGVzdF8xMjM0" /> //很重要的东西,添加节点是要用的,一定要记录下来
6、重新登陆控制台:
http://10.10.42.211:9990/console
7、添加host control
7.1、创建用户
[iyunv@wych-1 local]# add-user.sh wych02 Test_1234
Added user 'wych02' to file '/usr/local/jboss/standalone/configuration/mgmt-users.properties'
Added user 'wych02' to file '/usr/local/jboss/domain/configuration/mgmt-users.properties'
[iyunv@wych-1 local]# add-user.sh wych03 Test_1234
Added user 'wych03' to file '/usr/local/jboss/standalone/configuration/mgmt-users.properties'
Added user 'wych03' to file '/usr/local/jboss/domain/configuration/mgmt-users.properties'
7.2、修改配置文件
[iyunv@wych-2 configuration]# vi ./host.xml
<host name="wych02" xmlns="urn:jboss:domain:1.5">
<management>
<security-realms>
<security-realm name="ManagementRealm">
<server-identities>
<!-- Replace this with either a base64 password of your own, or use a vault with a vault expression -->
<secret value="VGVzdF8xMjM0"/>
</server-identities>
......
<domain-controller>
<remote host="${jboss.domain.master.address:10.10.42.211}" port="${jboss.domain.master.port:9999}" security-realm="ManagementRealm"/>
</domain-controller>
......
<interfaces>
<interface name="management">
<inet-address value="${jboss.bind.address.management:10.10.42.212}"/>
</interface>
<interface name="public">
<inet-address value="${jboss.bind.address:10.10.42.212}"/>
</interface>
<interface name="unsecure">
<!-- Used for IIOP sockets in the standard configuration.
To secure JacORB you need to setup SSL -->
<inet-address value="${jboss.bind.address.unsecure:10.10.42.212}"/>
</interface>
</interfaces>
[dom ain@ localhost:9999 /] EAP_HOME/bin/jboss-cli.sh
[dom ain@ localhost:9999 /] /host=master:shutdown
[dom ain@ localhost:9999 /] /server-group=main-server-group:start-servers
[dom ain@ localhost:9999 /] /server-group=main-server-group:stop-servers
[dom ain@ localhost:9999 /] /host=master/server-config=server-one:start
[dom ain@ localhost:9999 /] /host=master/server-config=server-one:stop
[dom ain@ localhost:9999 /] quit
[disconnected /] connect
$ EAP_HOME/bin/jbo ss-cli .sh --connect
$ EAP_HOME/bin/jbo ss-cli .sh --connect --controller= 192.168.0.1:9999
[standalone@ localhost:9999 /] deploy --help
[standalone@ localhost:9999 /] history
[standalone@ localhost:9999 /] history --clear
#########################################################################################################
#####################################nginx###############################################################
#########################################################################################################
//查看nginx编译参数:/usr/local/nginx/sbin/nginx -V
//查看apache编译参数:cat /usr/local/apache2/build/config.nice
//查看mysql编译参数:cat /usr/local/mysql/bin/mysqlbug | grep CONFIGURE_LINE
//查看php编译参数:/usr/local/php/bin/php -i | grep configure
//[iyunv@localhost sbin]# ./nginx -V
//nginx version: nginx/0.8.55
//built by gcc 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC)
//configure arguments: --prefix=/usr/local/nginx --with-pcre=/opt/pcre-8.35 --with-http_realip_module --without-http-cache
tar xzvf pcre-8.35.tar.gz
cd ./pcre-8.35
make && make install
tar xzvf nginx-0.8.55.tar.gz
cd ./nginx-0.8.55
./configure --prefix=/usr/local/nginx --with-pcre=/opt/pcre-8.35 --with-http_realip_module --without-http-cache
make && make install
vi /usr/local/nginx/conf/nginx.conf
http {
include mime.types;
default_type application/octet-stream;
upstream myapp {
# server 10.10.42.6:9000 weight=1;
server 10.10.7.60:9002 weight=1;
server 10.10.7.60:9003 weight=1;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
root html; ################修改为绝对路径时表示在php环境下绝对路径
#fastcgi_pass 10.10.7.60:9001;
fastcgi_pass myapp;
fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; #####$document_root 为root定义路径
include fastcgi_params;
}