mark2015
mark2015

Reputation: 9

confusing about apache virtual host directive

Im having hard times trying to figure it out how to make this particularry configuration to apache webserver in order to fit my needs. Im running centOS6 and i have 4 different IP addresses and im trying to add : the first IP to be listed for 10 domains the second IP address to be listen for other 10 domains the third IP address to be listen for another 10 domains the four ip address to be listen for another 10 domains In httpd.conf i have added Listen Ip:port - which is the first ip address asociated with first 10 domains and everything is fine here.This is the file for each domain from /httpd/conf.d :

NameVirtualHost *:80

<Directory "/var/www/www.my url.com">
  Options +Indexes FollowSymLinks
  AllowOverride All
  Order allow,deny
  Allow from all
</Directory>

<VirtualHost *:80>
  ServerName www.my url.com
  ServerAlias www.www.my url.com www.my url.com
  DocumentRoot /var/www/www.my url.com
</VirtualHost>`

The problem starts with the another round of 10 domains having the second ip address. This is the directives for each of those domains:

Listen 151.x.x.x:8080
NameVirtualHost 151.x.x.x:8080

<Directory "/var/www/Myurl.com">
  Options +Indexes FollowSymLinks
  AllowOverride All
  Order allow,deny
  Allow from all
</Directory>

<VirtualHost 151.x.x.x:8080>
  ServerName www.Myurl.com
  ServerAlias www.Myurl.com Myurl.com
  DocumentRoot /var/www/Myurl.com
</VirtualHost> 

When im trying to restart the apache server im getting this message: Address already in use: make_sock: could not bind to address 151.x.x.x:8080 no listening sockets available, shutting down Unable to open logs

What should be the problem ? and how can i add those different ips to my domains ??

Upvotes: 0

Views: 116

Answers (1)

covener
covener

Reputation: 17872

The error means something else is listening on that IP:PORT, including potentially duplicate Listen directives in this instance of httpd. Use grep to find the duplicate.

Upvotes: 0

Related Questions