分类存档: Linux

FastCGI开发学习

1. 下载fastcgi开发包,编译安装

http://www.fastcgi.com/dist/fcgi-current.tar.gz

wget http://www.fastcgi.com/dist/fcgi-current.tar.gz
tar zvzf fcgi-current.tar.gz
cd fcgi-current
./configure
make
make install

2. 下载spawn-fcgi,编译安装

http://www.lighttpd.net/download/spawn-fcgi-1.6.0.tar.gz

wget http://www.lighttpd.net/download/spawn-fcgi-1.6.0.tar.gz
tar zxvf spawn-fcgi-1.6.0.tar.gz
cd spawn-fcgi-1.6.0
./configure
make
make install

3. 编写测试的c fastcgi代码,存为 hello.c

#include 
int main( int argc, char *argv[] )
{
    while( FCGI_Accept() >= 0 ) {
        printf( "Content-Type: text/plain\n\n" );
        printf( "Hello FastCGI\n" );
    }
    return 0;
}

编译c源文件,运行时有可能会报找不到lib包,这里我复制了一份,也可以做一个软链接。我这里用的是64位的机器,所以复制到了:/usr/lib64,32位的用:/usr/lib。

gcc -o hello hello.c -lfcgi

4. 修改nginx.conf配置文件,重新启动nginx

server {
            listen   80;
            server_name _;

            location / {
                  root   /home/user/www;
                  index  index.html;
                  fastcgi_pass 127.0.0.1:9000;
            }
}

5. 启动hello

spawn-fcgi -a127.0.0.1 -p9000 -n ./hello

6. 访问nginx服务器,浏览器就会输出:Hello FastCGI

一个nginx c fastcgi学习环境搭建完毕。

fastcgi 开发学习资料:

FastCGI中文参考手册

http://man.lupaworld.com/content/develop/Perl/FastCGI_handbook_cn.pdf

Nginx下配置FastCGI

http://202.108.59.116/docs/Nginx%CF%C2%C5%E4%D6%C3FastCGI.pdf

CentOS Ubuntu 等linux 修改IP地址, DNS, 网关

由于修改网关总是忘记在哪个地方,每次都要去查询,太麻烦,今天在此备份一下:

一、CentOS 修改IP地址

修改对应网卡的IP地址的配置文件

# vi /etc/sysconfig/network-scripts/ifcfg-eth0
修改以下内容
DEVICE=eth0 #描述网卡对应的设备别名,例如ifcfg-eth0的文件中它为eth0
BOOTPROTO=static #设置网卡获得ip地址的方式,可能的选项为static,dhcp或bootp,分别对应静态指定的 ip地址,通过dhcp协议获得的ip地址,通过bootp协议获得的ip地址
BROADCAST=192.168.0.255 #对应的子网广播地址
HWADDR=00:07:E9:05:E8:B4 #对应的网卡物理地址
IPADDR=192.168.1.2 #如果设置网卡获得 ip地址的方式为静态指定,此字段就指定了网卡对应的ip地址
IPV6INIT=no
IPV6_AUTOCONF=no
NETMASK=255.255.255.0 #网卡对应的网络掩码
#NETWORK=192.168.1.1 #网卡对应的网络地址
GATEWAY=192.168.1.1(设置本机连接的网关的IP地址。例如,网关为10.0.0.2)
ONBOOT=yes #系统启动时是否设置此网络接口,设置为yes时,系统启动时激活此设备
TYPE=Ethernet
PEERDNS=yes
USERCTL=no
~

二、CentOS 修改网关
修改对应网卡的网关的配置文件
[root@centos]# vi /etc/sysconfig/network

修改以下内容
NETWORKING=yes(表示系统是否使用网络,一般设置为yes。如果设为no,则不能使用网络,而且很多系统服务程序将无法启动)

NETWORKING_IPV6=no

HOSTNAME=localhost.localdomain(设置本机的主机名,这里设置的主机名要和/etc/hosts中设置的主机名对应)

三、CentOS 修改DNS

修改对应网卡的DNS的配置文件
# vi /etc/resolv.conf
修改以下内容

nameserver 192.168.1.1 #域名服务器
nameserver 192.168.1.2

四、重新启动网络配置
# service network restart

# /etc/init.d/network restart

修改 IP 地址
即时生效:
# ifconfig eth0 192.168.0.2 netmask 255.255.255.0
启动生效:
修改 /etc/sysconfig/network-scripts/ifcfg-eth0

修改网关 Default Gateway
即时生效:
# route add default gw 192.168.0.1 dev eth0
启动生效:
修改 /etc/sysconfig/network

修改 DNS
修改/etc/resolv.conf
修改后可即时生效,启动同样有效

修改 host name
即时生效:
# hostname centos1
启动生效:
修改/etc/sysconfig/network

+++++++++++++++++++++++++++++++++++++++++

Ubuntu 下修改:

xinze@xinze-desktop:$ vi /etc/network/interfaces

auto lo

iface lo inet loopback

auto eth0

iface eth0 inet static

address 192.168.1.11

netmask 255.255.255.0

gateway  192.168.1.1

xinze@xinze-desktop:$ /etc/init.d/network restart

ffmpeg ffmpeg-php 安装及出错解决办法

在centos 5.4环境下安装 FFMPEG 和 FFMPEG-PHP 。

  1. 下载ffmepg及ffmpeg-php
    wget http://www.ffmpeg.org/releases/ffmpeg-export-snapshot.tar.bz2
    wget http://downloads.sourceforge.net/project/ffmpeg-php/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2?use_mirror=ncu
  2. 安装ffmpeg
    tar -xjf ffmpeg-export-snapshot.tar.bz2
    #进入解压后的源文件目录
    cd ffmpeg-export-2010-03-02/
    ./configure --prefix=/usr/local   --enable-shared
    make
    make install

    测试是否能正常使用:

    [root@mail ffmpeg-export-2010-03-02]# ffmpeg
    FFmpeg version SVN-r22144-snapshot, Copyright (c) 2000-2010 the FFmpeg developers
      built on Mar 30 2010 23:53:53 with gcc 4.1.2 20080704 (Red Hat 4.1.2-46)
      configuration: --prefix=/usr/local --enable-shared
      libavutil     50. 9. 0 / 50. 9. 0
      libavcodec    52.55. 0 / 52.55. 0
      libavformat   52.54. 0 / 52.54. 0
      libavdevice   52. 2. 0 / 52. 2. 0
      libswscale     0.10. 0 /  0.10. 0

    如果提示:“ffmpeg: error while loading shared libraries: libavdevice.so.52: cannot open shared object file: No such file or directory”

    vi /etc/ld.so.conf.d/ffmpeg.conf
    #在里面加入:usr/local/lib,这个目录,为ffmpeg安装后libavdevice.so.52等lib文件所在目录。
    ldconfig -v
  3. 安装ffmpeg-php
    tar -xjf ffmpeg-php-0.6.0.tbz2
    cd ffmpeg-php-0.6.0
    /usr/local/php/bin/phpize
    ./configure --with-php-config=/usr/local/php/bin/php-config  --with-ffmpeg=/usr/local
    make test
    make
    make install
    #在php.ini中加入extension=ffmpeg.so

    如果在make test中发现错误提示:make: *** [ffmpeg_frame.lo] Error 1
    则:

    mv ffmpeg_frame.loT ffmpeg_frame.lo

    测试是否安装成功:

    php -r 'phpinfo();' | grep ffmpeg
    ffmpeg
    ffmpeg-php version => 0.6.0-svn
    ffmpeg-php built on => Mar 31 2010 14:17:14
    ffmpeg-php gd support  => enabled
    ffmpeg libavcodec version => Lavc52.55.0
    ffmpeg libavformat version => Lavf52.54.0
    ffmpeg swscaler version => SwS0.10.0
    ffmpeg.allow_persistent => 0 => 0
    ffmpeg.show_warnings => 0 => 0

    如果有ffmepg-php模块错误提示:php: symbol lookup error: /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/ffmpeg.so: undefined symbol: register_ffmpeg_frame_class

    nm /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/ffmpeg.so|grep register_ffmpeg_frame_class
    #输出U register_ffmpeg_frame_class
    

    则修改ffmpeg_frame.c,将3处的PIX_FMT_RGBA32 更改为PIX_FMT_RGB32即可。

    vi ffmpeg_frame.c
    :%s/PIX_FMT_RGBA32/PIX_FMT_RGB32
    :w
    :q!
    ./configure --with-php-config=/usr/local/php/bin/php-config  --with-ffmpeg=/usr/local
    make test
    make
    make install

及时阻止SSH暴力破解入侵者方法

最近,老是发现有很多暴力破解SSH密码的入侵者,虽然服务器密码设置的很复杂,但是对于这类骚扰者,还是及时屏蔽的好。如下有三个工具,原理很简单,就是分析/var/log/secure日志,找出IP,将其屏蔽。

  1. DenyHosts
    DenyHosts是Python语言写的一个程序,它会分析sshd的日志文件(默认是/var/log/secure),当发现重复的攻击时就会记录IP到/etc/hosts.deny文件,启用tcp_wrappers,从而达到自动屏IP的功能。 通过http://denyhosts.sourceforge.net可以下载DenyHosts的程序,可以直接下载rpm包来安装,也可以通过src.rpm包重新编译并安装等,通过这种方式默认是安装在/usr/share/denyhosts目录下。
    我是通过yum直接安装的:yum install denyhosts.noarch, 可以通过修改/etc/denyhosts.conf来更改配置。启动服务:/etc/init.d/denyhosts start

    详细信息,查看源码。

  2. Perl脚本
    #!/usr/bin/perl 
    
    # 及时封锁使用"暴入法" 入侵的使用者(SSH)
    # 技术支援: http://www.vixual.net/ 
    
    #==相关参数== 
    
    #记录ssh 连线的LOG 档,预设: /var/log/secure
    $log_file = "/var/log/secure"; 
    
    #于多久的时间内尝试登入(秒),预设: 1 小时
    $time_range = 1 * 60 * 60; 
    
    #于$time_range 所设定的时间内,尝试登入失败多少次立即封锁IP,预设: 10 次
    $drop_count = 10; 
    
    #寄件通知,预设收件者: root@localhost
    $mail = 'root@localhost'; 
    
    #寄件程式的位置
    $sendmail = "/usr/sbin/sendmail"; 
    
    #==== 
    
    use Time::Local; 
    
    $ip = $ARGV[0];
    $daemon = $ARGV[1];
    $count = 0; 
    
    %month = (
    Jan => 0,
    Feb => 1,
    Mar => 2,
    Apr => 3,
    May => 4,
    Jun => 5,
    Jul => 6,
    Aug => 7,
    Sep => 8,
    Oct => 9,
    Nov => 10,
    Dec => 11
    ); 
    
    $time = time();
    ($second,$minute,$hour,$day,$month,$year) = localtime($time); 
    
    #取得登入失败的 log
    @list = `cat $log_file | grep "sshd.*Failed password.* $ip "`;
    for(my $i = $#list; $i >= 0; $i--){
    #取得 log 的时间
    my($log_month,$log_day,$log_time) = split(/ +/,$list[$i]);
    my($log_hour,$log_minute,$log_second) = split(/:/,$log_time);
    #前一年的记录
    if($log_month > $month){
    $log_year = $year - 1;
    }else{
    $log_year = $year;
    }
    #将时间转为秒数
    $log_time = timelocal($log_second,$log_minute,$log_hour,$log_day,$month{$log_month},$log_year);
    if($time < $log_time + $time_range ){
    $count++;
    }else{
    last;
    }
    } 
    
    if($count > $drop_count){
    #封锁 IP
    `iptables -A INPUT -p tcp -s $ip --dport 22 -j DROP`;
    if($mail){
    #寄件通知
    $hostname = `hostname`;
    $month++;
    $year += 1900;
    chomp($hostname);
    open(MAIL, "| $sendmail -t") || die "Can't open $sendmail !\n";
    print MAIL qq|To: $mail\n|;
    print MAIL qq|Subject: [$hostname]封锁$ip\n|;
    print MAIL qq|Content-Transfer-Encoding: 8bit\n|;
    print MAIL qq|Content-type: text/plain\; charset=Big5\n\n|;
    print MAIL "\n时间: $year-$month-$day $hour:$minute:$second\n----\n使用者\"$ip\" 尝试以SSH 登入伺服器,共失败$ count 次,已于防火墙封锁该IP。\n\n";
    print MAIL @list;
    close(MAIL);
    }
    } 
    
    exit; 
  3. Bash shell
    
    #! /bin/bash
    # 获取前 1 分钟内的 secure 记录,统计 ssh 认证失败的 IP 和其 失败次数
    SCANNER=`grep "\`date \"+ %e %H:%M\" -d \"-1min\"\`" /var/log/secure|awk '/Failed/{print $(NF-3)}'|sort|uniq -c|awk '{print $1"="$2;}'`
    for i in $SCANNER
    do
          # 取认证失败次数
          NUM=`echo $i|awk -F= '{print $1}'`
          # 取其 IP 地址
          IP=`echo $i|awk -F= '{print $2}'`
          # 若其在失败次数超过 5 次且之前没有被阻断过,那么添加一条策略将其阻断,并记录日志
          if [ $NUM -gt 5 ] && [ -z "`iptables -vnL INPUT|grep $IP`" ]
          then
                  iptables -I INPUT -s $IP -j DROP
                  echo "`date` $IP($NUM)" >> /var/log/scanner.log
          fi
    done
    

/var/log/secure 日志不记录问题

上天查看了服务器安全日志,防火墙屏蔽了处理了一些暴力破解ssh密码的ip(其中一个ip地址为北京一家有名的CDN服务提供商),然后删除了所有的/var/log/secure* 日志文件。

今天再来查看日志的时候,发现/var/log/secure竟然没有记录,才想到直接删除日志文件的时候,对应的服务需要重启。运行命令:service syslog  restart ;service sshd restart 后正常。

顺便复习下ssh在syslog中的设置的知识。

  1. /etc/ssh/sshd_config 中的设置:(即:SyslogFacility 设为AUTHPRIV)
    [root@mail ~]# more /etc/ssh/sshd_config
    #Port 22
    # Logging
    # obsoletes QuietMode and FascistLogging
    #SyslogFacility AUTH
    SyslogFacility AUTHPRIV
    #LogLevel INFO
    #就是把sshd的日志定义在authriv.info级别。
  2. 配合/etc/syslog.conf中的设置:
  3. [root@mail ~]# more /etc/syslog.conf
    # Log all kernel messages to the console.
    # Logging much else clutters up the screen.
    #kern.*                                                 /dev/console
    
    # Log anything (except mail) of level info or higher.
    # Don't log private authentication messages!
    *.info;mail.none;authpriv.none;cron.none                /var/log/messages
    
    # The authpriv file has restricted access.
    authpriv.*                                              /var/log/secure
重新启动sshd和syslog

eclipse 函数编译时报错:undefined reference to `pthread_create’

Eclipse + CDT:

pthread_create函数编译时报错:undefined reference to `pthread_create’

undefined reference to `pthread_create’
undefined reference to `MD5′

由于pthread 库不是 Linux 系统默认的库,连接时需要使用静态库 libpthread.a,所以在使用pthread_create()创建线程,以及调用 pthread_atfork()函数建立fork处理程序时,在编译中要加 -lpthread参数。

例如:在加了头文件#include 之后执行 pthread.c文件,需要使用如下命令:

gcc thread.c -o thread -lpthread

这种情况类似于
的使用,需在编译时加 -m 参数。

+++++++++
Linux上编译pthread程序,默认会出错。如题。原因如下。

-pthread
Add support for multithreading using the POSIX threads library.
This option sets flags for both the preprocessor and linker. It
does not affect the thread safety of object code produced by the
compiler or that of libraries supplied with it. These are HP-UX
specific flags.

所以如果在gcc的编译中(更准确的说是链接中)没有启动pthread的话,就会出现如下的链接错误。
pthread_test.c:(.text+0x8a): undefined reference to `pthread_create’
collect2: ld returned 1 exit status

另外一个参数-lpthread也能起到同样的作用。所以可以看出-pthread的本质应当时引入了thread对应的library。默认情况下,pthread对应的library在gcc编译链接中是不会被引入的。
所以 gcc -o backupfile backupfiles.c -pthread

出现如下错误:
undefined reference to ‘pthread_create’
undefined reference to ‘pthread_join’

问题原因:
pthread 库不是 Linux 系统默认的库,连接时需要使用静态库 libpthread.a,所以在使用pthread_create()创建线程,以及调用 pthread_atfork()函数建立fork处理程序时,需要链接该库。

问题解决:
在编译中要加 -lpthread参数
gcc thread.c -o thread -lpthread
thread.c为你些的源文件,不要忘了加上头文件#include

+++++++++

eclipse
解决方法如下:
Project->Properties->C/C++ Build->Settings->GCC C++ Linker->Libraries
在Libraries(-l)中添加pthread即可
在Libraries(-l)中添加crypto即可

如何在VI里显示行数? linux

如何在VI里显示行数?

:set nu
:set number
Ctrl + g

Ubuntu 5.10 –linux

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:81http://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

够郁闷…

linux等级3启动不了,莫名其妙….

init 3 命令后,等待我的就是漫长的黑屏幕,提示一个错误, 然后就发现硬盘的灯就不闪了………

linux "pwd" "whereis&qu

看了两个命令: pwd  whereis

[root@localhost /]# cd /
[root@localhost /]# cd /usr/lib/
[root@localhost lib]# pwd
/usr/lib

[root@localhost lib]# ls -al libz*
-rwxr-xr-x  1 root root 71704 2004-09-13  libz.a
lrwxrwxrwx  1 root root    15  1月  6 16:51 libz.so -> libz.so.1.2.1.2
lrwxrwxrwx  1 root root    15 12月  3 14:36 libz.so.1 -> libz.so.1.2.1.2
-rwxr-xr-x  1 root root 63528 2004-09-13  libz.so.1.2.1.2
lrwxrwxrwx  1 root root    16 12月  3 15:03 libzvt.so.2 -> libzvt.so.2.2.10
-rwxr-xr-x  1 root root 85768 2004-11-04  libzvt.so.2.2.10
[root@localhost lib]# whereis lib
lib: /usr/local/lib /usr/share/man/man3/lib.3pm.gz
[root@localhost lib]# whereis libz
libz: /usr/lib/libz.a /usr/lib/libz.so

Page 1 of 212