I haven't registered any domain for my server. I might be wrong, but according to my understanding, the default ip for the server is public. my server ip is http://166.62.101.242/. but whenever i ping on that domain, it keeps redirecting to the /usr/local/cpanel/cgi-sys/defaultwebpage.cgi
folder. I have changed my /etc/httpd/conf/httpd.conf
<VirtualHost *:80>
DocumentRoot /var/www/html
<Directory /var/www/html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
however it still keeps redirecting to the cpanel page.
what changes do i need to make, so i can access the /var/www
folder without registering for a domain?
This redirection is because cPanel
uses Block Hosting. You will have to point a domain to the IP Address and tell cPanel
to register that domain in your system. I would highly suggest you to get a domain instead of modifying anything with cPanel
because if something goes wrong, you may not be able to manage your site. You can get a free domain from freenom.com
. If you need further assistance for setting it up, please hit me up and I'll guide you step by step.
It is looks that you have VPS with a WHM/cPanel. There are multiple possibilities to set that. The most easy way is to add an account and set a new domain... Or can hack the Apache global configuration WHM -> ApacheConfiguration -> Global Configuration and set a new virtual server in premain. The server should have same external and internal IPs The other way is to hack the main.conf template and change the httpd configuration. After, you should run:
/services/rebuildhttpdconf
to rebuild the httpd.conf
Please note that your changes in default httpd.conf will be overwrite everytime the cPanel/WHM will restart, so your solution with modification of default /etc/httpd/conf/httpd.conf it is not OK!
Try with the IP instead...
VirtualHost 166.62.101.242:80
...and clean your browser cache! (or you can try this first).
It seems there is error in processing .php file in apache. I have got same problem. change the ownership of the file. e.g. if the file name ins info.php
sudo chown nobody:nobody info.php
sudo chmod 644 info.php
Let me know if this help
Also make sure to add .php in
sudo vim /etc/httpd/apache/conf
AddType application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml .php
I had the same behavior and I was going to hit my head to the wall because of that :(. The reason why you are getting this is because the content of /etc/httpd/htdocs/index.html
IS
<html><head><META HTTP-EQUIV="refresh" CONTENT="0;URL=/cgi-sys/defaultwebpage.cgi"></head><body></body></html>
It takes 2 days for me to figure this out. If you managed to land your request on your server but the name you are requesting -the IP in our case- is not exist in the apache virtual hosts, the apache is going to response with this file. ;-)