Archive

Archive for the ‘Apache’ Category

RAID (mdadm) add/remove faulty drive

/dev/sda3 -> faulty device.

root@makeitweb ~ # cat /proc/mdstat 
Personalities : [raid1] 
md3 : active raid1 sda4[0] sdb4[1]
      1843414335 blocks super 1.2 [2/2] [UU]
 
md2 : active raid1 sda3[0](F) sdb3[1]
      1073740664 blocks super 1.2 [2/1] [_U]
 
md1 : active raid1 sda2[0] sdb2[1]
      524276 blocks super 1.2 [2/2] [UU]
 
md0 : active raid1 sda1[0] sdb1[1]
      12581816 blocks super 1.2 [2/2] [UU]
 
unused devices: <none>
mdadm --manage /dev/md2 --fail /dev/sda3
mdadm --manage /dev/md2 --remove /dev/sda3
mdadm --manage /dev/md2 --add /dev/sda3
root@makeitweb ~ # cat /proc/mdstat 
Personalities : [raid1] 
md3 : active raid1 sda4[0] sdb4[1]
      1843414335 blocks super 1.2 [2/2] [UU]
 
md2 : active raid1 sda3[0] sdb3[1]
      1073740664 blocks super 1.2 [2/1] [_U]
      [>....................]  recovery =  0.1% (1565952/1073740664) finish=319.5min speed=55926K/sec
 
md1 : active raid1 sda2[0] sdb2[1]
      524276 blocks super 1.2 [2/2] [UU]
 
md0 : active raid1 sda1[0] sdb1[1]
      12581816 blocks super 1.2 [2/2] [UU]
 
unused devices: <none>
Categories: Apache, backup, bash, Filesystems Tags:

Apache директиви за инсталиране на SSL сертифиакт

Във файла /etc/apache2/sites-available/website.conf пишем:

SSLEngine on
SSLCertificateFile /etc/ssl/crt/primary.crt
SSLCertificateKeyFile /etc/ssl/crt/private.key
SSLCertificateChainFile /etc/ssl/crt/intermediate.crt
Categories: Apache, Debian, Linux Tags:

Multi domain Apache config (sites-available/default/)

NameVirtualHost *
 
<VirtualHost SERVER_IP_ADDRESS_HERE_PLEASE:80>
    UseCanonicalName Off
    DocumentRoot /www
 
    RewriteEngine On
    RewriteMap  lowercase  int:tolower
 
    Options -Indexes
 
    RewriteRule ^(.+)  ${lowercase:%{SERVER_NAME}}$1  [C]
 
    RewriteRule ^([^\.\/]+\.co\.uk)/(.*) /www/$1/www/root/$2
    RewriteRule ^www\.([^\.\/]+\.co\.uk)/(.*) /www/$1/www/root/$2
 
    RewriteRule ^([^\.\/]+\.[^\.\/]+)/(.*) /www/$1/www/root/$2
    RewriteRule ^www\.([^\/]+)\.([^\.\/]+\.[^\.\/]+)/(.*) /www/$2/$1/root/$3
    RewriteRule ^([^\/]+)\.([^\.\/]+\.[^\.\/]+)/(.*) /www/$2/$1/root/$3
</VirtualHost>
 
 
 
<Directory /www>
        php_admin_flag safe_mode off
        php_value upload_max_filesize 10M
        php_value post_max_size 10M
	php_value memory_limit 35M
</Directory>
Categories: Apache, Linux Tags: