Need help with adding web server to VPS

Connect with other users about what to run on your webhosting (and how to run it) here.
Post Reply
lowheartrate
A semi-regular
A semi-regular
Posts: 28
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Thu Jul 02, 2015 2:54 pm
Contact:

Need help with adding web server to VPS

Post by lowheartrate »

I was directed by the support team to http://forums.nfoservers.com/viewtopic.php?f=46&t=11997 in order to install a web server into my VPS. I only have a 1-core as it is cheap and all the room I need so it is unmanaged meaning they don't provide me support for the VPS. I have done everything correctly but the only problem I am having is the /phpmyadmin page. When I go to my http://[ip goes here]/phpmyadmin it directs me to the following error / page.

Image

If anyone could help me out and tell me how to fix this issue that would be fantastic! My VPS is currently running the OS Centos 7. There was nothing else installed other than the tutorial that I went through to install the web server.
Image
User avatar
Markie
A regular
A regular
Posts: 56
Joined: Mon Oct 01, 2012 11:55 am
Location: AS14586

Re: Need help with adding web server to VPS

Post by Markie »

Greetings!

This can be corrected via the phpMyAdmin.conf file located at;

Code: Select all

# vi /etc/httpd/conf.d/phpMyAdmin.conf
Once you've located the file, you want to modify the contents of the <directory> i.e "Require ip 127.0.0.1" & "Allow from 127.0.0.1" to reflect your public home ISP address. (you could however, allow from all, but of course.. that would be a security concern.)

When all the modifications are complete don't forget to restart your httpd service with the following command;

Code: Select all

# service httpd restart
User avatar
Markie
A regular
A regular
Posts: 56
Joined: Mon Oct 01, 2012 11:55 am
Location: AS14586

Re: Need help with adding web server to VPS

Post by Markie »

Didn't get to edit my post in time, but here's two examples;

Code: Select all

<Directory /usr/share/phpMyAdmin/>
 <IfModule mod_authz_core.c>
  # Apache 2.4
  <RequireAny>
    Require ip YOUR-IP-HERE
    #Require ip ::1
  </RequireAny>
 </IfModule>
 <IfModule !mod_authz_core.c>
  # Apache 2.2
  Order Deny,Allow
  Deny from All
  Allow from YOUR-IP-HERE
  #Allow from ::1
 </IfModule>
</Directory>
and the less secure method.. (allows connections from everyone)

Code: Select all

<Directory /usr/share/phpMyAdmin/>
 Order allow,deny
 Allow from all
</Directory>
lowheartrate
A semi-regular
A semi-regular
Posts: 28
Joined: Thu Jul 02, 2015 2:54 pm
Contact:

Re: Need help with adding web server to VPS

Post by lowheartrate »

Markie wrote:Didn't get to edit my post in time, but here's two examples;

Code: Select all

<Directory /usr/share/phpMyAdmin/>
 <IfModule mod_authz_core.c>
  # Apache 2.4
  <RequireAny>
    Require ip YOUR-IP-HERE
    #Require ip ::1
  </RequireAny>
 </IfModule>
 <IfModule !mod_authz_core.c>
  # Apache 2.2
  Order Deny,Allow
  Deny from All
  Allow from YOUR-IP-HERE
  #Allow from ::1
 </IfModule>
</Directory>
and the less secure method.. (allows connections from everyone)

Code: Select all

<Directory /usr/share/phpMyAdmin/>
 Order allow,deny
 Allow from all
</Directory>
As the tutorial said to I commented out the entire usr/share/phpMyAdmin directory by using the # tag in the beginning of each line. Should I have not of done that? Either way I had replaced the default IP to my home IP and it still will not let me access the phpMyAdmin - Should I remove all those # tags so that it actually reads the usr/share/phpMyAdmin directory?
Image
User avatar
Markie
A regular
A regular
Posts: 56
Joined: Mon Oct 01, 2012 11:55 am
Location: AS14586

Re: Need help with adding web server to VPS

Post by Markie »

lowheartrate wrote: As the tutorial said to I commented out the entire usr/share/phpMyAdmin directory by using the # tag in the beginning of each line. Should I have not of done that? Either way I had replaced the default IP to my home IP and it still will not let me access the phpMyAdmin - Should I remove all those # tags so that it actually reads the usr/share/phpMyAdmin directory?
Can you please post your "phpMyAdmin.conf" without your IP(s) attached so I may have a closer look?
lowheartrate
A semi-regular
A semi-regular
Posts: 28
Joined: Thu Jul 02, 2015 2:54 pm
Contact:

Re: Need help with adding web server to VPS

Post by lowheartrate »

Markie wrote:
lowheartrate wrote: As the tutorial said to I commented out the entire usr/share/phpMyAdmin directory by using the # tag in the beginning of each line. Should I have not of done that? Either way I had replaced the default IP to my home IP and it still will not let me access the phpMyAdmin - Should I remove all those # tags so that it actually reads the usr/share/phpMyAdmin directory?
Can you please post your "phpMyAdmin.conf" without your IP(s) attached so I may have a closer look?
You can take a look at the file in the following pastebin: http://pastebin.com/20azTxhT
Image
User avatar
Markie
A regular
A regular
Posts: 56
Joined: Mon Oct 01, 2012 11:55 am
Location: AS14586

Re: Need help with adding web server to VPS

Post by Markie »

I can see where the issue is here, the guide wanted you to use the comments between <Directory /usr/share/phpMyAdmin/> & </Directory>

Code: Select all

<Directory /usr/share/phpMyAdmin/>
#
 <IfModule mod_authz_core.c>
  # Apache 2.4
  <RequireAny>
    Require ip YOUR-IP-HERE
    #Require ip ::1
  </RequireAny>
 </IfModule>
 <IfModule !mod_authz_core.c>
  # Apache 2.2
  Order Deny,Allow
  Deny from All
  Allow from YOUR-IP-HERE
  #Allow from ::1
 </IfModule>
#
</Directory>
lowheartrate
A semi-regular
A semi-regular
Posts: 28
Joined: Thu Jul 02, 2015 2:54 pm
Contact:

Re: Need help with adding web server to VPS

Post by lowheartrate »

Markie wrote:I can see where the issue is here, the guide wanted you to use the comments between <Directory /usr/share/phpMyAdmin/> & </Directory>

Code: Select all

<Directory /usr/share/phpMyAdmin/>
#
 <IfModule mod_authz_core.c>
  # Apache 2.4
  <RequireAny>
    Require ip YOUR-IP-HERE
    #Require ip ::1
  </RequireAny>
 </IfModule>
 <IfModule !mod_authz_core.c>
  # Apache 2.2
  Order Deny,Allow
  Deny from All
  Allow from YOUR-IP-HERE
  #Allow from ::1
 </IfModule>
#
</Directory>
Hmm thats weird ok I will fix that right away and get back to you.
Image
lowheartrate
A semi-regular
A semi-regular
Posts: 28
Joined: Thu Jul 02, 2015 2:54 pm
Contact:

Re: Need help with adding web server to VPS

Post by lowheartrate »

Markie wrote:I can see where the issue is here, the guide wanted you to use the comments between <Directory /usr/share/phpMyAdmin/> & </Directory>

Code: Select all

<Directory /usr/share/phpMyAdmin/>
#
 <IfModule mod_authz_core.c>
  # Apache 2.4
  <RequireAny>
    Require ip YOUR-IP-HERE
    #Require ip ::1
  </RequireAny>
 </IfModule>
 <IfModule !mod_authz_core.c>
  # Apache 2.2
  Order Deny,Allow
  Deny from All
  Allow from YOUR-IP-HERE
  #Allow from ::1
 </IfModule>
#
</Directory>
That fixed it, awesome! Thank you very much for your help. Maybe you can help me fix my next problem - How can I add the domain I own ( http://www.heartfx.org ) into my webserver so people don't have to type in that weird IP to view the website?
Image
User avatar
Markie
A regular
A regular
Posts: 56
Joined: Mon Oct 01, 2012 11:55 am
Location: AS14586

Re: Need help with adding web server to VPS

Post by Markie »

You would have to modify your DNS settings via the control panel of your domain provider (GoDaddy, Google Domains etc) and create an A record pointing towards your server's public IP.

Glad I could help you!
lowheartrate
A semi-regular
A semi-regular
Posts: 28
Joined: Thu Jul 02, 2015 2:54 pm
Contact:

Re: Need help with adding web server to VPS

Post by lowheartrate »

Markie wrote:You would have to modify your DNS settings via the control panel of your domain provider (GoDaddy, Google Domains etc) and create an A record pointing towards your server's public IP.

Glad I could help you!
Done! You're truly great :D
Image
Post Reply