Author Topic: (SOLVED)More website in 1 server  (Read 6877 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
(SOLVED)More website in 1 server
« on: June 22, 2016, 03:53:40 AM »
Hello all,
I finished to configure CWP.
My first website is OK (Website domain go to public_html/website1)
When i create new user with domain2.com and virtual host show exact folder ( domain2.com -> public_html/website2)
I think some wrong with virtual host configuring.. but I don't know how to fix it? (rebuilt apache, fix permission)
I see like all new account only redirect to first website (not default page)



My virtual host file:

# vhost_start websiteA.com
<VirtualHost public_ip:80>
ServerName websiteA.com
ServerAlias www.websiteA.com
ServerAdmin ***@gmail.com
DocumentRoot "/home/folder1/public_html"
ScriptAlias /cgi-bin/ "/home/folder1/public_html/cgi-bin/
#
# Custom settings are loaded below this line (if any exist)
# Include "/usr/local/apache/conf/userdata/usr1/websiteA.com/*.conf

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

<IfModule mod_suphp.c>
        suPHP_UserGroup usr1 usr1
        suPHP_ConfigPath /home/usr1
</IfModule>

<Directory "/home/usr1/public_html">
        AllowOverride All
</Directory>

</VirtualHost>
# vhost_end websiteA.com


# vhost_start websiteB.com
<VirtualHost public_ip:80>
ServerName websiteB.com
ServerAlias www.websiteB.com
ServerAdmin ***@gmail.com
DocumentRoot "/home/folder2/public_html"
ScriptAlias /cgi-bin/ "/home/folder2/public_html/cgi-bin/
#
# Custom settings are loaded below this line (if any exist)
# Include "/usr/local/apache/conf/userdata/usr2/websiteB.com/*.conf

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

<IfModule mod_suphp.c>
        suPHP_UserGroup usr2 usr2
        suPHP_ConfigPath /home/usr2
</IfModule>

<Directory "/home/usr2/public_html">
        AllowOverride All
</Directory>

</VirtualHost>
# vhost_end websiteB.com
« Last Edit: June 22, 2016, 08:13:34 AM by thquantv »

Offline
*
Re: More website in 1 server
« Reply #1 on: June 22, 2016, 08:12:40 AM »
Issues solved.
Problem because of Apache config.
When I restart Apache show warning: _default_ VirtualHost overlap on port 80, the first has precedence
----> this issue make all domain only map to 1 web directory.
and guide me add to httpd.conf
NameVirtualHost *:80
Restart Apache -> it worked