You are not logged in.
Believe my I have tried and I am frustrated. The thing is, I have set up my web server to use httpd-vhost.conf so I set up my main domain and my other domain there as follows:
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
ServerAdmin ******@gmail.com
DocumentRoot "/srv/http"
ServerName myserver1.org
ErrorLog "/var/log/httpd/myserver1.org-error_log"
CustomLog "/var/log/httpd/myserver1.org-access_log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin ******@gmail.com
DocumentRoot "/home/******/http/myserver2.com"
ServerName myserver2.com
ErrorLog "/var/log/httpd/myserver2.com-error_log"
CustomLog "/var/log/httpd/myserver2.com-access_log" common
</VirtualHost>
And my /etc/hosts are configured with
127.0.0.1 localhost.localdomain localhost
127.0.0.1 ******.myserver1.org ******
127.0.0.1 ******.myserver2.com ******
ipnumbershort ******.myserver1.org ******
ipnumbershort ******.myserver2.com ******
ipv6addresslong ******.myserver2.com ******
ipv6addresslong ******.myserver1.org ******
::1 localhost.localdomain localhost
And everytime I access www.myserver2.com it shows me the content of www.myserver1.org
I mean I'm not that good at web servers they are just my hobby, but I get frustrated when I can't find a simple mistake.
Thanks in advance, please ask of any other info you need,
Eduardo Romero
Last edited by kensai (2013-02-24 14:47:44)
Offline
Your servername is oss-pr.com but the http host you're specifying in the browser is www.oss-pr.com, which is not the same, so it's going to the first one.
Add this to the oss-pr.com config after the ServerName:
ServerAlias www.oss-pr.com
Offline
You can/should leave the ServerName as is and add a ServerAlias
ServerAlias www.server.com
Also, I add the www.server.com to my /etc/hosts
And change the
<VirtualHost *:80>
to
<VirtualHost server.com:80>
Last edited by hunterthomson (2013-02-23 04:08:10)
OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec
Offline