sentor os
Apache的主配置文件:
/etc/httpd/conf/httpd.conf
默认站点主目录:
/var/www/html
log 日志文件错误日志
manual 手册
modules 扩展模块
conf 配置信息


查看httpd服务有没有启动
ps -ef|grep httpd
启动服务
service httpd start 6.5版本
systemctl start httpd 7.0版本
停止服务
service httpd stop 6.5版本
systemctl stop httpd 7.0版本
重启服务
service httpd restart 6.5版本
systemctl restart httpd 7.0版本
查看状态
service httpd status6.5版本
systemctl status httpd 7.0版本
关闭防火墙
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
开启端口
firewall-cmd --zone=public --add-port=80/tcp --permanent
命令含义
--zone #作用域
--add-port=80/tcp #添加端口,格式为:端口/通讯协议
--permanent #永久生效,没有此参数重启后失效
重启防火墙
firewall-cmd --reload
安装mysql
yum -y install mysql-community-server
# 提示错误
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
No package mysql-community-server available.
Error: Nothing to do
# 下载需要的依赖
cd /usr/local/src/
wget https://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm
# 安装依赖
rpm -ivh mysql57-community-release-el7-11.noarch.rpm
# 安装mysql服务
yum install mysql-community-server -y
# 启动mysql
systemctl start mysqld
# 添加开机启动
systemctl enable mysqld
获得mysql密码
grep 'temporary password' /var/log/mysqld.log
设置密码
set global validate_password_policy=LOW;
set global validate_password_length=6;
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
设置可以远程连接
mysql> use mysql;
Database changed
mysql> grant all privileges on *.* to root@'%' identified by "password";
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
所需环境文件
tomcat+mysql搭建环境
链接:https://pan.baidu.com/s/1KCM2XLvPF9X0zxpAeDIZ6w 密码:6ymy




ubuntu
apache配置文件
/etc/apache2/apache2.conf
一、Start Apache 2 Server /启动apache服务
$sudo /etc/init.d/apache2 start
二、 Restart Apache 2 Server /重启apache服务
$ sudo /etc/init.d/apache2 restart
三、Stop Apache 2 Server /停止apache服务
$ sudo /etc/init.d/apache2 stop
四、status Apache 2 Server /插卡apache服务
$ sudo /etc/init.d/apache2 status
查看apache版本
apache2 -v
网友评论