Author Topic: VHosts not working after adding domain  (Read 7481 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
VHosts not working after adding domain
« on: July 03, 2016, 05:25:43 PM »
Using all default settings, I created a user and of course put the main domian there and then created subdomain. All I get is the default Cent OS page.I tried logging in via FTP and changing that but it doesnt change.

What info do you need? or anyone else had this issue?

# vhost_start flagusa.mychm.co
<VirtualHost 54.197.14.194:80>
ServerName flagusa.mychm.co
ServerAlias www.flagusa.mychm.co
ServerAdmin steven@chalamministries.com
DocumentRoot "/home/chalam/public_html/flagusa"
ScriptAlias /cgi-bin/ /home/chalam/public_html/flagusa/cgi-bin/
#
# Custom settings are loaded below this line (if any exist)
# Include "/usr/local/apache/conf/userdata/chalam/flagusa.mychm.co/*.conf

<IfModule mod_suexec.c>
        SuexecUserGroup chalam chalam
</IfModule>

<IfModule mod_suphp.c>
        suPHP_UserGroup chalam chalam
</IfModule>

<Directory "/home/chalam/public_html/flagusa">
        AllowOverride All
</Directory>

</VirtualHost>
# vhost_end flagusa.mychm.co
« Last Edit: July 03, 2016, 05:37:26 PM by swg1cor14 »

Offline
*
Re: VHosts not working after adding domain
« Reply #1 on: August 02, 2017, 07:06:29 AM »
Using all default settings, I created a user and of course put the main domain there and then created subdomain. All I get is the default Cent OS page.

I'm replying to this post, because this post is the 3rd search result for vhosts on the entire forum.

Like swg1cor14, this is a fairly new installation without much changed on it. I created a user and then created a folder /home/username/public_html/newfolder

Browsing to sub.domain.com/newfolder I could view the files in ../public_html/newfolder.

I tried editing the vhosts to point the DocumentRoot from
Code: [Select]
="/home/username/public_html"to
Code: [Select]
="/home/username/public_html/newfolder"
and then restarted apache after the change. I would browse to sub.domain.com and still see the CWP CentOS welcome page. I scratched my head for a long time.

The resolution ended up being clearing the cache. You can test this on chrome by pressing F12 - Select Network - and then check the box "Disable Cache" and reload the page and it worked. Yay!  ;D

Turning off cache and it continued to work. Hope this helps someone!
« Last Edit: August 02, 2017, 07:08:17 AM by charlton »