CentOS 6.6 安裝OCSNG-server 2.1.2

來源:互聯網
上載者:User

CentOS 6.6 安裝OCSNG-server 2.1.2

1,在CentOS 6.6 安裝OCSNG-server 2.1.2
2,OCS_Agent for linux 在Redhat和CentOS,Debian和Ubuntu上安裝用戶端,【用我寫的一鍵自動化指令碼http://990487026.blog.51cto.com/10133282/1686589】
3,OCS_Agent for windows 圖形介面太簡單,安裝時填寫伺服器的https地址就可以了。
4, OCS_Agent for MAC,圖形介面太簡單,安裝時填寫伺服器的http地址就可以了,用https會報錯。

5, OCSNG_Server 服務平台安裝好了,那麼就摸索裡面的功能吧
6,OCSNG-Server 與 GLPI 資料匯入


所需平台:CentOS-6.6-x86_64 Desktop,開發套件 ,全新安裝
所需檔案我已打包:

-rw-r--r--. 1 root root 4.4M 8月 20 16:06 OCSNG-Server-packages.tar.gz

連結:http://pan.baidu.com/s/1pJKK4w7密碼:a0re

所需CA根憑證與web服務的被簽認證和自己私密金鑰,三個檔案。


Ready ~ Go!
======================================================================

下載163的yum源:
wget http://mirrors.163.com/.help/CentOS-Base-163.repo

yum安裝所需的組件: 總量 169個包
yum install -y httpd mysql mysql-server php-mysql gcc gcc-c++ glibc-devel glibc-headers autoconf automake bzip2-devel zlib-devel ncurses-devel libjpeg-devel libpng-devel libtiff-devel freetype-devel pam-devel openssl-devel libXpm libX11 libxml2-devel gettext-devel pcre-devel php php-devel php-gd php-pecl-zipphp-devel php-pear php-imap php-ldap php-odbc php-xml php-xmlrpc mod_perl php-mbstring perl mod_perl perl-XML-Simple perl-Compress-Zlib perl-DBI perl-DBD-MySQL perl-Net-IP


service mysqld start
service httpd start

修改mysql的預設密碼
mysqladmin -uroot password "your_password"

配置HTTP、mysql隨系統啟動:
chkconfig httpd on
chkconfig mysqld on

安裝Digest-SHA1-2.02.tar.gz:
tar -zxfDigest-SHA1-2.02.tar.gz
cd Digest-SHA1-2.02
perl Makefile.PL
echo $?
make
echo $?
make install
echo $?

安裝模組:Apache-DBI
tar -zxf Apache-DBI-1.06.tar.gz
cd Apache-DBI-1.06
perl Makefile.PL
echo $?
make
echo $?
make install
echo $?




配置Perl環境:
手動安裝模組:SOAP-Lite:
tar xf SOAP-Lite-0.69.tar.gz
cd SOAP-Lite-0.69
perl Makefile.PL 一路按斷行符號
echo $?
make
echo $?
make install
echo $?


安裝模組:XML-Entities:
tar -zxf XML-Entities-1.0000.tar.gz
cd XML-Entities
perl Makefile.PL
echo $?
make
echo $?
make install

安裝OCSNG
tar xf OCSNG_UNIX_SERVER-2.1.2.tar.gz
cd OCSNG_UNIX_SERVER-2.1.2.tar.gz
./setup.sh
指令碼一路斷行符號即可,如有錯誤請檢查所有Perl模組是否安裝正確

【Watch out!】其中有一個選項需要注意:
Where to copy Administration Server static filesfor PHP Web Console
[/usr/share/ocsinventory-reports] ?/var/www/html/
手動輸入,選擇web檔案存放的路徑, /var/www/html/

提示如下資訊證明已經安裝成功:
DON'TFORGET TO RESTART APACHE DAEMON !
Enjoy OCSInventory NG ;-)



service iptables stop
===========================================================
瀏覽器訪問http://serverip/ocsreports/install.php進行安裝配置

輸入mysql使用者名稱root密碼your_password,如果mysql為本機,地址是localhost

用預設的admin/admin進入
【提示】
Please enter the label of the windows client tag input box:
(Leave empty if you don't want a popup to be shown on each agent launch)
點擊輸入框右側的【提交查詢】

【點擊】Click here to enter OCS-NG GUI


=================================================================
【OSC安裝完畢】

1,使用https加密傳輸,參考:架設CA伺服器實現https通訊,web伺服器使用CA自簽認證與https通訊http://990487026.blog.51cto.com/10133282/1686127



2 解決 三個警告!
SECURITY ALERT!
Your install.php exists in your installation directory.
The default SQL login/password is activate on your database: ocsweb

解決方式如下:
http://wiki.ocsinventory-ng.org/index.php/Documentation:Secure



************如果報錯:500 Internal server error********************************

運行用戶端(linux環境)
#ocsinventory-agent --server localhost

日誌報告
“Cannot establish communication : 500 Internal server error”。

根據論壇的建議去,運行命令
tail /var/log/httpd/error_log

看到類似資訊
[Wed Aug 27 10:09:23 2008] [error] [client x.x.x.x] Can't call method "do" on an undefined value at /usr/lib/perl/5.8.8/Apache/Ocsinventory/Server/System.pm line 177.\n

根據提示,查看/usr/lib/perl/5.8.8/Apache/Ocsinventory/Server/System.pm 的177行看到如下內容:
# Connection...
my $dbh = DBI->connect("DBI:mysql:database=$database;host=$host;port=$port", $user, $password, \%params);
$dbh->do("SET NAMES 'utf8'") if($dbh && $ENV{'OCS_OPT_UNICODE_SUPPORT'});
$dbh->do("SET sql_mode='NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'");
return $dbh;

修改mysql的使用者名稱和密碼
vim /etc/httpd/conf.d/z-ocsinventory-server.conf
line 28:
# User allowed to connect to database
PerlSetEnv OCS_DB_USER ocs
# Password for user
PerlSetVar OCS_DB_PWD ocs


把那兩個ocs分別替換為你的mysql使用者名稱和密碼。然後把httpd重啟,再次運行:

#ocsinventory-agent

************報錯:500 Internal server error 問題解決********************************

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.