| 
				
			 | 
			
			
				@@ -1254,7 +1254,6 @@ iptables -A INPUT -p tcp --destination-port 6665:6669 -j DROP 
			 | 
		
	
		
			
			| 
				1254
			 | 
			
				1254
			 | 
			
			
				 iptables -A INPUT -p tcp --destination-port 4000 -j DROP 
			 | 
		
	
		
			
			| 
				1255
			 | 
			
				1255
			 | 
			
			
				 iptables -A INPUT -p tcp --destination-port 119 -j DROP 
			 | 
		
	
		
			
			| 
				1256
			 | 
			
				1256
			 | 
			
			
				 iptables -A INPUT -p tcp --destination-port 137 -j DROP 
			 | 
		
	
		
			
			| 
				1257
			 | 
			
				
			 | 
			
			
				-iptables -A INPUT -p tcp --destination-port 3306 -j DROP 
			 | 
		
	
		
			
			| 
				1258
			 | 
			
				1257
			 | 
			
			
				 iptables -A INPUT -p tcp --destination-port 4242 -j DROP 
			 | 
		
	
		
			
			| 
				1259
			 | 
			
				1258
			 | 
			
			
				 iptables -A INPUT -p tcp --destination-port 9050 -j DROP 
			 | 
		
	
		
			
			| 
				1260
			 | 
			
				1259
			 | 
			
			
				 iptables -A INPUT -p tcp --destination-port 3000 -j DROP 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -3320,7 +3319,7 @@ Install it. 
			 | 
		
	
		
			
			| 
				3320
			 | 
			
				3319
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				3321
			 | 
			
				3320
			 | 
			
			
				 #+BEGIN_SRC: bash 
			 | 
		
	
		
			
			| 
				3322
			 | 
			
				3321
			 | 
			
			
				 tar -xzvf ircd-hybrid-8.1.17.tgz 
			 | 
		
	
		
			
			| 
				3323
			 | 
			
				
			 | 
			
			
				-cd ircd-hybrid-* 
			 | 
		
	
		
			
			| 
				
			 | 
			
				3322
			 | 
			
			
				+cd ircd-hybrid-8.1.17 
			 | 
		
	
		
			
			| 
				3324
			 | 
			
				3323
			 | 
			
			
				 ./configure --prefix=/usr/local/ircd --enable-openssl 
			 | 
		
	
		
			
			| 
				3325
			 | 
			
				3324
			 | 
			
			
				 make 
			 | 
		
	
		
			
			| 
				3326
			 | 
			
				3325
			 | 
			
			
				 make install 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -3365,7 +3364,12 @@ chmod 600 /usr/local/ircd/etc/ircd.conf 
			 | 
		
	
		
			
			| 
				3365
			 | 
			
				3364
			 | 
			
			
				 Now create an init script. 
			 | 
		
	
		
			
			| 
				3366
			 | 
			
				3365
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				3367
			 | 
			
				3366
			 | 
			
			
				 #+BEGIN_SRC: bash 
			 | 
		
	
		
			
			| 
				3368
			 | 
			
				
			 | 
			
			
				-adduser --disabled-login irc 
			 | 
		
	
		
			
			| 
				
			 | 
			
				3367
			 | 
			
			
				+adduser irc 
			 | 
		
	
		
			
			| 
				
			 | 
			
				3368
			 | 
			
			
				+#+END_SRC 
			 | 
		
	
		
			
			| 
				
			 | 
			
				3369
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				3370
			 | 
			
			
				+Make the password some long random string. 
			 | 
		
	
		
			
			| 
				
			 | 
			
				3371
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				3372
			 | 
			
			
				+#+BEGIN_SRC: bash 
			 | 
		
	
		
			
			| 
				3369
			 | 
			
				3373
			 | 
			
			
				 editor /usr/bin/runircd 
			 | 
		
	
		
			
			| 
				3370
			 | 
			
				3374
			 | 
			
			
				 #+END_SRC 
			 | 
		
	
		
			
			| 
				3371
			 | 
			
				3375
			 | 
			
			
				  
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -3374,7 +3378,7 @@ Add the following: 
			 | 
		
	
		
			
			| 
				3374
			 | 
			
				3378
			 | 
			
			
				 #+BEGIN_SRC: bash 
			 | 
		
	
		
			
			| 
				3375
			 | 
			
				3379
			 | 
			
			
				 #!/bin/sh 
			 | 
		
	
		
			
			| 
				3376
			 | 
			
				3380
			 | 
			
			
				 USERNAME=irc 
			 | 
		
	
		
			
			| 
				3377
			 | 
			
				
			 | 
			
			
				-COMMAND="cd /usr/local/ircd; ircd > /usr/local/ircd/ircd.log" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				3381
			 | 
			
			
				+COMMAND="cd /usr/local/ircd/bin; ircd > /usr/local/ircd/ircd.log" 
			 | 
		
	
		
			
			| 
				3378
			 | 
			
				3382
			 | 
			
			
				 su -l $USERNAME -c '$COMMAND' 
			 | 
		
	
		
			
			| 
				3379
			 | 
			
				3383
			 | 
			
			
				 #+END_SRC 
			 | 
		
	
		
			
			| 
				3380
			 | 
			
				3384
			 | 
			
			
				  
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -7260,17 +7264,17 @@ mysqldump -u root -p --all-databases --events > /var/backups/databasebackup.sql 
			 | 
		
	
		
			
			| 
				7260
			 | 
			
				7264
			 | 
			
			
				 To restore yesterday's friendica backup: 
			 | 
		
	
		
			
			| 
				7261
			 | 
			
				7265
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				7262
			 | 
			
				7266
			 | 
			
			
				 #+BEGIN_SRC: bash 
			 | 
		
	
		
			
			| 
				7263
			 | 
			
				
			 | 
			
			
				-mysql -D friendica -o < /var/backups/friendica_daily.sql 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7267
			 | 
			
			
				+mysql -u root -p friendica -o < /var/backups/friendica_daily.sql 
			 | 
		
	
		
			
			| 
				7264
			 | 
			
				7268
			 | 
			
			
				 #+END_SRC 
			 | 
		
	
		
			
			| 
				7265
			 | 
			
				7269
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				7266
			 | 
			
				7270
			 | 
			
			
				 To restore yesterday's Red Matrix backup: 
			 | 
		
	
		
			
			| 
				7267
			 | 
			
				7271
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				7268
			 | 
			
				7272
			 | 
			
			
				 #+BEGIN_SRC: bash 
			 | 
		
	
		
			
			| 
				7269
			 | 
			
				
			 | 
			
			
				-mysql -D redmatrix -o < /var/backups/redmatrix_daily.sql 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7273
			 | 
			
			
				+mysql -u root -p redmatrix -o < /var/backups/redmatrix_daily.sql 
			 | 
		
	
		
			
			| 
				7270
			 | 
			
				7274
			 | 
			
			
				 #+END_SRC 
			 | 
		
	
		
			
			| 
				7271
			 | 
			
				
			 | 
			
			
				-*** Removing mysql server 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7275
			 | 
			
			
				+*** Removing and reinstalling mysql server 
			 | 
		
	
		
			
			| 
				7272
			 | 
			
				7276
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				7273
			 | 
			
				
			 | 
			
			
				-If you manage to screw up sql server completely then it can be fully deleted with: 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7277
			 | 
			
			
				+Sometimes the mysql database may get completely messed up, and running /service mysql start/ may always fail with nothing reported in the logs.  So if you manage to get into that unfortinate situation then you can fully remove mysql and reinstall it as follows: 
			 | 
		
	
		
			
			| 
				7274
			 | 
			
				7278
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				7275
			 | 
			
				7279
			 | 
			
			
				 #+BEGIN_SRC: bash 
			 | 
		
	
		
			
			| 
				7276
			 | 
			
				7280
			 | 
			
			
				 ps aux | grep mysql 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -7280,9 +7284,42 @@ and use /kill -9 <pid>/ to kill all mysql processes. 
			 | 
		
	
		
			
			| 
				7280
			 | 
			
				7284
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				7281
			 | 
			
				7285
			 | 
			
			
				 #+BEGIN_SRC: bash 
			 | 
		
	
		
			
			| 
				7282
			 | 
			
				7286
			 | 
			
			
				 apt-get remove --purge mysql\* 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7287
			 | 
			
			
				+rm -rf /etc/mysql 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7288
			 | 
			
			
				+rm -rf /var/lib/mysql 
			 | 
		
	
		
			
			| 
				7283
			 | 
			
				7289
			 | 
			
			
				 apt-get clean 
			 | 
		
	
		
			
			| 
				7284
			 | 
			
				7290
			 | 
			
			
				 updatedb 
			 | 
		
	
		
			
			| 
				7285
			 | 
			
				7291
			 | 
			
			
				 #+END_SRC 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7292
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7293
			 | 
			
			
				+Reinstall mysql: 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7294
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7295
			 | 
			
			
				+#+BEGIN_SRC: bash 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7296
			 | 
			
			
				+apt-get install mysql-server php5-common php5-cli php5-curl php5-gd php5-mysql php5-mcrypt php5-fpm php5-cgi php-apc 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7297
			 | 
			
			
				+#+END_SRC 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7298
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7299
			 | 
			
			
				+Then to recreate the Friendica and webmail databases: 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7300
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7301
			 | 
			
			
				+#+BEGIN_SRC: bash 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7302
			 | 
			
			
				+mysql -p 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7303
			 | 
			
			
				+create database friendica; 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7304
			 | 
			
			
				+CREATE USER 'friendicaadmin'@'localhost' IDENTIFIED BY 'myfriendicapassword'; 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7305
			 | 
			
			
				+GRANT ALL PRIVILEGES ON friendica.* TO 'friendicaadmin'@'localhost'; 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7306
			 | 
			
			
				+create database roundcubemail; 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7307
			 | 
			
			
				+CREATE USER 'roundcube'@'localhost' IDENTIFIED BY 'roundcubepassword'; 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7308
			 | 
			
			
				+GRANT ALL PRIVILEGES ON roundcubemail.* TO 'roundcube'@'localhost'; 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7309
			 | 
			
			
				+quit 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7310
			 | 
			
			
				+mysql -u root -p friendica -o < /var/backups/friendica_daily.sql 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7311
			 | 
			
			
				+#+END_SRC 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7312
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7313
			 | 
			
			
				+And if you previously had Red Matrix installed: 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7314
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7315
			 | 
			
			
				+#+BEGIN_SRC: bash 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7316
			 | 
			
			
				+mysql -p 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7317
			 | 
			
			
				+create database redmatrix; 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7318
			 | 
			
			
				+CREATE USER 'redmatrixadmin'@'localhost' IDENTIFIED BY 'myredmatrixpassword'; 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7319
			 | 
			
			
				+GRANT ALL PRIVILEGES ON redmatrix.* TO 'redmatrixadmin'@'localhost'; 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7320
			 | 
			
			
				+quit 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7321
			 | 
			
			
				+mysql -u root -p redmatrix -o < /var/backups/redmatrix_daily.sql 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7322
			 | 
			
			
				+#+END_SRC 
			 | 
		
	
		
			
			| 
				7286
			 | 
			
				7323
			 | 
			
			
				 ** Regenerating SSL certificates 
			 | 
		
	
		
			
			| 
				7287
			 | 
			
				7324
			 | 
			
			
				 If a security vulnerability arrises which requires you to regenerate your SSL certificates, such as [[http://filippo.io/Heartbleed]["heartbleed"]], then this can be done as follows: 
			 | 
		
	
		
			
			| 
				7288
			 | 
			
				7325
			 | 
			
			
				  
			 |