1.配置 IP 地址
步骤命令1 :虚拟机操作
2.init 5
3.nm-c
4.192.168.4.50
5.nmc conn up eth0
6.IDE磁盘连接小灯泡CentOS-7
7.ifconfig
真机操作开始
8.ssh 192.168.4.50连接密码
9.mount /dev/cdrom /mnt
显示:mount: /dev/sr0 写保护,将以只读方式挂载nm
1 0.yum-config-manager --add file:///mnt
显示:已加载插件:langpacks, product-id
adding repo from: file:///mnt
11.cd /etc/yum.repos.d
12.vim mnt.repo 修改下面
[mnt]
name=added from: file:///mnt
baseurl=file:///mnt
enabled=1
gpgcheck=0保存
13.ls /mnt
14.yum repolist
2.yum 源
3.关闭防火墙。
#systemctl stop firewalld.service
4.关闭 selinux 安全机制。
#setenforce 0
5.安装 httpd 软件,数据库和 php
[[email protected] ~]# yum -y install httpd mariadb-server mariadb php php-mysql
5.配置数据库
[[email protected] ~]# systemctl start mariadb
启动数据库
[[email protected] ~]# systemctl enable mariadb.service
设置开机自启
[[email protected] ~]# mysqladmin -u root password ‘Taren1‘
设置数据库账户 root 密码
7.配置 Httpd
命令cd /var/www/html
touch test1.php
[[email protected] ~]# cat /var/www/html/test1.php
<?php
phpinfo();
?>
[[email protected] ~]# cat /var/www/html/test2.php
<?php
$link=mysql_connect(‘localhost‘,‘root‘,‘Taren1‘);
if($link) echo "Success !!";
//成功则显示 Success !!
else echo "Failure !!";
//失败则显示 Failure !!
mysql_close();
//关闭数据库连接
?>
8.启动服务
[[email protected] ~]# systemctl start httpd.service
9.测试
[[email protected] ~]# firefox http://127.0.0.1/test1.php
[[email protected] ~]# firefox http://127.0.0.1/test2.php
[[email protected] ~]# systemctl restart httpd.service
重启 httpd
PHP 应用部署(Discuz!论坛系统)
10.建论坛库
[[email protected] ~]#
Enter password:
//验证管理密码
提示: MariaDB [(none)]>
mysql> create database bbsdb;
//创建 bbsdb 数据库
mysql> show databases;
//查看数据库
mysql> grant all on bbsdb. to [email protected] identified by ‘pwd123‘;
mysql> quit
//授权数11.部署论坛网页代码
[[email protected] ~]# unzip Discuz_X3.4_SC_UTF8.zip
解压缩 Discuz
[[email protected] ~]# ls upload/
列出 upload/文件夹下内容
[[email protected] ~]# cp -rf upload/ /var/www/html/
递归拷贝
[[email protected] ~]# cd /var/www/html/
切换目录至
/var/www/html
[[email protected] ~]# chown -R apache template/ config/ data/ uc_client/ uc_server/
递归改变所有者文件和文件夹
12.安装论坛系统
[[email protected] ~]# firefox http://127.0.0.1/
13.访问论坛前台首页 http://127.0.0.1/
原文地址:http://blog.51cto.com/13735155/2134555