1.安装mysql
yum install mysql mysql-server
1.1安装完毕,设置mysql服务 随系统自启动:
chkconfig --levels 235 mysqld on
1.2启动服务
/etc/init.d/mysqld start
1.3设置 mysql 的 root 账户的密码:
mysql_secure_installation
Remove anonymous users? [Y/n]
Disallow root login remotely? [Y/n]
Remove test database and access to it? [Y/n]
Reload privilege tables now? [Y/n]
直接回车即可。
2.安装Apache
yum install httpd
2.1安装完毕,设置Apache 服务 随系统自启动:
chkconfig --levels 235 httpd on
服务目录 /etc/httpd
主配置文件 /etc/httpd/conf/httpd.conf
网站数据目录 /var/www/html
访问日志 /var/log/httpd/access_log
错误日志 /var/log/httpd/