17 Apache/PHP5/Ruby/Python/WebDAV
现在安装APACHE
aptitude install apache2 apache2-doc apache2-mpm-prefork apache2-utils apache2-suexec libexpat1 ssl-cert
然后安装PHP5, Ruby, and Python(三项都是作为APACHE的模块)
aptitude install libapache2-mod-php5 libapache2-mod-ruby libapache2-mod-python php5 php5-common php5-curl php5-dev php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-mysql php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl
编辑/etc/apache2/mods-available/dir.conf:
vi /etc/apache2/mods-available/dir.conf
改变DirectoryIndex行
<IfModule mod_dir.c>
#DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm </IfModule>
DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php3 index.pl index.xhtml
现在我们要启动一些APACHE模块 (SSL, rewrite, suexec, include, and WebDAV):
a2enmod ssl
a2enmod rewrite
a2enmod suexec
a2enmod include
a2enmod dav_fs
a2enmod dav
重启APACHE
/etc/init.d/apache2 restart
修正RUBY的小问题,如果你安装了ISPConfig并且为一个站点启动RUBY,.rbx文件将能被运行并在浏览器中显示,但.rb文件不行-你被要求下载.rb文件-配置RUBY支持vhost时,情况也一样。这样修正它:
vi /etc/mime.types
注释掉 application/x-ruby 行
[...]
#application/x-ruby rb
[...]
重启动APACHE
/etc/init.d/apache2 restart
现在.rb文件能像.rbx一们显示了
下节我们要禁用PHP,(这是必须的,如果你想安装ISPConfig),ruby和phthon是默认被禁用的.
17.1全局性禁用PHP
(如果你不想安装ISPCONFIG,请跳过这节)
在ISPCONFIG 中你可以一个站点一个站点的配置PHP,这个行,那个不行。所以你应该先全局禁用PHP,以便能在ISPCONFIG中灵活配置
要全局禁用PHP,编辑/etc/mime.types 注释掉行:application/x-httpd-php
vi /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/php5.conf 这样做注释:
vi /etc/apache2/mods-enabled/php5.conf
<IfModule mod_php5.c>
# AddType application/x-httpd-php .php .phtml .php3
# AddType application/x-httpd-php-source .phps
</IfModule>
重启Apache
/etc/init.d/apache2 restart