码迷,mamicode.com
首页 > 数据库 > 详细

centos7 下安装apache mysql php phpmyadmin。

时间:2014-12-14 17:12:21      阅读:634      评论:0      收藏:0      [点我收藏+]

标签:des   blog   http   io   ar   os   sp   for   on   

1 安装mysql 

yum -y install mariadb-server
systemctl start mariadb.service
systemctl enable mariadb.service
mysql_secure_installation

  默认安装的是5.5.40-MariaDB ,个人喜欢的版本,不再是5.1的那个了。

  

 

2 安装apache 

 

yum install -y httpd
systemctl start httpd.service
systemctl enable httpd.service

apache 版本为 2.4.6 

3 .安装php

yum -y install php
systemctl restart httpd.service

  php5.4 

  其实安装和centos6的版本没啥区别。做了一些软件的升级,但是在启动上面,废弃了原先的/etc/init.d 下面的bash 脚本。而是用了systemctl 这个命令。

  相关文件都在 /usr/lib/systemd/system 下面了。看了一下,比之前的bash 脚本简单好多。比如httpd的systemctl文件  

cat /usr/lib/systemd/system/httpd.service 
[Unit]
Description=The Apache HTTP Server
After=network.target remote-fs.target nss-lookup.target

[Service]
Type=notify
EnvironmentFile=/etc/sysconfig/httpd
ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND
ExecReload=/usr/sbin/httpd $OPTIONS -k graceful
ExecStop=/bin/kill -WINCH ${MAINPID}
# We want systemd to give httpd some time to finish gracefully, but still want
# it to kill httpd after TimeoutStopSec if something went wrong during the
# graceful stop. Normally, Systemd sends SIGTERM signal right after the
# ExecStop, which would kill httpd. We are sending useless SIGCONT here to give
# httpd time to finish.
KillSignal=SIGCONT
PrivateTmp=true

[Install]
WantedBy=multi-user.target

  还是之前的chkconfig  ,也集成在systemctl中了。 很简洁 systemctl enable  httpd  

systemctl enable  httpd
ln -s ‘/usr/lib/systemd/system/httpd.service‘ ‘/etc/systemd/system/multi-user.target.wants/httpd.service‘

  

  做的操作其实是一个软连接。很直观。操作什么直接反馈回来了。

[root@iZ23f0gpuenZ _local]# systemctl status  httpd
httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
   Active: inactive (dead)

Dec 14 04:19:54 iZ23f0gpuenZ systemd[1]: Reloaded The Apache HTTP Server.
Dec 14 14:49:32 iZ23f0gpuenZ systemd[1]: Stopping The Apache HTTP Server...
Dec 14 14:49:34 iZ23f0gpuenZ systemd[1]: Starting The Apache HTTP Server...
Dec 14 14:49:34 iZ23f0gpuenZ httpd[14550]: AH00558: httpd: Could not reliably determine the server‘s fully qualified domain name, using 10.168.19...s message
Dec 14 14:49:34 iZ23f0gpuenZ systemd[1]: Started The Apache HTTP Server.
Dec 14 14:50:23 iZ23f0gpuenZ systemd[1]: Stopping The Apache HTTP Server...
Dec 14 14:50:24 iZ23f0gpuenZ systemd[1]: Starting The Apache HTTP Server...
Dec 14 14:50:24 iZ23f0gpuenZ httpd[14681]: AH00558: httpd: Could not reliably determine the server‘s fully qualified domain name, using 10.168.19...s message
Dec 14 14:50:24 iZ23f0gpuenZ systemd[1]: Started The Apache HTTP Server.
Dec 14 15:37:49 iZ23f0gpuenZ systemd[1]: Stopping The Apache HTTP Server...
Dec 14 15:37:50 iZ23f0gpuenZ systemd[1]: Stopped The Apache HTTP Server.
Hint: Some lines were ellipsized, use -l to show in full.

  status 也做的很hi ,什么时候操作过httpd 的服务也一目了然。

  centos 7 还做了进一步的升级,比如说加入了firewall ,内置了git 等,做了很实用的升级。更多功能正在摸索中。

 

centos7 下安装apache mysql php phpmyadmin。

标签:des   blog   http   io   ar   os   sp   for   on   

原文地址:http://www.cnblogs.com/gqdw/p/4162571.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!