views:

1355

answers:

3

I'm running Ubuntu 8.10 and I've installed the necessary packages as fast as I can tell. Under System > Administration > Services I see "Webserver (Apache2)" on the list.

Googling around suggested that there might be a problem with the /etc/hosts file not having a line reading "127.0.0.1 localhost", but I checked the file and it's there. I'm at a loss as to what to do next.

To be more clear, attempting to go to http://localhost/ doesn't load any page. The browser just keeps loading, but the page never comes up.

Here is my access.log:

192.168.1.101 - - [09/Feb/2009:09:59:54 -0800] "HEAD / HTTP/1.0" 200 - "-" "-"
192.168.1.101 - - [10/Feb/2009:02:10:26 -0800] "HEAD / HTTP/1.0" 200 - "-" "-"

and error.log (mostly just me resetting in an attempt to get it to work by fiddling with it)

[Mon Feb 09 08:17:47 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Mon Feb 09 15:40:27 2009] [notice] caught SIGTERM, shutting down
[Mon Feb 09 15:42:13 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Mon Feb 09 15:58:27 2009] [notice] caught SIGTERM, shutting down
[Mon Feb 09 15:59:57 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Mon Feb 09 16:31:12 2009] [notice] caught SIGTERM, shutting down
[Mon Feb 09 16:32:45 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Mon Feb 09 16:46:26 2009] [notice] caught SIGTERM, shutting down
[Mon Feb 09 16:49:53 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Mon Feb 09 22:54:51 2009] [notice] caught SIGTERM, shutting down
[Mon Feb 09 22:58:19 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Tue Feb 10 00:02:04 2009] [notice] caught SIGTERM, shutting down
[Tue Feb 10 00:04:54 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Tue Feb 10 00:18:24 2009] [notice] caught SIGTERM, shutting down
[Tue Feb 10 00:18:25 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Tue Feb 10 00:28:58 2009] [notice] caught SIGTERM, shutting down
[Tue Feb 10 00:28:59 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Tue Feb 10 00:32:10 2009] [notice] caught SIGTERM, shutting down
[Tue Feb 10 00:32:11 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Tue Feb 10 00:43:45 2009] [notice] caught SIGTERM, shutting down
[Tue Feb 10 00:43:46 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Tue Feb 10 00:45:51 2009] [notice] caught SIGTERM, shutting down
[Tue Feb 10 00:45:52 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Tue Feb 10 02:21:34 2009] [notice] SIGUSR1 received.  Doing graceful restart
[Tue Feb 10 02:21:34 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Tue Feb 10 02:24:39 2009] [notice] SIGUSR1 received.  Doing graceful restart
[Tue Feb 10 02:24:40 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Tue Feb 10 04:00:33 2009] [notice] SIGUSR1 received.  Doing graceful restart
[Tue Feb 10 04:00:33 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Tue Feb 10 04:29:03 2009] [notice] SIGUSR1 received.  Doing graceful restart
[Tue Feb 10 04:29:03 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Tue Feb 10 04:31:12 2009] [notice] SIGUSR1 received.  Doing graceful restart
[Tue Feb 10 04:31:12 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Tue Feb 10 04:39:45 2009] [notice] caught SIGTERM, shutting down
[Tue Feb 10 04:41:23 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Tue Feb 10 04:48:42 2009] [notice] caught SIGTERM, shutting down
[Tue Feb 10 04:48:43 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Tue Feb 10 04:48:45 2009] [notice] caught SIGTERM, shutting down
[Tue Feb 10 04:48:50 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
A: 

If you have started Apache and tried to connect to http://localhost via a browser, what error message are you geting?

anon
No error message, the page just doesn't load.
@Alex: Check the Apache error log file (in /var/log/(httpd?)/error.log.
David Hanak
A: 

If I remember correctly, you can configure which networks interfaces Apache binds to, which may not include localhost by default.

Have you tried connecting on your machine's external hostname, or IP (e.g. 192.168.x.y)?

Also, trying reading the "Installing Apache" part of this guide for Ubuntu 8.10.

David Grant
I'm behind a wireless router if that matters. I'm using a static IP f 192.168.1.50. Attempting to go to 192.168.1.50 doesn't load either.
Can you post your httpd.conf file?
David Grant
It only contains one line: ServerName localhost. That doesn't seem right at all. =-/
That's actually the guide I was already using. I got stuck after the first step. I entered "sudo apt-get install apache2" into the terminal, then once it was installed I went to http://localhost and got nothing. The guide doesn't say what to do if going there doesn't work.
+2  A: 

In order to have SVN working with apache under Ubuntu you need to:

  • install the proper packages
  • enable the proper apache modules
  • provide a working configuration file for apache
  • creating a repository

I've installed SVN through apache under various versions of Ubuntu and Debian, but never with the newest Ubuntu. I hope that my configuration will help you.

Install the proper packages

Make sure that you have the following packages installed 'libapache2-svn' and 'subversion'.

Enable the proper apache modules

Go to the folder '/etc/apache2/mods-enabled' and verify that the files 'dav_svn.conf' and 'dav_svn.load' are there. If they are missing simply do:

sudo a2enmod dav_svn

Provide a working configuration file for apache

This is where the fun starts. I've decided to use a virtual host for my own repository even if it's not visible to the outside world. Let's assume that you decide to make your repository available under http://svn.localhost/repos/. First add the following entry to '/etc/hosts'

127.0.0.1 svn.localhost

Then create a configuration file for apache and save it to '/etc/apache2/sites-enabled/' :

<VirtualHost *>
 ServerName svn.localhost

 ErrorLog /var/log/apache2/svn-error.log
 CustomLog /var/log/apache2/svn-access.log combined


 <Location /repos>

  # Enable the repository
  DAV svn

  # Path to your repository
  SVNPath /home/subversion

  # The following allows for basic http authentication.
  AuthType Basic
  AuthName "Subversion Repository"
  AuthUserFile /etc/apache2/dav_svn.passwd

  # Allow anonymous read, but make committers authenticate themselves
  <LimitExcept GET PROPFIND OPTIONS REPORT>
   Require valid-user
  </LimitExcept> 

  # Have the network shares autocomit their modifications
  SVNAutoversioning on

  # Needed because Microsoft Web Folders defaults to a timeout of 120, a higher number will work better
  DAVMinTimeout 600

  #
  # Broken WebDAV for Windows XP
  #
  BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully
  BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
  BrowserMatch "Microsoft-WebDAV-MiniRedir/5.1.2600" redirect-carefully
  BrowserMatch "^WebDrive" redirect-carefully
  BrowserMatch "^WebDAVFS" redirect-carefully

  <IfModule mod_headers.c>
   Header add MS-Author-Via "DAV"
  </IfModule>

  <IfModule mod_encoding.c>
   EncodingEngine on
   NormalizeUsername on
  </IfModule>
 </Location>

</VirtualHost>

Creating a repository

Create your repository with:

sudo mkdir -p /home/subversion/ sudo svnadmin create /home/subversion/ sudo chown -R www-data:www-data /home/subversion/

If you decide to locate your repository under a different folder make sure to update the apache setting of /home/subversion/ in the configuration file.

Update the your password file /etc/apache2/dav_svn.passwd with command htpasswd.

potyl
Thanks for all the help, but I still can't access http://svn.localhost/repos/, even after restarting the server or rebooting the computer.
Go you the apache log folder /var/log/apache2/ and look at the log files. Post everything that you seem pertinent for us to help you.
potyl