-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
86 lines (58 loc) · 2 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# 安装Apache2和php以及mysql
`sudo apt install apache2`
`sudo apt install php libapache2-mod-php`
重启Apache2
`sudo systemctl restart apache2`
修改配置让Apache2使用我们指定的文件夹(src)
`sudo vim /etc/apache2/sites-available/000-default.conf`
```
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /home/username/website # 这里是你的网站文件夹
<Directory /home/username/website>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
```
不要忘了给文件修改权限
`sudo chown -R www-data:www-data /home/username/website`
`sudo chmod -R 755 /home/username/website`
重启Apache2
`sudo systemctl restart apache2`
从浏览器打开`localhost`,若能看到登录界面,则操作成功
接下来安装mysql
`sudo apt install php-mysql mysql-server`
`sudo mysql_secure_installation`
验证一下安装好了没
`sudo systemctl status mysql.service`
启动mysql
`sudo mysql`
这一步是设置密码
`ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';`
验证一下能否登陆
`mysql -u root -p`
在mysql命令行中,创建一个数据库users,并且放一个表格user_info
```
CREATE DATABASE users;
USE users;
CREATE TABLE user_info (
id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(30) NOT NULL,
password VARCHAR(30) NOT NULL,
email VARCHAR(50),
);
```
不要忘记修改`src/index.php`和`src/test.php`中的数据库密码
重启apache
`sudo systemctl restart apache2`
验证一下能否连接到数据库,浏览器访问`localhost/test.php`,如果出现connect successful,则成功
# 将LKM加载进内核
`make`
`sudo insmod ./hacker.ko`
使用浏览器登录`localhost`
注册,然后登录。
`dmesg | tail -n 20`查看内核日志,如果出现`username: xxx, password: xxx`,则成功