一.apache:
1).安装httpd yum install httpd -y
2).修改主机名 vim /etc/hosts
3).启动apache /etc/init.d/httpd restart
1)启动apache遇到错误:httpd: Could not reliably determine the server's fully qualified domain name...
解决方法:vim /etc/httpd/conf/httpd.conf 修改serverName localhost:80
重启apache /etc/init.d/httpd restart
服务终于启动了,我们的apache的默认发布目录是:/var/www/html,默认的发布文件是那个目录地下的index.html.
4).更改apache的默认目录
1).DocumentRoot "目录路径"
2).<Directory "目录路径">
Options Indexes FollowSymLinks
AllowOverride All
Order allow, deny
Allow from all
</Directory>
5)注意目录每一级都要有可执行权限,不然会导致无法访问错误。
二.php
1). 安装 yum install php
2). apache配置php
在AddType application/x-gzip .gz .tgz下面添加:
# probably should define those extensions to indicate media types:
#
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
三. mysql:
1).安装: yum install -y mysql-server mysql mysql-deve
(注意)下载不成功,则需要配置yum的ftp源配置。
查看安装的版本:rpm -qi mysql-server
2).启动:service mysqld start /etc/init.d/mysqld start
如果我们是第一次启动mysql服务,mysql服务器首先会进行初始化的配置
当我们再次重新启动mysql服务时,就不会提示这么多信息了
3).配置管理员:mysqladmin -u root password 'root' // 通过该命令给root账号设置密码为 root
4).登录mysql: mysql -u root -p
5)./etc/my.cnf 这是mysql的主配置文件
/var/lib/mysql mysql数据库的数据库文件存放位置
6).创建数据库 create database yest;
7)./var/log mysql数据库的日志输出存放位置
我们的mysql数据库的一些日志输出存放位置都是在/var/log这个目录下
8)通过 chkconfig --list | grep mysqld 命令来查看mysql服务是不是开机自动启动
chkconfig mysqld on 命令来将其设置成开机启动,这样就不用每次都去手动启动了