small medium large xlarge

Generic-user-small
30 Sep 2011, 02:07
Jason Hsu (12 posts)

I’m on Chapter 16. For the life of me, I can’t get the Apache2 server to work. My OS is Ubuntu 11.04.

I’m confused about what I need in the /etc/apache2/apache2.conf file. What I have for the end portion (everything else is unchanged): NameVirtualHost *:80

<VirtualHost *:80> ServerName localhost DocumentRoot /home/jhsu/jhsu-save-ror/work/depot/public/

<Directory /home/jhsu/jhsu-save-ror/work/depot/public/>
	Order allow,deny
	Allow from all
</Directory>

</VirtualHost> Listen 80

The error message I get is: apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName [Thu Sep 29 20:48:47 2011] [warn] NameVirtualHost *:80 has no VirtualHosts httpd not running, trying to start (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down Unable to open logs Action ‘restart’ failed. The Apache error log may have more information.

Samr_small_pragsmall
30 Sep 2011, 14:16
Sam Ruby (634 posts)

The most important error in that is Address already in use. Find out what process is using the www port using the following command:

sudo netstat -lp | grep :www

The end of the line that is output will contain the process id and the simple name of the executable. You can find out more about that process using ls -p. You can kill that process using kill -9.

Here’s the lines that work for me on a clean install of Ubuntu 11.04:

ServerName rubixt
LoadModule passenger_module /home/rubys/.rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.9/ext/apache2/mod_passenger.so
PassengerRoot /home/rubys/.rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.9
PassengerRuby /home/rubys/.rvm/wrappers/ruby-1.9.2-p290/ruby

<VirtualHost *:80>
  Servername depot.rubixt
  DocumentRoot /home/rubys/work/depot/public
  <Directory /home/rubys/work/depot/public>
    AllowOverride all
    Options -MultiViews
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>
Generic-user-small
01 Oct 2011, 04:41
Jason Hsu (12 posts)

I have at the end of the file:

NameVirtualHost *:80

<VirtualHost *:80>
  Servername depot.rubixt
  DocumentRoot /home/jhsu/jhsu-save-ror/work/depot/public
  <Directory /home/jhsu/jhsu-save-ror/work/depot/public>
    AllowOverride all
    Options -MultiViews
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>

Listen 80

</code>

The error messages I’m getting are: apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName [Fri Sep 30 23:40:34 2011] [warn] NameVirtualHost *:80 has no VirtualHosts httpd not running, trying to start (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down Unable to open logs Action ‘restart’ failed. The Apache error log may have more information.

Generic-user-small
01 Oct 2011, 21:46
Jason Hsu (12 posts)

Thanks, Sam. I returned to an earlier VirtualBox snapshot, reinstalled passenger, and changed the /etc/apache2/apache2.conf file. What I have after “Include sites-enabled/” is:

ServerName rubixt
   LoadModule passenger_module /var/lib/gems/1.8/gems/passenger-3.0.9/ext/apache2/mod_passenger.so
   PassengerRoot /var/lib/gems/1.8/gems/passenger-3.0.9
   PassengerRuby /usr/bin/ruby1.8

<VirtualHost *:80>
  Servername depot.rubixt
  DocumentRoot /home/jhsu/jhsu-save-ror/work/depot/public
  <Directory /home/jhsu/jhsu-save-ror/work/depot/public>
    AllowOverride all
    Options -MultiViews
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>

</code>

You must be logged in to comment