php

1
2
3
4
5
6
~$ php -i | grep php.ini
Configuration File (php.ini) Path => /etc/php/7.4/cli
Loaded Configuration File => /etc/php/7.4/cli/php.ini

# 重启php
~$ service php-fpm restart

nginx

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# 查看nginx的进程
~$ ps -aux | grep nginx
root 3493 0.0 0.0 159060 1680 ? Ss 09:09 0:00 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
vagrant 3497 0.0 0.3 161788 7692 ? S 09:09 0:00 nginx: worker process
vagrant 3498 0.0 0.3 161788 6792 ? S 09:09 0:00 nginx: worker process
vagrant 3644 0.0 0.0 14428 1056 pts/1 S+ 09:13 0:00 grep --color=auto nginx

# 验证nginx配置文件
~$ /usr/sbin/nginx -t
nginx: [warn] the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1
# nginx:配置文件/etc/nginx/nginx.conf语法没问题
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: [emerg] open() "/run/nginx.pid" failed (13: Permission denied)
nginx: configuration file /etc/nginx/nginx.conf test failed

# 重启nginx
~$ service nginx restart

mysql

1
2
3
4
5
6
7
8
9
10
11
12
# 查看mysql安装目录
~$ which mysql
/usr/bin/mysql

# 根据这个目录通过以下命令查看配置文件位置
~$ /usr/bin/mysql --verbose --help | grep -A 1 'Default options'
Default options are read from the following files in the given order:
# 服务器首先会读取/etc/my.cnf文件,如果发现该文件不存在,再依次尝试从后面的几个路径进行读取。
/etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf

# 重启mysql
~$ service mysqld restart

hosts

1
2
3
4
5
6
7
8
9
10
11
~$ cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 homestead homestead

# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
#### HOMESTEAD-SITES-BEGIN
127.0.0.1 shop.test
#### HOMESTEAD-SITES-END