1.OpenCms伺服器安裝步驟
1.1安裝Java的JDK,需要1.5或者更新版本;
1.2安裝Tomcat;
1.3安裝MySQL;
1.4下載war包,部署opencms.war包;
1.5通過瀏覽器訪問http://localhost:8080/opencms/setup/地址,按照提示步驟配置就可以;
具體步驟可以官方地址參考:http://www.opencms.org/en/development/installation/server.html,有詳細流程
2.1.5的配置中由於MySQL預設的配置max_allowed_packet小於OpenCMS要求的16M值會出現如下錯誤:
註:max_allowed_packet參數是在mysql4以後才有的,在mysql4以前版本,還沒有這個參數
在安裝opencms是會出現如下錯誤:
MySQL system variable 'max_allowed_packet' is set to 1048576 Byte (1MB).
Please note that it will not be possible for OpenCms to handle files bigger than this value in the VFS.
Error while checking the server configuration!
-------------------------------------------
Your 'max_allowed_packet' variable is set to less than 16777216 Byte (16MB).
The required value for running OpenCms is at least 16MB.Please change your MySQL configuration (in the my.ini or my.cnf file).
解決該問題的辦法:
1.可以通過MySQLWorkbench-Server Status查看到Configuration File:/etc/my.cnf設定檔位置,但是去尋找時並沒有該檔案,說明安裝MySQL時並沒有產生;
2.通過MySQL的命令尋找my.cnf的位置,均沒有找到my.cnf檔案;
localhost:~ apple$ /usr/local/mysql-5.7.17-macos10.12-x86_64/bin/mysql --help | grep my.cnf
order of preference, my.cnf, $MYSQL_TCP_PORT,
/etc/my.cnf /etc/mysql/my.cnf /usr/local/mysql/etc/my.cnf ~/.my.cnf
3.後來度娘搜尋參考http://blog.csdn.net/u013679882/article/details/52919874地址發現可以修改my-default.cnf檔案,然後改為my.cnf複製到/etc下面既可以 在/usr/local/mysql/support-files下有一個my-default.cnf,只要把這個檔案複製到/etc/下,再改名就好了
3.1編輯檔案步驟vi /etc/my.cnf
3.2插入max_allowed_packet=100M,該值大於等於16M即可
3.3按下Esc然後按:wq儲存即可
3.4需要關閉MySQL重新啟動MySQL設定的值才會生效
需要瞭解更多安裝細節可以參考:http://www.tuicool.com/articles/Rz2Uj2I