Blog信息 |
blog名称: 日志总数:1304 评论数量:2242 留言数量:5 访问次数:7594687 建立时间:2006年5月29日 |

| |
[网站架构]Install Apache2 On Debian 软件技术
lhwork 发表于 2007/1/15 16:27:09 |
#apt-cache search apache2
#apt-get insall apache2
#apt-get install libapache2-mod-php4
#apt-get install libapache2-mod-python2.3
#apt-get install apt-get install ruby1.8 ruby1.8-examples
#ruby1.8 -version// ruby version info
#apt-get install libapache2-mod-ruby libfcgi-ruby1.8 libfcgi-dev
#apt-get install libapache2-mod-perl2
#apt-get install mysql-server-4.1 mysql-client-4.1
#apt-get install php4-mysql
#apt-get install python2.3-mysqldb
#apt-get libdbd-mysql-ruby1.8 // Ruby/DBI MySQL driver for Ruby 1.8
#apt-get install libdbd-mysql-perl // A Perl5 database interface to the MySQL database
#apt-get install postgresql // install postgresql 7.4.7
#apt-get install php4-pgsql // PostgreSQL module for php4
#apt-get install python2.3-pygresql // PostgreSQL module for Python
#apt-get install python2.3-pgsql // A Python DB-API 2.0 interface to PostgreSQL v7.x
#apt-get install libdbd-pg-ruby1.8 // Ruby/DBI PostgreSQL driver for Ruby 1.8
#apt-get install libpg-perl // Perl modules for PostgreSQL
目录[隐藏]
1 修改Apache2
2 配置PHP
3 配置Python
4 配置Perl
5 配置Ruby
[编辑]
修改Apache2vi /etc/apache2/sites-enabled/000-default
#RedirectMatch ^/$ /apache2-default/
[编辑]
配置PHP
把PHP脚本放在 /var/www 目录下就可以支持运行啦。
[编辑]
配置Python
vi /etc/apache2/sites-enabled/000-default, 加入以下内容 <Directory /var/www/python/>
SetHandler mod_python
PythonHandler mod_python.publisher
</Directory>
在/var/www/python 目录下创建.htaccess文件 SetHandler mod_python
PythonHandler mod_python.publisher
PythonDebug On
创建index.py文件 def index(name):
return "Welcome %s" % name
http://localhost/python/?name=huihoo (OK :)
[编辑]
配置Perl
vi /etc/apache2/sites-enabled/000-default, 加入以下内容 Alias /perl/ /var/www/perl/
<Location /perl/>
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
Options +ExecCGI
Order allow,deny
Allow from all
</Location>
touch index.pl #!/usr/bin/perl
print "Content-type: text/plain\n\n";
print "mod_perl \n";
http://localhost/perl/index.pl (OK :)
[编辑]
配置Ruby
ruby在apache里是以cgi或是fastcgi的形式运行的。
vi /etc/apache2/sites-enabled/000-default, 加入以下内容 Alias /ruby/ "/var/www/ruby/"
<Location /ruby/>
Options ExecCGI
AddHandler cgi-script .cgi
AddHandler fastcgi-script .fcgi .fcg .fpl
AllowOverride all
Order allow,deny
Allow from all
</Location>
touch index.fcgi #!/usr/bin/ruby1.8
print "Content-type: text/plain\n\n";
print "ruby \n";
参考:
http://wiki.rubyonrails.com/rails/pages/GettingStartedWithRails
RailsOnDebianStable - http://wiki.rubyonrails.org/rails/pages/RailsOnDebianStable
取自"http://wiki.huihoo.com/index.php?title=Install_Apache2_On_Debian" |
|
|