Ubuntu配置Web Server和FTP

Linux作为Web服务器维护起来方便多了,不需要太担心病毒问题。以下对近日在Ubuntu 10.4上配置的Web服务做个记录。

1、安装web服务器环境

#sudo apt-get install apache2
#sudo apt-get install php5 php5-gd php5-cli
#sudo apt-get install mysql-server
#sudo apt-get install libapache2-mod-auth-mysql
#sudo apt-get install php5-myql
#sudo /etc/init.d/apache2 restart

在安装mysql的过程中,会提示输入数据访问的密码,根据提示设置即可。

2、开启Apache的mod_rewrite

#a2enmod rewrite
#vi /etc/apache2/sites-enabled/000-default
将:AllowOverride None    修改为:AllowOverride All
#/etc/init.d/apache2 restart

3、安装FTP并配置通过域名加用户名访问的个人主页

#sudo a2enmod userdir
#sudo apt-get install vsftpd
#sudo vi /etc/vsftpd.conf          //根据提示配置
# sudo /etc/init.d/vsftpd restart
#useradd -m yangcm             //新增用户
#passwd yangcm                     //设置用户密码

然后只需要在用户目录下新建“public_html”,将网页文件放置其中,就可以通过http://域名(IP)/~用户名访问了。

 

发表评论


注意 - 你可以用以下 HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>