$ sudo apt-get install apache2
这个时候可以看到apache启动了!
$ ps -ef | grep apache
tomcat6 6330 1 0 00:41 ? 00:00:55 /usr/lib/jvm/java-6-openjdk/bin/java -Djava.util.logging.config.file=/var/lib/tomcat6/conf/logging.properties -Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/share/tomcat6/endorsed -classpath /usr/share/tomcat6/bin/bootstrap.jar -Dcatalina.base=/var/lib/tomcat6 -Dcatalina.home=/usr/share/tomcat6 -Djava.io.tmpdir=/tmp/tomcat6-tmp org.apache.catalina.startup.Bootstrap start
www-data 22013 1 0 14:46 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 22016 1 0 14:46 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 22018 1 0 14:46 ? 00:00:00 /usr/sbin/apache2 -k start
lzh 24462 19693 0 14:56 pts/1 00:00:00 grep --color=auto apache
$ sudo apt-get install curl
检查一下是否安装成功,你可以在浏览器里面输入:http://localhost,如果正确则有一下的显示
$ curl http://localhost
It works!
This is the default web page for this server.
The web server software is running but no content has been added, yet.
3、在Apache中配置SSL
sudo a2enmod ssl
Enabling module ssl.
See /usr/share/doc/apache2.2-common/README.Debian.gz on how to configure SSL and create self-signed certificates.
To activate the new configuration, you need to run:
service apache2 restart
提示需要重启apache2,我们需要开启HTTPS需要的端口443,这下就需要编剧配置文件/etc/apache2/ports.conf:
$ sudo vim /etc/apache2/ports.conf
[sudo] password for lzh:
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default
# This is also true if you have upgraded from before 2.2.9-3 (i.e. from
# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
# README.Debian.gz
NameVirtualHost *:80
Listen 80
# If you add NameVirtualHost *:443 here, you will also have to change
# the VirtualHost statement in /etc/apache2/sites-available/default-ssl
# to
# Server Name Indication for SSL named virtual hosts is currently not
# supported by MSIE on Windows XP.
NameVirtualHost *:443
Listen 443
Listen 443
配置好了,我们还要开启a2ensite(apache2 enable site)
$ sudo a2ensite default-ssl
$ sudo /etc/init.d/apache2 restart
* Restarting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
现在还是用前面那个命令测试一下:
$ curl -k https://localhost
如果一切正常你将看到以下输出:
It works!
到这里你就有apache http,https可以用了。
接下来给trac的valid-user创建密码文件:
$ sudo htpasswd -c /etc/trac/trac.passwd xxxx
$ sudo htpasswd /etc/trac/trac.passwd demo
... continue this way for all your users.
创建trac要管理项目的初始化环境:
$ sudo -u www-data trac-admin /var/lib/trac/myproject initenv
你要输入这些信息:
Project Name [My Project]> ProjectName
Database connection string [sqlite:db/trac.db]> [Just press Enter to accept the default]
Repository type [svn]> [Just press Enter to accept the default]
Path to repository [/path/to/repos]> /var/lib/svn/myproject(这里不能delete,最好是写好以后复制进去)