Author Topic: Unable to point Domain to the right public_html in Centos web panel  (Read 390 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
I have:

Set AWS EC2 Instance for Centos 7 up
Installed Centos Web Panel.
Associated an Elastic IP to my Insance
In Route 53 of AWS I added a record for my domain which was pointing to the Static IP of my instance.
And in My Domain DNS I provided Nameservers provided by AWS Route 53 for my instance.
I created a new Account in Centos WP and provided the domain.
But still when I open the domain in browser it is loading default Apache page in Centos that is in /usr/local/apache/htdocs/index.html. which should actually point to /home/username/public_html/index.php

I tried to:

Manually edit the httpd.conf file in Apache
And point domain to user directory
I succeeded, but then the all .php files in that directory started to give 500 Internal error, I think it may be a problem of Nameservers but I don't have any clue,

Can anyone point me to right direction to setup a website in Centos Webpanel in AWS?

My Virtual Hosts Configuration, this is what I tried to put in httpd.conf but when 500 Error started to come I had to remove it.


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

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

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

<Directory "/home/devogq/public_html">
    Options all
    Require all granted
    AllowOverride All
</Directory>

</VirtualHost>
# vhost_end devo.gq


After adding this code in httpd.conf file. still I am still being pointed to default htdocs directory of apache. in error logs i am getting this error
[Sun Apr 23 17:43:04.554884 2017] [:error] [pid 16402:tid 140288731281152] [client 103.69.219.30:27233] File does not exist: /usr/local/apache/htdocs/devo.php

Offline
***
Re: Unable to point Domain to the right public_html in Centos web panel
« Reply #1 on: March 13, 2019, 04:06:59 AM »
I have:

Set AWS EC2 Instance for Centos 7 up
Installed Centos Web Panel.
(...)
I succeeded, but then the all .php files in that directory started to give 500 Internal error, I think it may be a problem of Nameservers but I don't have any clue,

Can anyone point me to right direction to setup a website in Centos Webpanel in AWS?
(...)

Nameservers problems normally doesn't causes error 500.
The best bet is you have a ownership problem.
You must assure you php program have ownership devogq:devogq under '/home/devogq/public_html' directory:
Code: [Select]
# chown -R devogq:devogq /home/devogq/public_html/

Quote
After adding this code in httpd.conf file. still I am still being pointed to default htdocs directory of apache. in error logs i am getting this error
[Sun Apr 23 17:43:04.554884 2017] [:error] [pid 16402:tid 140288731281152] [client 103.69.219.30:27233] File does not exist: /usr/local/apache/htdocs/devo.php

This is a completely different problem.
Your configured domain ('devo.gq' and 'www.devo.gq') are not resolving to your server.
Your URI request was for a file possibly not resolving in your DNS server.

Check with:
Code: [Select]
# host devo.gq
# host www.devo.gq

or

Code: [Select]
# dig +short devo.gq
# dig +short www.devo.gq

So, you must to configure them to resolve in your CWP server, to apache find them, and serve them in your server.
As it not resolve to your server, apache is serving the main IP server, trying to find the file 'devo.php' in the area of the main server.
Fix that, and your problem is solved.

Regards,
Netino

Offline
*
Re: Unable to point Domain to the right public_html in Centos web panel
« Reply #2 on: March 13, 2019, 04:16:32 AM »
I have:

Set AWS EC2 Instance for Centos 7 up
Installed Centos Web Panel.
Associated an Elastic IP to my Insance
In Route 53 of AWS I added a record for my domain which was pointing to the Static IP of my instance.
And in My Domain DNS I provided Nameservers provided by AWS Route 53 for my instance.
I created a new Account in Centos WP and provided the domain.
But still when I open the domain in browser it is loading default Apache page in Centos that is in /usr/local/apache/htdocs/index.html. which should actually point to /home/username/public_html/index.php

I tried to:

Manually edit the httpd.conf file in Apache
And point domain to user directory
I succeeded, but then the all .php files in that directory started to give 500 Internal error, I think it may be a problem of Nameservers but I don't have any clue,

Can anyone point me to right direction to setup a website in Centos Webpanel in AWS?

My Virtual Hosts Configuration, this is what I tried to put in httpd.conf but when 500 Error started to come I had to remove it.


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

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

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

<Directory "/home/devogq/public_html">
    Options all
    Require all granted
    AllowOverride All
</Directory>

</VirtualHost>
# vhost_end devo.gq


After adding this code in httpd.conf file. still I am still being pointed to default htdocs directory of apache. in error logs i am getting this error
[Sun Apr 23 17:43:04.554884 2017] [:error] [pid 16402:tid 140288731281152] [client 103.69.219.30:27233] File does not exist: /usr/local/apache/htdocs/devo.php

Any suggestion? vivavideo

Offline
***
Re: Unable to point Domain to the right public_html in Centos web panel
« Reply #3 on: March 13, 2019, 04:28:10 AM »
Did you check your logs..??