Forum Moderators: phranque
Jim
I have ensured that apache is stopped before running /etc/init.d/apache2 reload
And to my knowledge nothing is sat on port 80
Here is a cat of my script with all 80's replaced with 8080
briansnr@ubuntu:/etc/apache2/sites-available$ cat example
Listen 8080
NameVirtualHost *:8080
<VirtualHost *:8080>
ServerAdmin webmaster@localhost
ServerName www.example.com:8080
DocumentRoot /var/www/example/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/example>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
# Uncomment this directive is you want to see apache2's
# default start page (in /apache2-default) when you go to /
#RedirectMatch ^/$ /apache2-default/
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
briansnr@ubuntu:/etc/apache2/sites-available$
yet still I get:-
briansnr@ubuntu:~$ /etc/init.d/apache2 reload
* Reloading apache 2.0 configuration... httpd not running, trying to start
(13): make_sock: could not bind to address [::]:80
no listening sockets available, shutting down
Unable to open logs
[edited by: jdMorgan at 9:34 pm (utc) on Mar. 25, 2007]
[edit reason] Examplified. [/edit]
Thanks for sticking with me on this :)
IPv6 is the new version of the Internet protocols that everyone will need to switch to in the next 5 to 10 years when the current Net runs out of addresses. I'm *just* starting to enable my sites to handle it.
How you tell if it's enabled will depend on your OS.
Try removing the reference to ::1 which is the IPv6 loopback address, and see if that helps (that's what Apache claims not to be able to bind to).
Rgds
Damon
briansnr@ubuntu:/etc/apache2/sites-available$ cat example
NameVirtualHost *
<VirtualHost *>
ServerName www.example.co.uk
DocumentRoot /var/www/example
</VirtualHost>
briansnr@ubuntu:/etc/apache2/sites-available$
Yet still I get
briansnr@ubuntu:/etc/apache2/sites-available$ /etc/init.d/apache2 reload * Reloading apache 2.0 configuration... [Sun Mar 25 23:17:00 2007] [warn] NameVirtualHost *:0 has no VirtualHosts
httpd not running, trying to start
(13): make_sock: could not bind to address [::]:80
no listening sockets available, shutting down
Unable to open logs
ARGGGHHHHHH! This is driving me mad ;(
Please stick with me, I'm sure this is something stupid.
[edited by: jdMorgan at 11:59 pm (utc) on Mar. 25, 2007]
[edit reason] Examplified. See Terms of Service. [/edit]
I copied the default file in sites-available
cd /etc/apache2/sites-available
sudo cp default my-site
then edited my copy
sudo vi my-site
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName my-site.com
ServerAlias *.my-site.com
DocumentRoot /var/www/my-site/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/my-site/>
# Options -Indexes
AllowOverride None
Order allow,deny
allow from all
# Uncomment this directive is you want to see apache2's
# default start page (in /apache2-default) when you go to /
RedirectMatch ^/$ /index.html
</Directory>
Then ran
sudo a2ensite my-site
I found that only by using *:80 not * would work. Wahooo! I had site #1 working. For site #2 I repeated the above, but had to drop the NameVirtualHost *:80 from the top of the file like so;
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName site-two.com
ServerAlias *.site-two.com
DocumentRoot /var/www/site-two
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/site-two>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
# Uncomment this directive is you want to see apache2's
# default start page (in /apache2-default) when you go to /
# RedirectMatch ^/$ /apache2-default/
</Directory>
Then
sudo a2ensite site-two
This worked for me. This has been a long and frustraiting journy, but hey I have learnt loads about Linux and especialy vi on the way :)