Virtual hosts using sites enabled

Issues related to configuring your network
Post Reply
salmendar
Posts: 6
Joined: 2014/05/19 06:26:57

Virtual hosts using sites enabled

Post by salmendar » 2015/01/06 09:31:21

Hi,
i am pretty new to cenots and i am trying to make virtual hosts using sites-available and sites-enabled folders. the problem is that the both websites load the same folder even when the document root mentioned in them is different and their names are different.. for testing purposes. the websites are

http://anttechsolutions.ddns.net
http://anttechsolutions.strangled.net

i have done this in ubuntu using the apache.conf file but i want to do this the advanced way which i think i don,t understand....

once i can differentiate their results i want to put them at real-time environment... please help

i am using CentOS 7

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

Re: Virtual hosts using sites enabled

Post by aks » 2015/01/06 20:15:01

I'm not sure what you're asking....

Can't you create the relevant virtual host directives under /etc/http.d/conf.d?

salmendar
Posts: 6
Joined: 2014/05/19 06:26:57

Re: Virtual hosts using sites enabled

Post by salmendar » 2015/01/08 06:09:34

the virtual hosts tutorial to be exact didnt help me...

thats what i am saying.

both links direct me to the same place.

even if i use virtual hosts in apache.conf i dont get results.
the problem i see is that the fist website is on the system disks but the other one is on the raid disks which are mounted on the system. can that cause the problem because the Raid disk data is causing me problems.


<VirtualHost *:80>

ServerName www.ccc.net
ServerAlias ccc.net
DocumentRoot /var/www/html/
# ErrorLog /run/media/xxx/RD/html/ccc.net/error.log
# CustomLog /run/media/xxx/RD/html/ccc.net/requests.log combined

</VirtualHost>

<VirtualHost *:443>

ServerName www.xxx.net
ServerAlias www.xxx.net
DocumentRoot /run/media/xxx/RD/html/xxx.net/html
# ErrorLog /run/media/salmendar/RD/html/xxx.net/error.log
# CustomLog /run/media/salmendar/RD/html/axxx.net/requests.log combined

</VirtualHost>



these are the two virutal hosts configs with a little edits

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

Re: Virtual hosts using sites enabled

Post by aks » 2015/01/08 18:18:55

I'm not sure what you're saying. I thjink you mean:
1) You have two virtualhosts configured in /etc/http.d/conf.d
2) The virtualhost that exists in /var/www/html works okay.
3) The virtualhost that's NOT in /var/www/html does not work.
If this is the case, by default I think SELinux will prevent the website that's NOT in /var/www/html from being accessed. Try settings the server's SELinux to Permissive mode and test. If that works you've got an SELinux, otherwise, it's something else (BTW, did you make the file owner of the "other" (i.e.: non /var/www/html one) apache?)

Post Reply