Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 冲浪宝典 > 冲浪技巧 > 在dubuntu 下安装 Apache2 和 vsftpd
【标  题】:在dubuntu 下安装 Apache2 和 vsftpd
【关键字】:dubuntu,Apache2,vsftpd
【来  源】:http://www.cublog.cn/u/11826/showart.php?id=108641

在dubuntu 下安装 Apache2 和 vsftpd

Your Ad Here

    昨天买了个破机器(具体多破就不说了)来给我们的 dubuntu做个web和ftp服务器,具体的过程非常顺利,写下过程留念。

0、IP地址及域名的准备 (没有域名可跳过这一步)
    先说说我的具体情况:上海电信的 ADSL ,上传64K字节,下载128K 字节。由于我们三个人同时使用它上网,因此我们买了个小路由器 DL-504,DL-504的WAN端使用RJ-45双绞线接到ADSL猫的输出端,我们再从DL-504的输出端使用RJ-45双绞线连接到自己机器上的10/100M自适应网卡上。所以我们三个人的机器都使用内网IP,而ADSL猫的输出端地址是可以被外网访问的,但它不固定,每次都是动态申请的。我们申请的域名就绑定到这个动态的IP上,当然使用了“花生壳”网站提供的动态域名绑定(DDNS)服务,而DL-504对DDNS提供内置支持,因此在“花生壳”申请了免费的用户名,密码和免费域名,照着 DL-504 的安装说明很容易就将这个ADSL动态的IP地址绑定到了一个固定的域名上。

1、操作系统的安装
  当然是选择 ubuntu 了,由于机器很破,因此不安装图形系统,仅安装 Server模式,完成后占用 380 兆硬盘空间。
    因为我们在服务器上不干别的事,而 ubuntu 默认要启动N多的服务,这样就比较有内容,而且启动速度慢。 这里选择安装  sysv-rc-conf 这个系统服务管理工具来对这些服务进行删减,把所有不可能用到的都给删了。
    另外,由于我没有为服务器装配 鼠标键盘和显示器,因此只能进行远程管理。 为此安装了 ssh 软件包,服务器上就启动了 ssh 服务;在其它机器中使用 ssh 客户端就可以对服务器进行管理了,非常方便。

2、 Apache2 的安装
    Apache2 软件包是 ubuntu 官方维护的,非常顺利的就安装完成。另外,由于我目前只是做了个简单的静态网页,因此不必安装 php, perl , tomcat 之类的东西,因此 apache2 不用配置就可以使用,只需要将自己做好的网站放到其默认目录(/var/www/)下即可被外部访问。

3、vsftpd 的安装
    这也是被官方支持的包,但它得进行一些设置才能使用。
    附录是我机器的一些设置( /etc/vsftpd.conf 文件)。

4、测试

测试比较简单,只要在任一网络浏览器的地址栏中输入下面的格式即可:
ftp://username:password@ipaddress
其中 username 和 password 是可选内容,有 password 必须有 username ,但允许只提供 username,例如下边的都合法:
ftp://dubuntu:abcde@dubuntu.vicp.net   以用户名 dubuntu 登录,密码为:abcde。
ftp://dubuntu@dubuntu.vicp.net 以用户 ubuntu 登录,暂不提供密码
ftp://dubuntu.vicp.net    匿名登录
 

附录:

# Example config file /etc/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
#
# Run standalone?  vsftpd can run either from an inetd or as a standalone
# daemon started from an initscript.
listen=YES
#
# Run standalone with IPv6?
# Like the listen parameter, except vsftpd will listen on an IPv6 socket
# instead of an IPv4 one. This parameter and the listen parameter are mutually
# exclusive.
#listen_ipv6=YES
#
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=YES   #设置为YES,则 ftp 和 anonymous 都将被视为匿名用户而允许登录。
no_anon_password=YES  #匿名用户可以不用输入密码
#
# Uncomment this to allow local users to log in.
local_enable=YES        #允许服务器上的本地用户作为 FTP 用户。
#
# Uncomment this to enable any form of FTP write command.
write_enable=YES        #允许进行写操作
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
local_umask=077
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
#anon_upload_enable=YES
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
#dirmessage_enable=YES
#
# Activate logging of uploads/downloads.
xferlog_enable=NO
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
#connect_from_port_20=YES     # 是否启动端口20来传递数据。关闭这一项兼容性更好。
#
# If you want, you can arrange for uploaded anonymous files to be owned by
pam_service_name=vsftpd
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# You may override where the log file goes if you like. The default is shown
# below.
#xferlog_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog format
xferlog_std_format=YES
#
# You may change the default value for timing out an idle session.
idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#nopriv_user=ftpsecure
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
# You may fully customise the login banner string:
ftpd_banner=Welcome to Dubuntu FTP server.  # 登录时的欢迎信息
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#deny_email_enable=YES
# (default follows)
#banned_email_file=/etc/vsftpd.banned_emails
#
# You may restrict local users to their home directories.  See the FAQ for
# the possible risks in this before using chroot_local_user or
# chroot_list_enable below.
chroot_local_user=YES  # 将用户锁定在规定的目录。
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
#chroot_list_enable=YES
# (default follows)
#chroot_list_file=/etc/vsftpd.chroot_list
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
#ls_recurse_enable=YES
#
#
# Debian customization
#
# Some of vsftpd's settings don't fit the Debian filesystem layout by
# default.  These settings are more Debian-friendly.
#
# This option should be the name of a directory which is empty.  Also, the
# directory should not be writable by the ftp user. This directory is used
# as a secure chroot() jail at times vsftpd does not require filesystem
# access.
secure_chroot_dir=/var/run/vsftpd
#
# This string is the name of the PAM service vsftpd will use.
pam_service_name=vsftpd
#
# This option specifies the location of the RSA certificate to use for SSL
# encrypted connections.
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
#
# This option specifies the location of the RSA key to use for SSL
# encrypted connections.
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key

# local dir
local_root=/var/www/  #一般用户初始目录
anon_root=/var/www/download/ #匿名用户初始目录
# Max clients
max_clients=10     #可同时接入的最大用户数。
#
tcp_wrappers=YES

什么是RSS?RSS及其发展历程:【上一篇】
[从GTALK中解除MSN]:【下一篇】
【相关文章】
  • Apache2.0及以上版本使用点滴
  • Vsftpd+PAM安装配置
  • FB6+apache2+php5+MySQL+phpMyAdmin+vsftpd+discuz的安装
  • 在RedHat AS 4.0下安装Tomcat 5.5.9和apache2.0.54
  • ErrorLog导致apache2直接崩溃
  • vsFTPd架设FTP服务器
  • 怎样配置Apache2.0.54与Tomcat5.0.28?
  • deiban vsftpd 简单安装配置
  • 编译安装apache2+php5+mysql4+ZendOptimizer+Cronolog简易文档
  • vsftpd被动模式FTP服务
  • 【随机文章】
  • 用VB制作文件下载程序
  • PowerBuilder程序运行错误解释
  • HTML的基本元素(一)
  • storage vendor
  • 偷梁换柱大法:给RMVB影视添加字幕
  • unix下的基本系统数据类型
  • 开源企业软件采购指南
  • Oracle数据库日常维护
  • 千招百式,玩“活”Word打印
  • 手把手教你可复用的SSO组件设计(设计篇)
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 bbb软讯网络 All Rigths Reserved.