SAP Hybris管理后台(Hybris hmc)安装步骤

三步安装SAP Hybris HMC

2)设置ANT的bin路径(path),ant clean all,hybrisserver.bat启动hybris;
How to: Install hybris on AWS

Create An Environment

  • Create an EC2 instance in AWS. The recommended server requirements Quad Core, e.g. i7, 16 GB memory and 20 GB of hard disk space, SSD recommended.
  • Please make sure the ports 9001 & 9002 are configured in the AWS Security Group to get access to this instance.
  • Connect to the AWS instance by Putty
  • Get root access and install all server components required for hybris
    • sudo -s #to gain root access
    • yum install java
    • yum install mysqld
    • service mysqld start #to start the service
  • Create a new user and set a password for this user. I prefer to install hybris in its own environment.
    • useradd hybris <enter>
    • passwd hybris <enter>
  • Switch to the hybris user
    • su hybris

Install And Build Hybris

  • Download the hybris installation file (, 2GB) to your desktop (
  • Download and open WinSCP (or Filezilla) to create an SCP connection to transfer the installation file to the hybris home directory
  • In my situation I could only connect with the EC2-user and therefor transfer the file only to the home directory of the EC2-user. But that is not the place I want hybris to be installed. So I used the following command to move the file to the hybris home directory before unzipping.
    • mv /home/ec2-user/ /home/hybris/
  • Unzip the file
    • unzip /home/hybris/
  • Clean up the installation file
    • rm
  • Build the build the hybris Commerce Suite
    • cd /home/hybris/hybris/bin/platform
    • . ./ #please add the dot at first followed by a space
    • #If the command is run properly, there will be no specific output
    • ant clean all #This will start building hybris
  • Press the Enter key to use the default, the develop configuration template.
  • Wait for the build to complete. It may take several minutes:
    • Total time: 2 minutes 5 seconds
  • Start hybris
    • cd /home/hybris/hybris/bin/platform
    • . ./ #please add the dot at first followed by a space
  • (!) Do not close the command window because the hybris Server must continue running in this window while you work in the hybris Commerce Suite. You may minimize it.
  • Wait for the hybris Server start-up to complete:
    • Dec 12, 2014 3:39:08 PM org.apache.catalina.startup.Catalina start
    • INFO: Server startup in 163949 ms
  • The hybris Commerce Suite is now ready for use. Open the hybris Administration Console, the default URL for which is http://localhost:9001

Configure Hybris As A Service

To auto-start hybris on boot we need to configure hybris as a service.
  • Stop the hybris server and get back to root access
    • CTRL-C
    • exit
  • Create a hybris service startup file
    • vi /etc/init.d/hybris
  • Copy the text from the following file into the new created file.
    hybris startup script
  • Set the correct value for the hybris installation directory
    • # Make sure the server starts as a non-root user, set that here.
    • RUNAS=”hybris”
    • # Set the base path to your hybris installation.
    • HYBRIS_HOME=”/home/hybris/hybris”
  • Save the file
  • To verify the file is saved correctly open the file
    • cat /etc/init.d/hybris
  • Make sure the file can be executed
    • chmod 755 /etc/init.d/hybris
  • Add the file to the server startup list
    • chkconfig –add hybris
    • chkconfig hybris on
    • service hybris start

Configure Hybris With A MySQL Database

  • Make sure the mysqld service will auto-start on boot
  • Create a mysql database for hybris
    • mysql -u root
    • CREATE DATABASE hybris_db;
    • GRANT all ON hybris_db.* TO ‘hybris’@’localhost’;
    • UPDATE mysql.user SET Password=PASSWORD(‘password’) WHERE User=’hybris’;
    • SELECT user,host FROM mysql.user; #show all users
    • exit
    • mysql -u hybris -h localhost -p #to log in as the hybris user
    • SHOW DATABASES; #to show all databases
    • exit
  • Restart the mysql service
    • sudo /etc/init.d/mysqld stop
    • sudo /etc/init.d/mysqld start
  • Download the mysql db connector from
  • Put the jar-file in the  folder ${HYBRIS_BIN_DIR}/platform/lib/dbdriver/
    (yet again I need to copy the file from my ec2-user home directory as I cannot use FTP on my hybris user)

    • exit #to gain root access
    • mv /home/ec2-user/mysql-connector-java-5.1.34-bin.jar/home/hybris/hybris/bin/platform/lib/dbdriver/mysql-connector-java-5.1.34-bin.jar
    • chown hybris:hybris /home/hybris/hybris/bin/platform/lib/dbdriver/mysql-connector-java-5.1.34-bin.jar#to set the owner and group to hybris
  • Put the mysql properties file in
  • Set the correct values in the properties file to connect with the mysql database
    • su hybris
    • vi /home/hybris/hybris/bin/platform/
    • db.url=jdbc:mysql://localhost/hybris_db?useConfigs=maxPerformance
    • db.driver=com.mysql.jdbc.Driver
    • db.username=hybris
    • db.password={password}
    • db.tableprefix=hybris_db
    • mysql.allow.fractional.seconds=true
    • mysql.optional.tabledefs=CHARSET=utf8 COLLATE=utf8_bin
    • mysql.tabletype=InnoDB
    • #hsqldb.usecachedtables=true
  • Save the file
  • Edit the config and add the following
    • vi /etc/my.cnf
    • innodb_flush_log_at_trx_commit=0
  • Save the file
  • Rebuild hybris
    • cd /home/hybris/hybris/bin/platform
    • . ./
    • ant clean all #rebuild

Initialize Hybris

  • Restart hybris
    • exit #to gain root access
    • service hybris restart
  • Open the hybris Administration Console, the default URL for which is http://{AWS IP}:9001

All Done!