个人工具

“OpenVZ”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
第1行: 第1行:
 
OpevnVZ 一些自用初始化脚本
 
OpevnVZ 一些自用初始化脚本
  
 +
* 安装java基本环境
 
  sed -i "s/archive.ubuntu.com/mirrors.163.com/" /etc/apt/sources.list
 
  sed -i "s/archive.ubuntu.com/mirrors.163.com/" /etc/apt/sources.list
 
  apt-get update
 
  apt-get update
第11行: 第12行:
 
  adduser ubuntu
 
  adduser ubuntu
 
  adduser ubuntu sudo
 
  adduser ubuntu sudo
 +
 +
* 安装数据库 postgresql
 
  apt-get install postgresql
 
  apt-get install postgresql
 
  sed -i "s/#\(include_if_exists.*\)/\1/" /etc/postgresql/9.3/main/postgresql.conf
 
  sed -i "s/#\(include_if_exists.*\)/\1/" /etc/postgresql/9.3/main/postgresql.conf
 
  echo "listen_addresses = '*'" >> /etc/postgresql/9.3/main/exists.conf
 
  echo "listen_addresses = '*'" >> /etc/postgresql/9.3/main/exists.conf
 
  /etc/init.d/postgresql restart
 
  /etc/init.d/postgresql restart
----------------
+
 
 +
** 设置数据库密码
 
  sudo -u postgres psql postgres
 
  sudo -u postgres psql postgres
 
  postgres=# \password postgres
 
  postgres=# \password postgres
 
  postgres=# \quit
 
  postgres=# \quit
----------------
+
 
 +
* 下载wildfly
 
  su ubuntu
 
  su ubuntu
 
  cd
 
  cd
第32行: 第37行:
 
  cd /home/ubuntu/wildfly/standalone/deployments
 
  cd /home/ubuntu/wildfly/standalone/deployments
 
  wget https://jdbc.postgresql.org/download/postgresql-9.4-1200.jdbc41.jar
 
  wget https://jdbc.postgresql.org/download/postgresql-9.4-1200.jdbc41.jar
-----------------
+
 
 +
** 配置jboss数据源
 
  ./jboss-cli.sh --connect
 
  ./jboss-cli.sh --connect
 
  [standalone@localhost:9990 /] data-source add --name=core --jndi-name=java:/core --driver-name=postgresql-9.4-1200.jdbc41.jar --connection-url=java:postgresql:mcmp --user-name=postgres --password=postgres --transaction-isolation==TRANSACTION_READ_COMMITTED --min-pool-size=10 --max-pool-size=250
 
  [standalone@localhost:9990 /] data-source add --name=core --jndi-name=java:/core --driver-name=postgresql-9.4-1200.jdbc41.jar --connection-url=java:postgresql:mcmp --user-name=postgres --password=postgres --transaction-isolation==TRANSACTION_READ_COMMITTED --min-pool-size=10 --max-pool-size=250
 
  [standalone@localhost:9990 /] exit
 
  [standalone@localhost:9990 /] exit

2015年2月10日 (二) 15:06的版本

OpevnVZ 一些自用初始化脚本

  • 安装java基本环境
sed -i "s/archive.ubuntu.com/mirrors.163.com/" /etc/apt/sources.list
apt-get update
apt-get dist-upgrade
locale-gen --lang zh_CN.UTF-8
dpkg-reconfigure locales
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
apt-get install openjdk-7-jdk
apt-get install sudo screen
adduser ubuntu
adduser ubuntu sudo
  • 安装数据库 postgresql
apt-get install postgresql
sed -i "s/#\(include_if_exists.*\)/\1/" /etc/postgresql/9.3/main/postgresql.conf
echo "listen_addresses = '*'" >> /etc/postgresql/9.3/main/exists.conf
/etc/init.d/postgresql restart
    • 设置数据库密码
sudo -u postgres psql postgres
postgres=# \password postgres
postgres=# \quit
  • 下载wildfly
su ubuntu
cd
wget http://download.jboss.org/wildfly/8.2.0.Final/wildfly-8.2.0.Final.tar.gz
tar xzvf wildfly-8.2.0.Final.tar.gz
mv wildfly-8.2.0.Final wildfly
rm wildfly-8.2.0.Final.tar.gz
echo 'JAVA_OPTS="$JAVA_OPTS -Djboss.bind.address=0.0.0.0"' >> /home/ubuntu/wildfly/bin/standalone.conf
echo 'JAVA_OPTS="$JAVA_OPTS -Djboss.bind.address.management=0.0.0.0"' >> /home/ubuntu/wildfly/bin/standalone.conf
echo 'ubuntu=35291eedea6d270cb71fe7dfd36d0c89' >> /home/ubuntu/wildfly/standalone/configuration/mgmt-users.properties
echo 'ubuntu=' >> /home/ubuntu/wildfly/standalone/configuration/mgmt-groups.properties
cd /home/ubuntu/wildfly/standalone/deployments
wget https://jdbc.postgresql.org/download/postgresql-9.4-1200.jdbc41.jar
    • 配置jboss数据源
./jboss-cli.sh --connect
[standalone@localhost:9990 /] data-source add --name=core --jndi-name=java:/core --driver-name=postgresql-9.4-1200.jdbc41.jar --connection-url=java:postgresql:mcmp --user-name=postgres --password=postgres --transaction-isolation==TRANSACTION_READ_COMMITTED --min-pool-size=10 --max-pool-size=250
[standalone@localhost:9990 /] exit