Forum Moderators: phranque

Message Too Old, No Replies

wildcard NameVirtualHosts and default servers:

         

agriz

6:57 pm on Mar 14, 2012 (gmt 0)

10+ Year Member



I created virtual hosts in apache

I didnt change anything in the default config.
i am using nginx with apache

just added these lines at the end of the config file.


<VirtualHost *:8080> 
ServerAdmin info@server1.com
DocumentRoot /var/www/html/server1
ServerName www.server1.com
ErrorLog /etc/httpd/logs/server1.error.log
CustomLog /etc/httpd/logs/server1.access.log common
</VirtualHost>

<VirtualHost *:8080>
ServerAdmin info@server2.com
DocumentRoot /var/www/html/server2
ServerName www.server2.com
ErrorLog /etc/httpd/logs/server2.error.log
CustomLog /etc/httpd/logs/server2.access.log common
</VirtualHost>

httpd -S


VirtualHost configuration: 
wildcard NameVirtualHosts and _default_ servers:
_default_:443 s1.server1.com (/etc/httpd/conf.d/ssl.conf:74)
*:8080 is a NameVirtualHost
default server www.server1.com (/etc/httpd/conf/httpd.conf:1017)
port 8080 namevhost www.server1.com (/etc/httpd/conf/httpd.conf:1017)
port 8080 namevhost www.server2.com (/etc/httpd/conf/httpd.conf:1025)
Syntax OK

What is wrong?

phranque

12:08 am on Mar 15, 2012 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



what problem are you having?

agriz

5:50 am on Mar 15, 2012 (gmt 0)

10+ Year Member



i didn't restart the httpd so far. is that normal?

agriz

3:13 pm on Mar 15, 2012 (gmt 0)

10+ Year Member



If i use virtual hosts, do i need to configure named.conf?

phranque

3:25 pm on Mar 15, 2012 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



are you saying your apache server won't start?
have you checked the server error log for clues?

please clearly describe the problem you are having.

agriz

3:38 pm on Mar 15, 2012 (gmt 0)

10+ Year Member



No. Website is in online. SO i have just modified the httpd.conf and i didnt restart the apache so far.

I can't tell whether my config is right or wrong. I am waiting for your confirmation.

If i create virtual hosts, do i need to configure dns too?

Thanks

phranque

3:10 pm on Mar 16, 2012 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



does an nslookup of the hostnames resolve to the proper IP address(es)?

lucy24

8:13 pm on Mar 16, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



To clarify: You've got everything set up. You don't know if there's anything wrong. But you're afraid to restart until someone assures you it looks good, because you're afraid your server will explode if you did something wrong?

It's been two days and nobody has screamed No! You can't do it that way! Just be sure you've kept a copy of the previous config file. Do as I say. Not as I do.