0,导入虚拟机
1,打开ubuntu虚拟机
1.1 登陆用户名和密码ubuntu
2,配置可上网
2.1 sudo su 输入ubuntu
2.2 vim /etc/network/interfaces
修改此文件,将后三行删除;
将static改为dhcp
2.3 /etc/init.d/networking restart 重启网卡
2.4 经过xshell管理虚拟机
如下操做在xshell中执行:
sudo su 在root 权限中执行
3.配置sources.list
3.1 qq群下载 sources.list
3.2 rz 回车,从弹出的windows窗口 选中文件,传入到虚拟机
3.3 复制替换sources.list文件 cp sources.list /etc/apt/sources.list
3.4 aptitude update 更新软件列表
4.查看数据库是否安装:dpkg -l|grep mysql (未安装用aptitude install mysql-server-5.5)
5,启动数据库: /etc/init.d/mysql start
6,链接数据库:mysql -uroot -pquanshi
6.1 初始化数据库
use mysql;
delete from user where User="";
update user set Password=PASSWORD('111111') where User='root';
update user set host="%" where user="root"; //容许远程机器链接
grant all privileges on *.* to 'root'@'%' identified by '111111';
flush privileges;
7,建立数据库:create database esc;
7.1 quit 断开数据库sho
8,使用rz 命令,导入网站文件和数据库文件
(derunshop.tar.gz和derun.sql)
8.1再次链接到数据库:mysql -uroot -p111111
8.2 切换到esc数据库:use esc
8.3 导入数据:source /root/derun.sql
9,安装apache
aptitude install libapache2-mod-php5 php-mdb2-driver-mysql php5-mysql php5-gd php5
安装相关组件
9.1 解压缩网站文件:tar -xzvf derunshop.tar.gz
9.2 cd /etc/apache2/sites-enabled/
9.3 rm rf *
9.3.2 a2ensite default生成站点
9.4 将解压缩获得的demo文件拷贝到网站目录:cp -r demo /var/www
9.5 cd /var/www
9.6 chmod -R 777 demo
9.5 /etc/init.d/apache2 restart
10. 安装的话使用aptitude install libapache2-mod-php5 php-mdb2-driver-mysql php5-mysql php5-gd php5命令,安装php相关服务
11,windows 浏览器里访问http://虚拟机Ip/demo
后台:http://192.168.31.97/demo/admin
用户名:admin 密码:P@ssw0rdphp