欢迎大家赞助一杯啤酒🍺 我们准备了下酒菜:Formal mathematics/Isabelle/ML, Formal verification/Coq/Agda, C++/Erlang/Lisp
Install Apache2 On Debian
来自开放百科 - 灰狐
(版本间的差异)
第28行: | 第28行: | ||
==配置Python== | ==配置Python== | ||
− | vi /etc/apache2/sites-enabled/000-default | + | vi /etc/apache2/sites-enabled/000-default, 加入以下内容 |
<Directory /var/www/python/> | <Directory /var/www/python/> | ||
SetHandler mod_python | SetHandler mod_python | ||
第46行: | 第46行: | ||
==配置Perl== | ==配置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== |
2006年8月28日 (一) 14:13的版本
#apt-cache search apache2
#apt-get insall apache2 #apt-get install libapache2-mod-php4 #apt-get install libapache2-mod-python2.3 #apt-get install libapache2-mod-ruby libfcgi-ruby1.8 #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
目录 |
修改Apache2
vi /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
分享您的观点