install.sh 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. #!/bin/bash
  2. ###
  3. # Application requirements
  4. ###
  5. # Subversion & Mercurial
  6. apt-get install hg subversion
  7. # Directories
  8. echo "Directory structure..."
  9. mkdir /home/siteadm_admin
  10. mkdir /home/siteadm/ /home/siteadm/common /home/siteadm_domain /home/siteadm_website /home/siteadm_email
  11. chown root:root /home/siteadm_admin
  12. chmod 755 /home/siteadm_admin
  13. # Siteadm user, common user group and sudo
  14. echo "Users ans groups..."
  15. groupadd -g 502 siteadm
  16. groupadd -g 503 siteadm_account
  17. useradd -g 502 -u 502 -d /home/siteadm_admin siteadm
  18. groupadd -g 2000 siteadm_common
  19. useradd -g 2000 -u 2000 -d /home/siteadm/common siteadm_common
  20. useradd -g 2000 -u 3000 -d /home/siteadm/common php_common
  21. # MySQL user
  22. echo "MySQL..."
  23. apt-get install mysql-server
  24. # PHP5 & PHP-FPM
  25. echo "PHP..."
  26. apt-get install php5-fpm php5-cli php-apc php5-mcrypt php5-mysql php-pear php5-gd php5-intl
  27. ln -s /usr/sbin/php5-fpm /usr/sbin/php-fpm
  28. rm /etc/init.d/php5-siteadm
  29. ln -s /home/siteadm_admin/conf/php/php5-siteadm.sh /etc/init.d/php5-siteadm
  30. update-rc.d -n php5-siteadm defaults
  31. service php5-siteadm start
  32. # Apache
  33. echo "Apache..."
  34. apt-get install apache2-mpm-worker libapache2-mod-fastcgi
  35. echo "Apache configuration..."
  36. rm /etc/apache2/sites-available/siteadm.conf
  37. ln -s /home/siteadm_admin/conf/apache/siteadm /etc/apache2/sites-available/
  38. a2ensite siteadm
  39. mkdir /etc/apache2/sites-siteadm
  40. echo "Include sites-siteadm/" >> /etc/apache2/apache2.conf
  41. a2enmod actions
  42. a2enmod ssl
  43. a2enmod fastcgi
  44. a2enmod rewrite
  45. a2dismod cgid
  46. service apache2 restart
  47. echo "Base installation completed"
  48. # Awstats
  49. echo "Awstats..."
  50. apt-get install awstats libgeo-ipfree-perl libgeo-ip-perl libencode-perl liburi-perl
  51. cp /home/siteadm_admin/template/awstats/awstats.common /etc/awstats/awstats.common
  52. # Passwords
  53. apt-get install makepasswd
  54. # ACL
  55. echo "ACL..."
  56. apt-get install acl
  57. # Quota
  58. echo "Quota..."
  59. apt-get install quota quotatool
  60. touch /home/aquota.user
  61. touch /home/aquota.group
  62. chmod 600 /home/aquota.*
  63. quotaoff -a
  64. quotacheck -vgumc /home
  65. # @todo : update fstab avec SED : ,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0,acl
  66. quotaon -avug
  67. # Mercurial sur apache
  68. apt-get install libapache2-mod-wsgi
  69. a2enmod wsgi
  70. # ProftpD
  71. echo "ProftpD..."
  72. apt-get install proftpd proftpd-mod-mysql
  73. # Postfix
  74. echo "Postfix..."
  75. apt-get install postfix-mysql
  76. mkdir /etc/postfix/virtual
  77. # DKIM
  78. echo "DKIM..."
  79. # @todo : http://viralblog.fr/animation/ubuntu-configurer-domainkey-dkim-sur-postfix/
  80. # Postgrey
  81. echo "Postgrey..."
  82. apt-get install postgrey
  83. # Dovecot
  84. echo "Dovecot..."
  85. apt-get install dovecot-lmtpd dovecot-mysql dovecot-imapd dovecot-pop3d dovecot-postfix dovecot-sieve dovecot-antispam
  86. # Spamassassin
  87. echo "Spamassassin..."
  88. apt-get install spamassassin
  89. # clamav
  90. echo "clamav..."
  91. apt-get install clamav-daemon
  92. # Amavis
  93. echo "Amavis..."
  94. apt-get install amavisd-new
  95. # More decoders
  96. apt-get install zip unrar-free cabextract ripole
  97. # ejabberd
  98. echo "Ejabberd..."
  99. apt-get install ejabberd
  100. echo "Penser à télécharger et compiler le module MySQL"
  101. # Bind
  102. echo "Bind..."
  103. apt-get install bind9 bindgraph
  104. # ASterisk
  105. echo "Asterisk..."
  106. apt-get install asterisk
  107. # Outils
  108. echo "Imagemagick... pour la manipulation d'images"
  109. apt-get install imagemagick
  110. echo "adodb... pour torrentflux"
  111. apt-get install php5-adodb
  112. ###
  113. # Initialisation Script
  114. ###
  115. echo "Rendez-vous sur https://siteadm/install.php pour finir l'installation...";