1. 启用root帐号
现在我能用先前输入的帐号和密码登录了。首先为了系统安装的方便我得激活root帐号,如果你想的话以后你可以再禁用它。
sudo passwd root
su
这样现在我们就是以root的身份登录了。
2. 配置网络
由于Ubuntu安装程序在安装时已经把网络配置成DHCP形式,现在我们得把他改一下,因为服务器用的应该是静态的IP地址。根据实际情况编辑修改这个文件 /etc/network/interfaces
然后重启网络
/etc/init.d/networking restart
编辑 /etc/hosts 这个文件并且把你的新IP地址加进去:
127.0.0.1 localhost.localdomain localhost server1
192.168.0.100 server1.example.com server1
192.168.0.101 virtual-ip1.example.com virtual-ip1
3. 设置主机名
echo server1.example.com > /etc/hostname
/bin/hostname -F /etc/hostname
编辑 /etc/apt/sources.list 并更新你的Linux系统
编辑 /etc/apt/sources.list. 应该内容显示如下
4. 安装 SSH 守护进程
apt-get install ssh openssh-server
安装/卸载相关软件
现在我们需要安装一些稍后必须的软件,并卸载一些不再需要的包。
apt-get install binutils cpp cpp-4.0 fetchmail flex gcc gcc-4.0 libarchive-zip-perl libc6-dev libcompress-zlib-perl libdb4.3-dev libpcre3 libpopt-dev linux-kernel-headers lynx m4 make ncftp nmap openssl perl perl-modules unzip zip zlib1g-dev autoconf automake1.9 libtool bison autotools-dev (写在一行里!)
5. 安装 Quota
apt-get install quota
编辑 /etc/fstab 文件成以下内容 (我添加了usrquota,grpquota 到加载点 / 和 /var):
6. 安装 DNS 服务器
apt-get install bind9
为了安全,我们更改bind的运行时根目录,步骤如下:
7. 安装 MySQL
apt-get install mysql-server mysql-client libmysqlclient12-dev
mysqladmin -u root password yourrootsqlpassword
现在运行 netstat -tap 将看到这一行信息:
tcp 0 0 localhost.localdo:mysql *:* LISTEN 2449/mysqld
这表示 MySQL 已经开始监听 3306端口了. 现在跳到下一节 (Postfix). 如果你没有看到这一行信息, 编辑 /etc/mysql/my.cnf ,注释掉 skip-networking:
# skip-networking
修改完后 /etc/mysql/my.cnf 重启MySQL:
/etc/init.d/mysql restart
8. 安装 Postfix
安装Postfix (带SMTP-AUTH和TLS) 的步骤:
apt-get install postfix postfix-tls libsasl2 sasl2-bin libsasl2-modules libdb3-util procmail (1 line!)
dpkg-reconfigure postfix
9. 安装 Courier-IMAP/Courier-POP3
安装 Courier-IMAP/Courier-IMAP-SSL (IMAP监听993端口) 和 Courier-POP3/Courier-POP3-SSL (POP3监听995端口).
apt-get install courier-authdaemon courier-base courier-imap courier-imap-ssl courier-pop courier-pop-ssl courier-ssl gamin libgamin0 libglib2.0-0 (one line!)
<- No
<- OK
配置 Postfix 转发 email到用户的邮件目录 Maildir:
postconf -e ‘home_mailbox = Maildir/’
postconf -e ‘mailbox_command =’
/etc/init.d/postfix restart
通过菜单 Management -> Settings -> EMail 的 ISPConfig web interface 窗口,确保 Maildir 在接口列表中.
10. 安装 Apache
运行
apt-get install apache2 apache2-common apache2-doc apache2-mpm-prefork apache2-utils libapr0 libexpat1 ssl-cert (写在一行里!)
apt-get install autoconf automake1.4 autotools-dev libapache2-mod-php4 libkrb53 php4 php4-common php4-dev php4-imagick php4-mcrypt php4-rrdtool php4-sqlite php4-curl php4-domxml php4-gd php4-imap php4-ldap php4-mcal php4-mhash php4-mysql php4-odbc php4-pear php4-xslt (写在一行里!)
<- Yes
修改 /etc/apache2/apache2.conf 文件. 将
DirectoryIndex index.html index.cgi index.pl index.php index.xhtml
改为
DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php3 index.pl index.xhtml
修改/etc/mime.types 文件并去掉以下几行的注释符:
#application/x-httpd-php phtml pht php
#application/x-httpd-php-source phps
#application/x-httpd-php3 php3
#application/x-httpd-php3-preprocessed php3p
#application/x-httpd-php4 php4
修改 /etc/apache2/mods-enabled/php4.conf 文件并去掉以下行的注释符:
<IfModule mod_php4.c>
# AddType application/x-httpd-php .php .phtml .php3
# AddType application/x-httpd-php-source .phps
</IfModule>
修改 /etc/apache2/ports.conf 文件,添加 监听端口443 :
Listen 80
Listen 443
添加Apache的一些模块 (SSL, rewrite 和 suexec):
a2enmod ssl
a2enmod rewrite
a2enmod suexec
a2enmod include
让 Apache 使用新配置:
/etc/init.d/apache2 force-reload
11. 安装 Proftpd
apt-get install proftpd proftpd-common ucf
<- standalone
为了安全原因,添加以下几行到 /etc/proftpd.conf 文件(感谢 Reinaldo Carvalho; 更多的信息请查看: http://proftpd.linux.co.u……guide/linked/userguide.html):
DefaultRoot ~
IdentLookups off
ServerIdent on “FTP Server ready.”
重启 Proftpd:
/etc/init.d/proftpd restart
12. 安装 Webalizer
apt-get install webalizer
为 SpamAssassin (随 ISPConfig 安装)安装一些 Perl 模块
apt-get install libhtml-parser-perl libdb-file-lock-perl libnet-dns-perl
接下来的步骤 …
服务器所有的安装已经结束了, 现在开始安装 ISPConfig .
13. 安装 ISPConfig
我将安装 ISPConfig 的当前版本. 从 http://www.ispconfig.org/downloads.htm 下载最新版本到 /tmp 目录.
解压 ISPConfig-archive,换目录到 install_ispconfig:
tar xvfz ISPConfig*.tar.gz
cd install_ispconfig
开始安装
./setup
安装程序开始编译一个带PHP5支持的Apache,它将运行在81端口,ISPConfig自身运行需要这个Apache. 它不会干扰现有的Apache,因此你不必担心.
ISPConfig编译结束后,一个缺省的SSL认证有已经编译好。安装过程将询问你一些问题。你可以接受缺省值或设定一个新值:
在第 7 步 (Encrypting RSA private key of CA with a pass phrase for security [ca.key]) 和第 8 步 (Encrypting RSA private key of SERVER with a pass phrase for security [server.key]) ,创建认证过程中,安装程序将询问你是否希望加密相应的密钥. 选 n,因为如果你选y(yes)的话,当你想重启ISPConfig时,系统都要求你给出密码,但它却没有相应的显示界面,这意味着你根本不可能重启它!
如果编译失败,安装程序将停止并自动删除全部已经编译的文件。你可以从错误信息中看看出错的原因(大多数情况下,是缺少一些文件,例如MySQL的头文件),可以试一试修改错误然后再次执行 ./setup.
安装成功后:
Please choose your language(选这合适的语言) . 下面是ISPConfig的语言选择界面.
然后安装程序显示ISPConfig的许可证 (BSD licence)界面. 请认真阅读,输入y表示同意,n表示不同意(安装程序将退出).
选择安装模式时我选了expert(专家模式),因为我想自己设置网站的根目录为 /var/www .
当安装程序要求你选择安装模式时,输入2并回车.
然后程序问你安装的守护进程(例如postfix等)和文件路径是否安装程序都识别出来了,选 y。
当安装程序询问:
Web-Root: /home/www
Is this correct? [y/n]
选 n 然后输入 /var/www 更改网站根目录.
接着安装程序继续询问一些配置问题:
Please enter your MySQL server: localhost
Please enter your MySQL user: root
Please enter your MySQL password: (输入你安装MYSql时设定的密码)
Please enter a name for the ISPConfig database (e.g. db_ispconfig): db_ispconfig
Please enter the IP address of the ISPConfig web (e.g. 192.168.0.1): 192.168.0.100 (输入你服务器的IP)
然后安装程序要求输入host和domain的名字,如果你的机器已经有了一个host和domain名字,你可以输入。
但是由于我只是测试安装,所以我让host空着,在domain栏输入我的IP地址。
Please enter the host name (e.g. www):
Please enter the domain (e.g. xyz.de): 192.169.0.100
Please select the protocol (http or https (SSL encryption)) to use to access the ISPConfig system:
1) HTTPS
2) HTTP
Your Choice: 1
回答完问题后,ISPConfig就正式安装完成了。如果安装时你设置你的host为www,domain为xyz.de的话,那么你现在可以通过 https://www.xyz.de:81 或 http://www.xyz.de:81 访问它. 可以通过缺省的用户名admin和密码admin登录,建议立即通过ISPConfig页面 Tools -> Change password 更改密码。
接着从ISPConfig控制面板 Management -> Server -> Settings 的EMail页选中 Maildir选项.
如果你的机器有多个IP, 可通过 Management -> Server ->Settings on the tab Server -> IP List 检查是否全部IP地址都已经正确检测到.
通过这个网址,你可以查找到ISPConfig的安装说明: http://www.ispconfig.org/manual_installation.htm
ISPConfig使用手册在这里: http://www.ispconfig.org/documentation.htm
来源:http://www.howtoforge.com/perfect_setup_ubuntu_5.10
近期评论