-
Notifications
You must be signed in to change notification settings - Fork 1
/
35 ¿Cómo Instalar phpIPAM?
370 lines (306 loc) · 17.2 KB
/
35 ¿Cómo Instalar phpIPAM?
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
35 ¿Cómo Instalar phpIPAM?
Actualizamos
sudo apt update
Hit:1 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:3 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Get:4 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Fetched 336 kB in 0s (674 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
Instalamos maridb-server y su client
sudo apt install mariadb-server mariadb-client
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libfwupdplugin1
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
galera-3 libcgi-fast-perl libcgi-pm-perl libconfig-inifiles-perl libdbd-mysql-perl libdbi-perl
libencode-locale-perl libfcgi-perl libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl
libhttp-date-perl libhttp-message-perl libio-html-perl liblwp-mediatypes-perl libmysqlclient21 libsnappy1v5
libterm-readkey-perl libtimedate-perl liburi-perl mariadb-client-10.3 mariadb-client-core-10.3
mariadb-common mariadb-server-10.3 mariadb-server-core-10.3 mysql-common socat
Suggested packages:
libclone-perl libmldbm-perl libnet-daemon-perl libsql-statement-perl libdata-dump-perl
libipc-sharedcache-perl libwww-perl mailx mariadb-test tinyca
The following NEW packages will be installed:
galera-3 libcgi-fast-perl libcgi-pm-perl libconfig-inifiles-perl libdbd-mysql-perl libdbi-perl
libencode-locale-perl libfcgi-perl libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl
libhttp-date-perl libhttp-message-perl libio-html-perl liblwp-mediatypes-perl libmysqlclient21 libsnappy1v5
libterm-readkey-perl libtimedate-perl liburi-perl mariadb-client mariadb-client-10.3
mariadb-client-core-10.3 mariadb-common mariadb-server mariadb-server-10.3 mariadb-server-core-10.3
mysql-common socat
0 upgraded, 29 newly installed, 0 to remove and 0 not upgraded.
Need to get 21.3 MB of archives.
After this operation, 174 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal/main amd64 mysql-common all 5.8+1.0.5ubuntu2 [7496 B]
Get:2 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal-updates/universe amd64 mariadb-common all 1:10.3.34-0ubuntu0.20.04.1 [15.9 kB]
Get:3 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal/universe amd64 galera-3 amd64 25.3.29-1 [898 kB]
Get:4 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal-updates/main amd64 libdbi-perl amd64 1.643-1ubuntu0.1 [730 kB]
Get:5 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libconfig-inifiles-perl all 3.000002-1 [40.6 kB]
Get:6 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libsnappy1v5 amd64 1.1.8-1build1 [16.7 kB]
Get:7 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal-updates/universe amd64 mariadb-client-core-10.3 amd64 1:10.3.34-0ubuntu0.20.04.1 [5853 kB]
Get:8 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal-updates/universe amd64 mariadb-client-10.3 amd64 1:10.3.34-0ubuntu0.20.04.1 [1130 kB]
Get:9 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal-updates/universe amd64 mariadb-server-core-10.3 amd64 1:10.3.34-0ubuntu0.20.04.1 [6026 kB]
Get:10 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal/main amd64 socat amd64 1.7.3.3-2 [323 kB]
Get:11 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal-updates/universe amd64 mariadb-server-10.3 amd64 1:10.3.34-0ubuntu0.20.04.1 [4204 kB]
Get:12 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libhtml-tagset-perl all 3.20-4 [12.5 kB]
Get:13 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal/main amd64 liburi-perl all 1.76-2 [77.5 kB]
Get:14 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libhtml-parser-perl amd64 3.72-5 [86.3 kB]
Get:15 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libcgi-pm-perl all 4.46-1 [186 kB]
Get:16 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libfcgi-perl amd64 0.79-1 [33.1 kB]
Get:17 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libcgi-fast-perl all 1:2.15-1 [10.5 kB]
Get:18 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal-updates/main amd64 libmysqlclient21 amd64 8.0.28-0ubuntu0.20.04.3 [1292 kB]
Get:19 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal/universe amd64 libdbd-mysql-perl amd64 4.050-3 [82.8 kB]
Get:20 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libencode-locale-perl all 1.05-1 [12.3 kB]
Get:21 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libhtml-template-perl all 2.97-1 [59.0 kB]
Get:22 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libtimedate-perl all 2.3200-1 [34.0 kB]
Get:23 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libhttp-date-perl all 6.05-1 [9920 B]
Get:24 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libio-html-perl all 1.001-1 [14.9 kB]
Get:25 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal/main amd64 liblwp-mediatypes-perl all 6.04-1 [19.5 kB]
Get:26 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libhttp-message-perl all 6.22-1 [76.1 kB]
Get:27 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libterm-readkey-perl amd64 2.38-1build1 [24.6 kB]
Get:28 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal-updates/universe amd64 mariadb-client all 1:10.3.34-0ubuntu0.20.04.1 [12.5 kB]
Get:29 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal-updates/universe amd64 mariadb-server all 1:10.3.34-0ubuntu0.20.04.1 [12.7 kB]
Fetched 21.3 MB in 0s (50.3 MB/s)
Preconfiguring packages ...
Selecting previously unselected package mysql-common.
(Reading database ... 92508 files and directories currently installed.)
Preparing to unpack .../0-mysql-common_5.8+1.0.5ubuntu2_all.deb ...
Unpacking mysql-common (5.8+1.0.5ubuntu2) ...
Selecting previously unselected package mariadb-common.
Preparing to unpack .../1-mariadb-common_1%3a10.3.34-0ubuntu0.20.04.1_all.deb ...
Unpacking mariadb-common (1:10.3.34-0ubuntu0.20.04.1) ...
Selecting previously unselected package galera-3.
Preparing to unpack .../2-galera-3_25.3.29-1_amd64.deb ...
Unpacking galera-3 (25.3.29-1) ...
Selecting previously unselected package libdbi-perl:amd64.
Preparing to unpack .../3-libdbi-perl_1.643-1ubuntu0.1_amd64.deb ...
Unpacking libdbi-perl:amd64 (1.643-1ubuntu0.1) ...
Selecting previously unselected package libconfig-inifiles-perl.
Preparing to unpack .../4-libconfig-inifiles-perl_3.000002-1_all.deb ...
Unpacking libconfig-inifiles-perl (3.000002-1) ...
Selecting previously unselected package libsnappy1v5:amd64.
Preparing to unpack .../5-libsnappy1v5_1.1.8-1build1_amd64.deb ...
Unpacking libsnappy1v5:amd64 (1.1.8-1build1) ...
Selecting previously unselected package mariadb-client-core-10.3.
Preparing to unpack .../6-mariadb-client-core-10.3_1%3a10.3.34-0ubuntu0.20.04.1_amd64.deb ...
Unpacking mariadb-client-core-10.3 (1:10.3.34-0ubuntu0.20.04.1) ...
Selecting previously unselected package mariadb-client-10.3.
Preparing to unpack .../7-mariadb-client-10.3_1%3a10.3.34-0ubuntu0.20.04.1_amd64.deb ...
Unpacking mariadb-client-10.3 (1:10.3.34-0ubuntu0.20.04.1) ...
Selecting previously unselected package mariadb-server-core-10.3.
Preparing to unpack .../8-mariadb-server-core-10.3_1%3a10.3.34-0ubuntu0.20.04.1_amd64.deb ...
Unpacking mariadb-server-core-10.3 (1:10.3.34-0ubuntu0.20.04.1) ...
Selecting previously unselected package socat.
Preparing to unpack .../9-socat_1.7.3.3-2_amd64.deb ...
Unpacking socat (1.7.3.3-2) ...
Setting up mysql-common (5.8+1.0.5ubuntu2) ...
update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Setting up mariadb-common (1:10.3.34-0ubuntu0.20.04.1) ...
update-alternatives: using /etc/mysql/mariadb.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Selecting previously unselected package mariadb-server-10.3.
(Reading database ... 92892 files and directories currently installed.)
Preparing to unpack .../00-mariadb-server-10.3_1%3a10.3.34-0ubuntu0.20.04.1_amd64.deb ...
Unpacking mariadb-server-10.3 (1:10.3.34-0ubuntu0.20.04.1) ...
Selecting previously unselected package libhtml-tagset-perl.
Preparing to unpack .../01-libhtml-tagset-perl_3.20-4_all.deb ...
Unpacking libhtml-tagset-perl (3.20-4) ...
Selecting previously unselected package liburi-perl.
Preparing to unpack .../02-liburi-perl_1.76-2_all.deb ...
Unpacking liburi-perl (1.76-2) ...
Selecting previously unselected package libhtml-parser-perl.
Preparing to unpack .../03-libhtml-parser-perl_3.72-5_amd64.deb ...
Unpacking libhtml-parser-perl (3.72-5) ...
Selecting previously unselected package libcgi-pm-perl.
Preparing to unpack .../04-libcgi-pm-perl_4.46-1_all.deb ...
Unpacking libcgi-pm-perl (4.46-1) ...
Selecting previously unselected package libfcgi-perl.
Preparing to unpack .../05-libfcgi-perl_0.79-1_amd64.deb ...
Unpacking libfcgi-perl (0.79-1) ...
Selecting previously unselected package libcgi-fast-perl.
Preparing to unpack .../06-libcgi-fast-perl_1%3a2.15-1_all.deb ...
Unpacking libcgi-fast-perl (1:2.15-1) ...
Selecting previously unselected package libmysqlclient21:amd64.
Preparing to unpack .../07-libmysqlclient21_8.0.28-0ubuntu0.20.04.3_amd64.deb ...
Unpacking libmysqlclient21:amd64 (8.0.28-0ubuntu0.20.04.3) ...
Selecting previously unselected package libdbd-mysql-perl:amd64.
Preparing to unpack .../08-libdbd-mysql-perl_4.050-3_amd64.deb ...
Unpacking libdbd-mysql-perl:amd64 (4.050-3) ...
Selecting previously unselected package libencode-locale-perl.
Preparing to unpack .../09-libencode-locale-perl_1.05-1_all.deb ...
Unpacking libencode-locale-perl (1.05-1) ...
Selecting previously unselected package libhtml-template-perl.
Preparing to unpack .../10-libhtml-template-perl_2.97-1_all.deb ...
Unpacking libhtml-template-perl (2.97-1) ...
Selecting previously unselected package libtimedate-perl.
Preparing to unpack .../11-libtimedate-perl_2.3200-1_all.deb ...
Unpacking libtimedate-perl (2.3200-1) ...
Selecting previously unselected package libhttp-date-perl.
Preparing to unpack .../12-libhttp-date-perl_6.05-1_all.deb ...
Unpacking libhttp-date-perl (6.05-1) ...
Selecting previously unselected package libio-html-perl.
Preparing to unpack .../13-libio-html-perl_1.001-1_all.deb ...
Unpacking libio-html-perl (1.001-1) ...
Selecting previously unselected package liblwp-mediatypes-perl.
Preparing to unpack .../14-liblwp-mediatypes-perl_6.04-1_all.deb ...
Unpacking liblwp-mediatypes-perl (6.04-1) ...
Selecting previously unselected package libhttp-message-perl.
Preparing to unpack .../15-libhttp-message-perl_6.22-1_all.deb ...
Unpacking libhttp-message-perl (6.22-1) ...
Selecting previously unselected package libterm-readkey-perl.
Preparing to unpack .../16-libterm-readkey-perl_2.38-1build1_amd64.deb ...
Unpacking libterm-readkey-perl (2.38-1build1) ...
Selecting previously unselected package mariadb-client.
Preparing to unpack .../17-mariadb-client_1%3a10.3.34-0ubuntu0.20.04.1_all.deb ...
Unpacking mariadb-client (1:10.3.34-0ubuntu0.20.04.1) ...
Selecting previously unselected package mariadb-server.
Preparing to unpack .../18-mariadb-server_1%3a10.3.34-0ubuntu0.20.04.1_all.deb ...
Unpacking mariadb-server (1:10.3.34-0ubuntu0.20.04.1) ...
Setting up libconfig-inifiles-perl (3.000002-1) ...
Setting up libmysqlclient21:amd64 (8.0.28-0ubuntu0.20.04.3) ...
Setting up libhtml-tagset-perl (3.20-4) ...
Setting up liblwp-mediatypes-perl (6.04-1) ...
Setting up libencode-locale-perl (1.05-1) ...
Setting up libsnappy1v5:amd64 (1.1.8-1build1) ...
Setting up socat (1.7.3.3-2) ...
Setting up mariadb-server-core-10.3 (1:10.3.34-0ubuntu0.20.04.1) ...
Setting up libio-html-perl (1.001-1) ...
Setting up galera-3 (25.3.29-1) ...
Setting up libtimedate-perl (2.3200-1) ...
Setting up mariadb-client-core-10.3 (1:10.3.34-0ubuntu0.20.04.1) ...
Setting up libfcgi-perl (0.79-1) ...
Setting up libterm-readkey-perl (2.38-1build1) ...
Setting up liburi-perl (1.76-2) ...
Setting up libdbi-perl:amd64 (1.643-1ubuntu0.1) ...
Setting up libhttp-date-perl (6.05-1) ...
Setting up mariadb-client-10.3 (1:10.3.34-0ubuntu0.20.04.1) ...
Setting up libdbd-mysql-perl:amd64 (4.050-3) ...
Setting up libhtml-parser-perl (3.72-5) ...
Setting up mariadb-server-10.3 (1:10.3.34-0ubuntu0.20.04.1) ...
Created symlink /etc/systemd/system/mysql.service → /lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/mysqld.service → /lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service → /lib/systemd/system/mariadb.service.
Setting up libhttp-message-perl (6.22-1) ...
Setting up mariadb-client (1:10.3.34-0ubuntu0.20.04.1) ...
Setting up libcgi-pm-perl (4.46-1) ...
Setting up libhtml-template-perl (2.97-1) ...
Setting up mariadb-server (1:10.3.34-0ubuntu0.20.04.1) ...
Setting up libcgi-fast-perl (1:2.15-1) ...
Processing triggers for systemd (245.4-4ubuntu3.15) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.7) ...
Permitimos mariadb ejecutando:
sudo systemctl enable mariadb
Iniciamos el proceso
sudo systemctl start mariadb
Comenzamos su configuración:
sudo mysql_secure_installation
Respondemos a las preguntas:
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
You already have a root password set, so you can safely answer 'n'.
Change the root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] Y
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] n
... skipping.
By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] Y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] Y
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
usuariomisterioso@hostnamemisterioso:~#
Entramos en la base de datos:
sudo mysql -u root -p
Creamos
CREATE DATABASE phpipam;
GRANT ALL ON phpipam.* TO phpipam@localhost IDENTIFIED BY 'StrongDBPassword';
FLUSH PRIVILEGES;
QUIT;
Actualizamos:
sudo apt update
Instalamos los modulos requeridos:
sudo apt -y install php php-{mysql,curl,gd,intl,pear,imap,memcache,pspell,tidy,xmlrpc,mbstring,gmp,json,xml,fpm}
Instalamos git
sudo apt -y install git
Clonamos su repositorio
sudo git clone --recursive https://github.com/phpipam/phpipam.git /var/www/html/phpipam
Y nos vamos a la carpeta
cd /var/www/html/phpipam
Configuramos el archivo:
sudo cp config.dist.php config.php
Añadimos:
sudo nano config.php
/**
* database connection details
******************************/
$db['host'] = 'localhost';
$db['user'] = 'phpipam';
$db['pass'] = 'StrongDBPassword';
$db['name'] = 'phpipam';
$db['port'] = 3306;
En mi caso, como me ha salido satisfactoriamente sin ningún error durante la instalación con nginx, procedo:
sudo systemctl stop apache2 && sudo systemctl disable apache2
sudo apt -y install nginx
Editamos el archivo:
sudo nano /etc/nginx/conf.d/phpipam.conf
server {
listen 80;
# root directory
server_name ipam.example.com www.ipam.example.com;
index index.php;
root /var/www/html/phpipam;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
}
}
Cambiamos la propiedad y reiniciamos:
sudo chown -R www-data:www-data /var/www/html
sudo systemctl restart nginx
Vamos a la web y decimos que es una instalación nueva, ponemos las credenciales. Y Listo.
Fuente: https://computingforgeeks.com/install-and-configure-phpipam-on-ubuntu-debian-linux/