设为首页 收藏本站
查看: 527|回复: 0

[经验分享] 转:通过ssh进行php、mysql、apache安装,进行配置创建数

[复制链接]

尚未签到

发表于 2016-10-18 06:11:37 | 显示全部楼层 |阅读模式
连接到CentOS服务器:
sorry@sorry-faith:~$ ssh root@172.16.112.130
password: 需要填写root用户密码;
root@172.16.112.130's password:
Last login: Sat Dec 19 03:11:26 2009 from 172.16.112.1
[iyunv@localhost ~]#
安装apache,mysql,php以及php连接mysql其组件:
[iyunv@localhost ~]# yum -y install httpd php mysql mysql-server php-mysql
[iyunv@localhost ~]# 安装过程忽略;
安装php插件:
[iyunv@localhost ~]# yum install php-*
[iyunv@localhost ~]# 安装过程忽略;
安装图形支持:
[iyunv@localhost ~]# yum install php-gd
[iyunv@localhost ~]# 安装过程忽略;
测试安装环境:
[iyunv@localhost ~]# rpm -qa |grep mysql
[iyunv@localhost ~]# 过程忽略;
[iyunv@localhost ~]# rpm -qa |grep httpd
[iyunv@localhost ~]# 过程忽略;
[iyunv@localhost ~]# rpm -qa |grep php
[iyunv@localhost ~]# 过程忽略;
配置开机启动服务:
配置apache开机启动;
[iyunv@localhost ~]# /sbin/chkconfig httpd on
[iyunv@localhost ~]# 过程忽略;
添加mysql服务;
[iyunv@localhost ~]# /sbin/chkconfig --add mysqld
[iyunv@localhost ~]# 过程忽略;
添加mysql开机启动;
[iyunv@localhost ~]# /sbin/chkconfig mysqld on
[iyunv@localhost ~]# 过程忽略;
启动httpd服务;
[iyunv@localhost ~]# /sbin/service httpd start
[iyunv@localhost ~]# 过程忽略;
启动mysql服务;
[iyunv@localhost ~]# /sbin/service mysqld start
[iyunv@localhost ~]# 过程忽略;
设置mysql密码:
pw123456修改为你要修改的密码;
[iyunv@localhost ~]# mysqladmin -u root password 'pw123456'
[iyunv@localhost ~]# 过程忽略;
登录到mysql:
root为你的用户名;
[iyunv@localhost ~]# mysql -u root -p
password: 需要填写root用户密码;
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 170
Server version: 5.0.77 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
删除test测试库;
mysql> DROP DATABASE test;
删除匿名帐户;
mysql> DELETE FROM mysql.user WHERE user = '';
重载权限;
mysql> FLUSH PRIVILEGES;
退出mysql;
mysql> exit
Bye
进入默认web目录:
[iyunv@localhost ~]# cd /var/www/html
vi编辑创建php测试文件:
[iyunv@localhost html]# vim info.php
进入vi编辑器:
按键“i“进入编辑模式,输入;
<?php
phpinfo();
?>
按Esc退出编辑模式后输入“:wq!”退出编辑模式;
查看本机IP;
[iyunv@localhost html]# ifconfig
[iyunv@localhost html]# 过程忽略;
得到IP后在浏览器输入:http://IP/info.php
php、mysql、apache已经安装配置成功。

安装dedecms:
下载:dedecms
为方便输入,修改文件名;
sorry@sorry-faith:~/桌面$ mv DedecmsV55-GBK-Final.tar.gz dede.tar.gz
使用scp命令从本地复制文件到服务器内;
sorry@sorry-faith:~/桌面$ scp dede.tar.gz root@172.16.112.130:/var/www/
password: 需要填写root用户密码;
root@172.16.112.130's password:
复制进度,100%为完成;
dede.tar.gz                                   100% 4527KB   4.4MB/s   00:01
进入www目录查看我们刚才复制上去的东西;
[iyunv@localhost ~]# cd /var/www/
ls命令车看目录下文件;
[iyunv@localhost www]# ls
可以看到,我们传上来的dede.tar.gz存在本目录;
cgi-bin  dede.tar.gz  error  html  icons  manual  usage
解压dede.tar.gz文件;
[iyunv@localhost www]# tar -zxvf dede.tar.gz
[iyunv@localhost www]# 过程忽略;
使用ls命令查看解压后目录;
[iyunv@localhost www]# ls
解压后名字为DedeCmsV55-GBK-Final目录;
cgi-bin  DedeCmsV55-GBK-Final  dede.tar.gz  error  html  icons  manual  usage
进入DedeCmsV55-GBK-Final目录;
[iyunv@localhost www]# cd DedeCmsV55-GBK-Final
查看目录下文件;
[iyunv@localhost DedeCmsV55-GBK-Final]# ls
我们只需要uploads目录,因为他为安装目录文件;
修改uploads目录名,修改为html;
[iyunv@localhost DedeCmsV55-GBK-Final]# mv uploads html
复制目录到www目录下;
[iyunv@localhost DedeCmsV55-GBK-Final]# cp -rf html /var/www
因为默认的html目录存在,是否覆盖?我们回答“y“然后回车,确认覆盖;
cp:是否覆盖“/var/www/html/a/index.html”?
退回到www目录;
[iyunv@localhost DedeCmsV55-GBK-Final]# cd ../
查看目录下文件:
[iyunv@localhost www]# ls
cgi-bin               dede.tar.gz  html   icons   usage
DedeCmsV55-GBK-Final  error        manual
现在我们要DedeCmsV55-GBK-Final目录以及dede.tar.gz文件无用了,我们删除他;
[iyunv@localhost www]# rm -rf DedeCmsV55-GBK-Final
删除目录需要-rf,删除文件时候不需要;
[iyunv@localhost www]# rm dede.tar.gz
询问我们继续回答“y“进行确认;
rm:是否删除 一般文件 “dede.tar.gz”? y
进入html目录;
[iyunv@localhost www]# cd html
在浏览器输入:http://IP地址/
进入了dedecms安装,进入下一步,但是提示我们的目录没有可写权限,在linux下目录权限要求比较高,那么我们给目录权限;
对plus目录给予777权限,可写、可读权限;
[iyunv@localhost html]# chmod 777 plus
但是一个一个给权限,需要下层目录权限等等会很麻烦,那么我们就一次给全部权限,在linux下的“*”为通配符;
[iyunv@localhost html]# chmod 777 -R ./*
好了,我们给足了所有权限,我们进行安装下一步,需要填写数据库,我们还没有创建数据库!那么我们就去创建一个数据库;
[iyunv@localhost www]# mysql -u root -p
password: 需要填写root用户密码;
Enter password:
进入mysql成功;
查看存在的mysql数据库;
mysql> SHOW DATABASES;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| nison_oian         |
+--------------------+
3 rows in set (0.01 sec)
我们创建一个数据库,数据库名为:dede;
mysql> CREATE DATABASE dede;
Query OK, 1 row affected (0.00 sec)
我们在查看存在的数据库,看看我们新创建的数据库是否存在;
mysql> SHOW DATABASES;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| dede               |
| mysql              |
| nison_oian         |
+--------------------+
4 rows in set (0.00 sec)
好了,我们创建成功,存在dede数据库!但是有些朋友有自己的数据库需要导入,那么我们就尝试以下;
首先我们需要进入dede数据库,否则导入会默认不存在数据库造成导入失败!
mysql> use dede
Database changed
我们使用source命令进行导入;
mysql> source /绝对路径/test.sql
好了,这样就可以完整的导入数据库了!如果没有的掠过,进行dede安装就可以了!这篇东西也就到这里完成了!

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-287577-1-1.html 上篇帖子: Mysql-5.5.3-m3 主从同步不支持master-host问题的解决办法 下篇帖子: 使用ThinkPHP操作Myssql数据库时出现不支持Mysql的错误
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表