找回密码
 注册会员
搜索

本文来自

Linux

Linux

订阅|关注

请添加对本版块的简短描述

297

主题

314

帖子

2343

积分

管理员

Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20

积分
2343

[教程] 2015版DirectAdmin安装全过程(官方正版授权版,开心版绕道)

[复制链接]
跳转到指定楼层
楼主
44070 xiaoxiao 发表于 2015-12-3 13:12:48
本帖最后由 xiaoxiao 于 2016-1-13 16:23 编辑

下载官方脚本执行安装
  1. wget http://www.directadmin.com/setup.sh
  2. chmod 755 setup.sh
  3. ./setup.sh
复制代码




提示是否需要执行脚本预安装必须的第三方软件包  输入y
  1. *****************************************************
  2. *
  3. * DirectAdmin requires certain packages, described here:
  4. *   http://help.directadmin.com/item.php?id=354
  5. *
  6. * Would you like to install these required pre-install packages? (y/n): y
复制代码


安装完毕第三方的包以后  会要求输入用户ID  授权ID 主机名 选择网卡
  1. Complete!
  2. *
  3. *****************************************************

  4. Please enter your Client ID : 111
  5. Please enter your License ID : 111
  6. Please enter your hostname (server.domain.com)
  7. It must be a Fully Qualified Domain Name
  8. Do *not* use a domain you plan on using for the hostname:
  9. eg. don't use domain.com. Use server.domain.com instead.
  10. Do not enter http:// or www

  11. Enter your hostname (FQDN) : testda.vpsmao.com
  12. Client ID:  111     
  13. License ID: 111
  14. Hostname: testda.vpsmao.com
  15. Is this correct? (y,n) : y
  16. The following ethernet devices/IPs were found. Please enter the name of the device you wish to use:

  17. gretap0      
  18. gre0      
  19. ip6tnl0      
  20. venet0       127.0.0.1
  21. venet0:0       192.184.95.151

  22. Enter the device name: venet0:0
  23. Your external IP: 192.x.x.x
  24. The external IP should typically match your license IP.

  25. Is 192.x.x.x the IP in your license? (y,n) : y

  26. DirectAdmin will now be installed on: Enterprise 6.6
  27. Is this correct? (must match license) (y,n) : y
复制代码


Client IDLicense ID 请参见授权信息里面.

Hostname 主机名 必须是一个能解析访问有效的二级域名.

Enter the device name 网卡设备: OpenVZ一般是 venet0 或者 venet0:0,XEN KVM 独立服务器 的网卡是eth0或者eth1 ,具体看网卡设备后面是否是本机使用的IP

确认设备 以后 会提示 IP和操作系统是否正确   选择 y



接下来是选择自定义安装的版本  目前建议使用custombuild 2.0需要php5.2的请选择 custombuild 1.2

本教程使用 custombuild 2.0 选择 1

  1. You now have 4 options for your apache/php setup.

  2. 1: custombuild 2.0       Apache 2.4, mod_ruid2, php 5.5. Can be set to use mod_php, php-FPM or fastcgi.
  3. 2: custombuild 1.1:      end-of-life software.  Apache 2.x, php 4, 5, or both in cli and/or suphp. Defaults to php 5.2
  4. 3: custombuild 1.2:      Production version: Apache 2.x, php 5 in cli or suphp. Defaults to php 5.3
  5. 4: custombuild 2.0 BETA: Apache 2.4, php-fpm, php 5.6. Can be set to use mod_ruid2, mod_php, php-FPM or fastcgi.

  6.       Post any issues with custombuild to the forum: http://forum.directadmin.com/forumdisplay.php?f=61

  7. Enter your choice (1, 2, 3 or 4): 1

  8. Would you like the default settings of apache 2.4 with mod_ruid2 and php 5.5 cli? (y/n): n
复制代码




提示选择默认的版本  这里我们选择 n 因为 cli 版本没有隔离用户和站点 我们需要在下面选择

  1. Would you like the default settings of apache 2.4 with mod_ruid2 and php 5.5 cli? (y/n): n
复制代码




提示是否备份配置文件  输入  yes

  1. Would you like to backup the current options.conf? (yes/no): yes
  2. Backup created: /usr/local/directadmin/custombuild/options.conf.20151105102436.backup
复制代码




选择 WEB 服务程序  ,一般为了兼容性我们选择 apache ,如果有别的需求,建议选择nginx_apache 这个兼容性比较好,litespeed 需要商业授权,否则是免费版,限制很多.

  1. Please select webserver you would like to use (apache/nginx/nginx_apache/litespeed):apache
复制代码




选择 FTP 服务程序,一般我们选择 proftpd ,选择 pureftpd 也可以,都是DA后台在控制生成ftp信息

  1. Please select FTP server you would like to use (proftpd/pureftpd/no):proftpd
复制代码




接下来选择 PHP 版本。支持 php5.3~7.0,请根据自己的需求选择

PHP 运行模式,我们选择 suphp

是否安装第2个版本的PHP  输入 no  我们可以在安装完毕以后使用 CustomBuild 插件进行配置多版本php.

  1. Please select default PHP version you would like to use (5.3/5.4/5.5/5.6/7.0):5.3
  2. Please select default PHP mode you would like to use (php-fpm/fastcgi/suphp/lsphp/mod_php):suphp
  3. Would you like to have a second instance of PHP installed? (yes/no): no
复制代码




接下来是常用组件,

一般 ionCube  和 Zend Guard Loader 是必选的,输入  yes

suhosin PHP安全修复组件  必选 yes

phpMyAdmin   必选 yes

其他几个组件是email的  根据需求自选

  1. Please select if you would like to use ionCube (yes/no):yes
  2. Please select if you would like to use Zend Guard Loader (yes/no):yes
  3. Please select if you would like to use suhosin (yes/no):yes
  4. Please select if you would like CustomBuild to manage Exim installation (yes/no):no
  5. Please select if you would like CustomBuild to manage Dovecot installation (yes/no):no
  6. Please select if you would like CustomBuild to manage phpMyAdmin installation (yes/no):yes
  7. Please select if you would like CustomBuild to manage SquirrelMail installation (yes/no):no
  8. Please select if you would like CustomBuild to manage RoundCube installation (yes/no):no
复制代码




接下来 是否测试选择最快的镜像  y
  1. Would you like to search for the fastest download mirror? (y/n): y
复制代码




接下来开始自动安装 MYSQL会自动安装为 5.5版本 ,后面都可以使用 CustomBuild 插件来自定义选择版本

根据服务器性能一般等待15~30分钟左右就安装完毕了,安装完毕以后会提示后台登录地址和帐号密码(类似下图)

  1. ## INSTALL_COMPLETE
  2. ## ACCOUNT_INFO


  3. The following information has been set:

  4. Admin username:   admin
  5. Admin password:   Axxxxxx2
  6. Admin email:      admin@testda.vpsmao.com


  7. Server IP: 192.x.x.x
  8. Server Hostname: testda.vpsmao.com

  9. To login now, follow this link:

  10. http://192.x.x.x:2222

  11. and enter your Admin username and password when prompted.

  12. You should now visit http://admin.site-helper.com and http://www.directadmin.com/newinstall.html to learn how to get started.

  13. Thank you for using DirectAdmin.  Should you have any questions, don't hesitate to contact us at support@directadmin.com

  14. ## REPORT_END
  15. Permissions set

  16. System Security Tips:
  17.   http://help.directadmin.com/item.php?id=247
复制代码




最后安装汉化包:
(也可以直接安装带中文的主题/皮肤)

中文覆盖语言包  替换默认英文语言包  无需其他设置即可默认中文

  1. cd /usr/local/directadmin/data/skins/enhanced/lang/
  2. mv en olden
  3. wget http://down.imnpc.me/DirectAdmin/1483/en.tar.gz
  4. tar xvzf en.tar.gz
  5. mv en cn
  6. tar xvzf en.tar.gz
  7. chown -R diradmin:diradmin *
  8. rm -rf en.tar.gz
复制代码


然后将默认语言替换为中文:
  1. vi /usr/local/directadmin/data/users/admin/user.conf
复制代码

找到language=en 修改为language=cn


需要中英文双语的请执行如下脚本

  1. cd /usr/local/directadmin/data/skins/enhanced/lang/
  2. wget http://down.imnpc.me/DirectAdmin/1483/cn.tar.gz
  3. tar xvzf cn.tar.gz
  4. chown -R diradmin:diradmin *
  5. rm -rf cn.tar.gz
复制代码




可选安装主题/皮肤(带中文面板)

免费主题-Capri

作者发布地址 https://github.com/Terrorhawk/Capri

  1. wget -o capri.sh http://localserver.flaxe.eu/Capri-install/capri.sh
  2. chmod +x capri.sh
  3. ./capri.sh
复制代码


或者

  1. wget -O capri.sh https://raw.githubusercontent.com/Terrorhawk/Capri/master/install-script --no-check-certificate
  2. chmod +x capri.sh
  3. ./capri.sh
复制代码



安装过程
  1. Do you want to make a fresh install? (y/n) [y]: y

  2. This script will install and setup Capri Skin for DirectAdmin Control panel.

  3. Please choose a skin name or press enter to use default [Capri]: Capri
  4. Skin name will be: Capri

  5. Capri skin also have a email-only version for users who have a email services.
  6. Would you like to install a second email-only skin (will be called Capri-mail)? (y/n) [n]: n
复制代码



可能出现的问题:
症状如下图,当切换回enhanced可能会变成如下图


解决方案:
因为/usr/local/directadmin/data/users/admin/user.conf里language=cn
而/usr/local/directadmin/data/skins/enhanced/lang/里没有cn的语言包
所以产生了这个错误。
要么将user.conf里的language改回en,要么就在/lang里建立个cn的文件夹将en文件夹里的内容复制一份进去即可



其他可选项:

修改默认的2222端口:

  1. vi /usr/local/directadmin/conf/directadmin.conf
复制代码

将port=2222,改为你喜欢的数字

  1. service directadmin restart
复制代码

重启服务后生效



遇到的问题:
一:打开网页显示Internal Server Error
File”XXX/XXX/XXX/index.php“is writeable by group

解决办法:使用FTP工具将public_html目录下的全部文件,包含子文件夹,递归修改权限为755,不能为777



二:域名管理建立了的域名,子域名管理里就无需再添加www的子域名了
备注:例如123.com和www.123.com其实为同一个目录,都存放在域名根目录下(/public_html根目录下)



三:MySQL数据库不能远程连接

解决办法:进入域名后点击“MySQL管理”点选数据库进去,在下面的“Access Hosts”那栏添加一个“%”
备注:也可以添加你指定的IP地址







四:网站使用SSL
第一步:
  1. sed -i '$a enable_ssl_sni=1' /usr/local/directadmin/conf/directadmin.conf
复制代码

执行后可以用cat查看最尾有没有enable_ssl_sni=1,当然也可以手工vi加入!

最后重启Directadmin即可。
  1. service directadmin restart
复制代码


当然最后需要在DA后台设置了用户具有SSL功能的才能够使用!



五:当访问http的时候自动跳转至https
1:建立一个.htaccess文件
2:编辑器打开.htaccess文件,写入如下规则:

RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]



六:禁用Directadmin监控服务

  1. vi /usr/local/directadmin/data/admin/services.status
复制代码

将不需要的服务设置为OFF即可(例如将vm-pop3d关闭监控警报)
da-popb4smtp=ON
directadmin=ON
exim=ON
httpd=ON
mysqld=ON
named=ON
nginx=ON
proftpd=ON
sshd=ON
vm-pop3d=OFF



七:Directadmin默认的IP网站目录(例phpMyAdmin)

在目录:/var/www/html下



回复

使用道具 举报

快速回复 返回顶部 返回列表