标签:packages 网址 下载 access sign centos 7 nali tps bottom
操作系统:centos 71、安装并启动Apache:
yum -y install httpd systemctl enable httpd.service systemctl start httpd.service
2、安装PHP和MBSTRING模块:
yum -y install php yum -y install php-mysql yum -y install php-mbstring yum -y install php-snmp
3、安装和启用MySQL:
yum -y install mariadb-server systemctl enable mariadb.service systemctl start mariadb.service
4、MySQL服务安全设置:
mysql_secure_installation
在这一步中,你将会: #设置完root密码后,全部按回车
Set a root password(设置mysql的root用户密码)
Remove anonymous users(删除匿名用户)
Disallow root login remotely(不允许远程root登录)
Remove test database and access to it(删除测试数据库并访问它)
Reload privilege tables(重新加载权限表)
5、为openDCIM创建一个数据库(将数据库名称dcim和密码dcimpassword):
mysql -u root -p MariaDB [(none)]> create database dcim; MariaDB [(none)]> grant all privileges on dcim.* to 'dcim' identified by 'dcimpassword'; MariaDB [(none)]> exit
1、安装Apache SSL模块:
yum -y install mod_ssl
2、生成必要的密钥并将它们复制到适当的目录:
cd /root openssl genrsa -out ca.key 1024 openssl req -new -key ca.key -out ca.csr openssl x509 -req -days 365 -in ca.csr -signkey ca.key -out ca.crt cp ca.crt /etc/pki/tls/certs cp ca.key /etc/pki/tls/private/ca.key cp ca.csr /etc/pki/tls/private/ca.csr
3、设置服务器名称:
vim +/ServerName /etc/httpd/conf/httpd.conf
找到这行...
#ServerName www.example.com:80
...改成以下:
ServerName opendcim.example.net:443
最后重新启动Apache……
systemctl restart httpd.service
1、创建opendcim文件夹
mkdir -p /var/www/html/openDCIM/opendcim
2、现在,为openDCIM虚拟主机创建一个新的配置文件...
vim /etc/httpd/conf.d/opendcim.example.net.conf
... 增加这些内容...
<VirtualHost *:443> SSLEngine On SSLCertificateFile /etc/pki/tls/certs/ca.crt SSLCertificateKeyFile /etc/pki/tls/private/ca.key ServerAdmin you@example.net DocumentRoot /var/www/html/openDCIM/opendcim ServerName opendcim.example.net <Directory /var/www/html/openDCIM/opendcim> AllowOverride All AuthType Basic AuthName "openDCIM" AuthUserFile /var/www/html/openDCIM/opendcim.htpasswd Require valid-user </Directory> </VirtualHost>
使用基本身份验证保护openDCIM web目录,并在上面的Apache配置文件中添加了这些行。
1、现在,要创建至少一个用户,请执行以下操作:
touch /var/www/html/openDCIM/opendcim.htpasswd htpasswd /var/www/html/openDCIM/opendcim.htpasswd administrator
#为用户“administrator”两次输入密码。
1、Firewall允许HTTPS端口443的访问
firewall-cmd --zone=public --add-port=443/tcp --permanent
2、重启 Firewall:
firewall-cmd --reload
1、下载最新版本的openDCIM http://www.opendcim.org/downloads.html (当前最新版本4.5):
cd /var/www/html/openDCIM/
curl -O http://www.opendcim.org/packages/openDCIM-4.5.tar.gz
2、提取文件并创建一个软(符号)链接:
tar zxvf openDCIM-4.5.tar.gz
cd openDCIM-4.5
cp -r * ../opendcim
cd ../opendcim
3、准备配置文件来访问数据库:
cd /var/www/html/openDCIM/opendcim
cp db.inc.php-dist db.inc.php
vim db.inc.php
...编辑以下行... #根据相关参数填入据库用户名和密码(在本例中是localhost)、数据库名称(dcim),以及在创建数据库时指定的凭据:
$dbhost = 'localhost'; $dbname = 'dcim'; $dbuser = 'dcim'; $dbpass = 'dcimpassword';
5、最后,最后一次重新启动Apache:
systemctl restart httpd.service
1、浏览器打开网址
2、填入用户名和密码
dcim dcimpassword
3、登陆成功后,浏览器会显示以下提示
All is well. Please remove install.php to return to normal functionality (删除install.php)
4、删除install.php
mv install.php install.php_bak
标签:packages 网址 下载 access sign centos 7 nali tps bottom
原文地址:http://blog.51cto.com/sunliming/2068104