2008年3月2日星期日

cherry blog

http://cherry.ur-solution.com/?p=509

1、先添加Debian的国内安装源:

在/etc/apt/sources.list

几个速度比较快的apt源中根据自己的情况添加:

教科网

中科大
deb http://debian.ustc.edu.cn/debian testing main non-free contrib
deb-src http://debian.ustc.edu.cn/debian testing main non-free contrib
deb http://debian.ustc.edu.cn/debian-non-US testing/non-US main non-free contrib
deb-src http://debian.ustc.edu.cn/debian-non-US testing/non-US main non-free contrib
deb http://debian.ustc.edu.cn/debian-security testing/updates main

公网


# ftp.linuxforum.net 61.152.210.194
deb ftp://ftp.linuxforum.net/debian/ unstable main non-free contrib
deb ftp://ftp.linuxforum.net/debian-non-US/ unstable/non-US main non-free contrib

# mirrors.geekbone.org 61.172.200.169
deb http://mirrors.geekbone.org/debian/ unstable main non-free contrib
deb http://mirrors.geekbone.org/debian-non-US/ unstable/non-US main non-free contrib

# debian.cn99.com 61.132.102.124
deb http://debian.cn99.com/debian/ unstable main non-free contrib
deb http://debian.cn99.com/debian-non-US/ unstable/non-US main non-free contrib

#
deb http://packages.dotdeb.org stable all
deb-src http://packages.dotdeb.org stable all

添加过后执行apt-get update更新可下载的软件列表。

安装Apache2/PHP/Mysql服务器

方式一:
apt-get install php5

apt-get install apache2

apt-get install mysql-server mysql-client

apt-get install php5-mysql php5-curl php5-gd

dpkg -l 'php5-*'

aptitude install libapache2-mod-php5 php5-mysql

3、/etc/apache2/httdpd.conf 添加:

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

4、ln -s /etc/apache2/mods-available/php5.* /etc/apache2//mods-enabled

5、apt-get install apache2-mpm-prefork

6、/etc/init.d/apache2 restart

方式二:
11.安装Web/FTP服务器

安装操作需要以root用户来操作,需要装的软件有Apache2/php/mysql,ftp选用的是proftpd,另外有phpmyadmin和webalizer:

# apt-get install \
apache2-mpm-prefork \
libapache2-mod-php4 \
php4-pear \
php4-gd \
mysql-server \
mysql-client \
php4-mysql \
phpmyadmin \
proftpd \
webalizer

安装到Webalizer的时候,提示webalizer设置目录,填写/home/qingmedia/www/webalizer, 提示what is the filename of ...log时候,改为/var/log/apache2/access.log.1,因为apache2目录是/var/log/apache2。其他基本都按默认设置,回车即可。

12.安装Webmin管理软件

我对配置文件很头疼,因此喜欢webmin。我装了一大堆模块,如果用不上,可以去掉一些:

# apt-get install \
webmin-mailboxes \
webmin-htaccess \
webmin-bind \
webmin-exports \
webmin-quota \
webmin-virtual-server \
webmin-sshd \
webmin-inetd \
webmin-core \
webmin-mysql \
webmin-dhcpd \
webmin-fsdump \
webmin-slbackup \
webmin-ssl \
webmin-exim \
webmin-software \
webmin-logrotate \
webmin-samba \
webmin-grub \
webmin-firewall \
webmin-xinetd \
webmin-burner \
webmin-updown \
webmin-status \
webmin-webalizer \
webmin-adsl

一些模块有提示,我都是按默认的,因为不是很清楚。

二、软件配置

1.设置Webmin访问控制

webmin默认是只允许本地访问的,需要修改一下配置文件/etc/webmin/miniserv.conf

# nano /etc/webmin/miniserv.conf

把"allow=127.0.0.1"改为"allow="即可,重新启动webmin:

# /etc/init.d/webmin restart

2.设置mysql密码:

给mysql的root用户加密码(默认密码为空), (xxxxxx为新密码):

* mysqladmin -u root -p password xxxxxx

然后提示“Enter password:“,因原密码为空,因此直接敲回车键。
设置mysql默认语言:

3.修改/etc/mysql/my.cnf:

# nano /etc/mysql/my.cnf

在[mysqld]下加入一行“default-character-set=gbk“就可以正确查找汉字,否则在查单个汉字时,会出现错误的结果。
设置PHP

# nano /etc/php4/apache2/php.ini

4.修改register_globals:

把register_globals = Off 改为On (某些php程序需要这个设置)。

5.设置Apache2

默认的web网页目录在/var/www/,定义在/etc/apache2/sites-enabled/000-default中,我在前面把网页目录定在“/home/dvhome/www“,因此修改如下:

# nano /etc/apache2/sites-enabled/000-default

如DocumentRoot /var/www/改为 DocumentRoot /home/dvhome/www/,并取掉Indexs和重定向 RedirectMatch:

NameVirtualHost *

......
DocumentRoot /home/dvhome/www/
......

......
# RedirectMatch ^/$ /apache2-default/
......

......


三、网站资料上传

最后,把网页文件上传到/home/dvhome/www里面即可。





===========
1、先添加个源:

在/etc/apt/sources.list中添加:

deb http://packages.dotdeb.org stable all

deb-src http://packages.dotdeb.org stable all

apt-get update

2、apt-get install php5

apt-get install apache2

apt-get install mysql-server mysql-client

apt-get install php5-mysql php5-curl php5-gd

dpkg -l 'php5-*'

aptitude install libapache2-mod-php5 php5-mysql

3、/etc/apache2/httdpd.conf 添加:

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

4、ln -s /etc/apache2/mods-available/php5.* /etc/apache2//mods-enabled

5、apt-get install apache2-mpm-prefork

6、/etc/init.d/apache2 restart

没有评论: