如何在CentOS 5.5上安装OCS Inventory NG Server 2
本文介绍如何在Linux Server上安装OCS Inventory NG Server 2。 由BRLink Consultoria Linux团队的Rafael Marangoni编写。
介绍
OCS库存是制作库存的好软件。 NG服务器由通信服务器,部署服务器和管理控制台组成。 点击这里了解它是如何工作的。
将被清盘的计算机必须运行代理(安装在每台计算机上),以连接到OCS NG服务器。 我们正在使用CentOS 5.5(64位)分发版,但它可能适用于Fedora(和Red Hat,肯定)。
1一些先决条件
安装MySQL服务器
我们需要安装它(如果还没有安装):
yum install mysql-server php-mysql php-pecl-zip php-gd
启动MySQL:
/etc/init.d/mysqld start
chkconfig --level 35 mysqld on
在mysql上设置root密码:
/usr/bin/mysqladmin -u root password 'secret'
开始Apache:
我们需要启动Apache(OCS使用它):
/etc/init.d/httpd start
chkconfig --level 35 httpd on
安装软件包
接下来,我们需要安装EPEL仓库:
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
之后,我们来安装软件包:
yum install -y perl-XML-Simple perl-Compress-Zlib perl-DBI perl-DBD-MySQL perl-Net-IP perl-XML-Entities perl-Apache-DBI perl-Apache2-SOAP perl-SOAP-Lite mod_perl
配置PHP
编辑/etc/php.ini
文件,并更改以下行:
vi /etc/php.ini
post_max_size = 200M upload_max_filesize = 200M
重新启动Apache:
/etc/init.d/httpd restart
2安装OCS Inventory NG Server 2
首先,我们需要从OCS Inventory网站下载tarball。 点击这里
mkdir /download
cd /download
wget http://launchpad.net/ocsinventory-server/stable-2.0/2.0rc1/+download/OCSNG_UNIX_SERVER-2.0rc1.tar.gz
启动安装程序:
tar -zxvf OCSNG_UNIX_SERVER-2.0rc1.tar.gz
cd /download/OCSNG_UNIX_SERVER-2.0rc1
sh setup.sh
安装脚本非常简单,它是一个向导。 几乎所有的选项,我们将选择默认选项。
这些是问题:
如果您将问题留空,它将选择默认选项。
Do you wish to continue ([y]/n)?y
Your MySQL client seems to be part of MySQL version 5.0.
Your computer seems to be running MySQL 4.1 or higher, good ;-)
Which host is running database server [localhost] ?localhost
On which port is running database server [3306] ? 3306
Where is Apache daemon binary [/usr/sbin/httpd] ?
Where is Apache main configuration file [/etc/httpd/conf/httpd.conf] ?
Which user account is running Apache web server [apache] ?
Which user group is running Apache web server [apache] ?
Where is Apache Include configuration directory [/etc/httpd/conf.d/] ?
Where is PERL Intrepreter binary [/usr/bin/perl] ?
Do you wish to setup Communication server on this computer ([y]/n)?y
Where to put Communication server log directory [/var/log/ocsinventory-server] ?
OCS setup.sh can install perl module from packages for you
The script will use the native package from your operating system like apt or rpm
Do you wish to continue (y/[n])? y
To ensure Apache loads mod_perl before OCS Inventory NG Communication Server,
Setup can name Communication Server Apache configuration file
'z-ocsinventory-server.conf' instead of 'ocsinventory-server.conf'.
Do you allow Setup renaming Communication Server Apache configuration file
to 'z-ocsinventory-server.conf' ([y]/n) ?y
Do you wish to setup Administration Server (Web Administration Console)
on this computer ([y]/n)?y
CAUTION: Setup now install files in accordance with Filesystem Hierarchy
Standard. So, no file is installed under Apache root document directory
(Refer to Apache configuration files to locate it).
If you're upgrading from OCS Inventory NG Server 1.01 and previous, YOU
MUST REMOVE (or move) directories 'ocsreports' and 'download' from Apache
root document directory.
If you choose to move directory, YOU MUST MOVE 'download' directory to
Administration Server writable/cache directory (by default
/var/lib/ocsinventory-reports), especialy if you use deployement feature.
Do you wish to continue ([y]/n)?y
Where to copy Administration Server static files for PHP Web Console
[/usr/share/ocsinventory-reports] ?
Where to create writable/cache directories for deployement packages,
IPDiscover and SNMP [/var/lib/ocsinventory-reports] ?
3配置OCS清单NG服务器2
创建MySQL数据库:
首先我们需要打开mysql shell:
mysql -u root -p"secret"
然后创建名为ocsweb
的数据库,并向用户ocs
授予密码ocs的权限:
CREATE DATABASE ocsweb;
GRANT ALL ON ocsweb.* to 'ocs'@'localhost' identified by 'ocs';
如果需要,您可以更改这些参数(数据库名称,用户名或密码)。 这是ocs的默认值。
现在,将浏览器指向ocsreports界面,使用管理工具管理服务器:
http://server-ip/ocsreports/
默认用户为“admin”,密码为“admin”。
最后,我们必须删除安装脚本:
rm -f /usr/share/ocsinventory-reports/ocsreports/install.php
现在,您需要做的就是使用机器选项配置服务器。 在网络计算机上安装代理,指向服务器上的ip。
有关更多信息,请查看OCS的维基点击此处 。
参考文献
OCS库存: http : //wiki.ocsinventory-ng.org/index.php/Documentation : Main