ขั้นการปรับแต่งสภาพแวดล้อมให้โปรแกรมทำงานได้ โดยการเข้าไปที่โฟลเดอร์ที่ไฟล์ติดตั้งอยู่ซึ่งก็ขึ้นอยู่กับว่าแต่ละคน ติดตั้งไว้ที่ไหน
1. การปรับแต่ง alfresco
1. การปรับแต่ง alfresco
1 | <span style= "font-size: 100%;" >cd /opt/Alfresco</span> |
แล้วเปิดไฟล์โดยการพิมพ์คำสั่งดังนี้
1 | vi /opt/Alfresco/alfresco.sh |
ก็จะได้ไฟล์ที่มีโคดดังต่อไปนี้ครับ ให้กำหนดค่าต่างตามนั้นเลย
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | #!/bin/sh # Start or stop Alfresco server # Set the following to where Tomcat is installed ALF_HOME=/opt/Alfresco cd "$ALF_HOME" APPSERVER= "${ALF_HOME}/tomcat" export JAVA_HOME= "/usr/lib/jvm/java-6-sun-1.6.0.10/" # Set any default JVM values export JAVA_OPTS= '-Xms128m -Xmx512m -XX:MaxPermSize=128m -server' # Following only needed for Sun JVMs before to 1.5 update 8 #export JAVA_OPTS="${JAVA_OPTS} -XX:CompileCommand=exclude,org/apache/lucene/index/IndexReader\$ 1 ,doBody -XX:CompileCommand=exclude,org/alfr #esco/repo/search/impl/lucene/index/IndexInfo\$Merger ,mergeIndexes -XX:CompileCommand=exclude ,org/alfresco/repo/search/impl/lucene/index/Ind #exInfo\$Merger,mergeDeletions" # if [ "$1" = "start" ]; then "${APPSERVER}/bin/startup.sh" # if [ -r ./virtual_start.sh ]; then # sh ./virtual_start.sh # fi # if [ -r "$ALF_HOME" /start_oo.sh ]; then # sh "$ALF_HOME" /start_oo.sh # fi elif [ "$1" = "stop" ]; then "${APPSERVER}/bin/shutdown.sh" # if [ -r ./virtual_start.sh ]; then # sh ./virtual_stop.sh< # fi # if [ -r "$ALF_HOME" /start_oo.sh ]; then # killall soffice.bin # fi fi |
2. การปรับแต่ง Virtual Alfrescoให้ทำเปิดไฟล์ดังต่อไปนี้
1 | vi /opt/Alfresco/virtual_alf.sh |
จะได้
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #!/bin/sh # Start or stop Alfresco server # Set the following to where Tomcat is installed ALF_HOME=/opt/Alfresco cd "$ALF_HOME" APPSERVER= "$ALF_HOME" /virtual-tomcat export JAVA_HOME= "/usr/lib/jvm/java-6-sun-1.6.0.10/" # Start virtual-tomcat # if [ "$1" = "start" ]; then "$APPSERVER" /bin/startup.sh elif [ "$1" = "stop" ]; then "$APPSERVER" /bin/shutdown.sh fi |
3. การเปลี่ยนฐานข้อมูลจาก HSQL Database เป็น MySQL Database ซึ่งฐานข้อมูลชนิดอื่นก็เหมือนกัน พิมพ์คำสั่ง
1 2 3 4 5 | mysql -u root -p จากนั้น พิมพ์ mysql> exit; sudo mysql -p < /opt/Alfresco/extras/databases/mysql/db_setup.sql #mysql -p mysql> show databases; |
จะได้
+--------------------+
| Database |
+--------------------+
| information_schema |
| alfresco |
| mysql |
+--------------------+
3 rows in set (0.00 sec)
1 | mysql>quit |
จากนั้นเข้าไปที่โฟลเดอร์
1 | cd tomcat/shared/classes/alfresco/extension/ และทำการเปิดไฟล์ |
vi custom-repository.properties
ให้ทำการเปลี่ยน dir.root ดังต่อไปนี้
1 2 3 | # Sample custom content and index data location # dir.root=/opt/Alfresco/alf_data |
และใส่ comment HSQL connection และลบ comment ออก สำหรับ MySQL connection ดังต่อไปนี้
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ..... # Derby connection # #db.driver=org.apache.derby.jdbc.EmbeddedDriver #db.url=jdbc:derby:alf_data/derby_data/alfresco;create= true # # HSQL connection # #db.driver=org.hsqldb.jdbcDriver #db.url=jdbc:hsqldb:file:alf_data/hsql_data/alfresco;ifexists= true ;shutdown= true ; # # MySQL connection (This is default and requires mysql-connector-java- 5.0 . 3 -bin.jar, which ships with the Alfresco server) # db.driver=org.gjt.mm.mysql.Driver db.url=jdbc:mysql: //localhost/alfresco ...... |
ให้ทำการบันทึกและปิดหน้าดังกล่าวแล้วเปิดไฟล์
1 | vi custom-hibernate-dialect.properties |
ให้ทำการใส่ commemt ตัวที่ไม่ใช้และเปิดตัวที่ใช้
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ....... # # Derby dialect # #hibernate.dialect=org.hibernate.dialect.DerbyDialect # # HSQL dialect # #hibernate.dialect=org.hibernate.dialect.HSQLDialect # # MySQL dialect ( default ) # hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect # # PostgreSQL dialect # ...... |
การปรับแต่ง MySQL connectivity ให้เปิดไฟล์โดยใช้คำสั่ง
gedit /etc/mysql/my.cnf จากนั้นหาคำว่า bind-address และกำหนดค่าดังนี้
1 2 3 | ..... bind-address = localhost ...... |
จากนั้นเปิดไฟล์
vi custom-repository.properties และกำหนดดังนี้
1 2 3 | ...... db.url=jdbc:mysql: //localhost/alfresco ...... |
ทำการ start โปรแกรม
1 | /opt/Alfresco/alfresco.sh start |
และเปิดเว็บ browser และเข้าไปที่
http://HOSTNAME:8080/alfrescouser: admin
pass: admin
อ้างอิงจาก Installing_Alfresco_Lab_3_Stable_on_Ubuntu_8.10
0 comments:
Post a Comment