Configuring mysql stuffs on VPS
#1

Hi, I'm having a VPS with CentOS 6 x86_64 (Probably 64 bit.)
I'm done uploading stuffs to the VPS server, but I can't find a way to install and use mysql/phpmyadmin..
Things what I've done during installation:
1) Installed the EPEL Repositories.
2) Installed PHP-MYSQL, MYSQL-SERVER packages.
3) Created a user for mysql use.
4) Started the mysql and http services (service mysqld start and service httpd start)
When I access the site, http://vps_ip_address/phpmyadmin I just get "The requested URL /phpmyadmin was not found on this server."

Can someone help me in configuring this?
Reply
#2

phpmyadmin isn't a part of mysql server, try:

Quote:

sudo yum install phpmyadmin

Reply
#3

Looks like I didn't mention that one, I've already installed phpmyadmin..
Reply
#4

Did you install via yum?

EDIT: try this:

Create a link in /var/www/phpmyadmin like this:

sudo ln -s /your/phpmyadmin/dir /var/www/phpmyadmin
Reply
#5

Yes I did. I've done everything as the root user.
Reply
#6

Sorry for the double-post!
A small improvement now. I'm now getting "You don't have permission to access /phpmyadmin/ on this server."
Reply
#7

Find phpMyAdmin.conf.

By default, it only allows localhost. Also make sure to either allow from YOURIP/all and remove any deny from all
Reply
#8

Installation:
1- Add EPEL Repositories:

cd ~
wget http://download.fedoraproject.org/pu...6-8.noarch.rpm

sudo rpm -ivh epel-release*

rm epel-release*

2- Download And Configure MYSQL

sudo yum install mysql-server

sudo service mysqld start

sudo mysql_install_db

sudo mysql_secure_installation
Код:
You will be asked a number of questions:

Enter current password for root: press Enter

Set root password? Y

New password: Type an administrative password here
Re-enter new password: Confirm the password
Remove anonymous users? Y

Disallow root login remotely? Y

Remove test database and access to it? Y

Reload privilege tables now? Y
Your MySQL installation should be up and running. Test that you can log in with the password you set by typing:

mysql -u root -p

Type exit to return to the shell prompt:

exit


3- Download phpMyAdmin

sudo yum install phpmyadmin

4- Configure PhpMyAdmin

sudo nano /etc/httpd/conf.d/phpMyAdmin.conf

sudo service httpd start


It should work.. Try it.
Reply
#9

The best way to install mySQL and phpmyadmin is as follows.

Download and use the official mySQL Yum Repo at http://dev.mysql.com/downloads/repo/yum/

This repo is officially from mySQL so you will receive the latest updates right away, a guide to install it and mySQL is available at http://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/ simple way to install it is yum install mysql-community-server and make sure mysql-community-libs are installed if not yum install them as well.

Now you will need to install apache which is required for phpmyadmin so basic step is just yum install httpd

And now you will need to install PHP I don't recommend the default PHP version that is offered by the CentOS repo because it's very outdated you can use webstatic which provides the latest PHP releases via repo at https://webtatic.com/packages/php56/

Now as stated on here you have EPEL install phpmyadmin from that so once EPEL repo is enabled when you do yum install phpmyadmin it should be installing version 4.0.10.8

Once you installed everything make sure you securely setup mySQL and start it up, than start up apache and phpmyadmin will be running.

Just to remind you Apache and PHP is required for phpmyadmin to run.
Reply
#10

Did the last two guys even read? He already did that.
Reply
#11

Quote:
Originally Posted by kirostar
View Post
Guys, I got this problem before... But can't remember it

but try to enter this command: sudo mysql_secure_installation

and if you got the error too... re-install vps and try again.

I don't try to be smartass... but this way should work..
There's no use in talking to you, since you're just posting the tutorials which you've got from google search..

@Jake187: Here's my phpMyAdmin.conf file
Code:
# phpMyAdmin - Web based MySQL browser written in php
# 
# Allows only localhost by default
#
# But allowing phpMyAdmin to anyone other than localhost should be considered
# dangerous unless properly secured by SSL

Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin


<Directory /usr/share/phpMyAdmin/>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Deny from none
     Allow from all
   </IfModule>
</Directory>

<Directory /usr/share/phpMyAdmin/setup/>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Deny from none
     Allow from all
   </IfModule>
</Directory>

# These directories do not require access over HTTP - taken from the original
# phpMyAdmin upstream tarball
#
<Directory /usr/share/phpMyAdmin/libraries/>
    Order Deny,Allow
     Deny from none
    Allow from all
</Directory>

<Directory /usr/share/phpMyAdmin/setup/lib/>
    Order Deny,Allow
     Deny from none
    Allow from all
</Directory>

<Directory /usr/share/phpMyAdmin/setup/frames/>
    Order Deny,Allow
     Deny from none
    Allow from all
</Directory>

# This configuration prevents mod_security at phpMyAdmin directories from
# filtering SQL etc.  This may break your mod_security implementation.
#
#<IfModule mod_security.c>
#    <Directory /usr/share/phpMyAdmin/>
#        SecRuleInheritance Off
#    </Directory>
#</IfModule>
Reply
#12

reset your configuration to the following and replace YOURIP with your actual IP and don't change anything else and let's see if it works and PLEASE don't let everyone have access to your /setup folders.

Quote:

# phpMyAdmin - Web based MySQL browser written in php
#
# Allows only localhost by default
#
# But allowing phpMyAdmin to anyone other than localhost should be considered
# dangerous unless properly secured by SSL

Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin

<Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF-8

<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require ip 127.0.0.1
Require ip ::1
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from YOURIP
</IfModule>
</Directory>

<Directory /usr/share/phpMyAdmin/setup/>
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require ip 127.0.0.1
Require ip ::1
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from ::1
</IfModule>
</Directory>

# These directories do not require access over HTTP - taken from the original
# phpMyAdmin upstream tarball
#
<Directory /usr/share/phpMyAdmin/libraries/>
Order Deny,Allow
Deny from All
Allow from None
</Directory>

<Directory /usr/share/phpMyAdmin/setup/lib/>
Order Deny,Allow
Deny from All
Allow from None
</Directory>

<Directory /usr/share/phpMyAdmin/setup/frames/>
Order Deny,Allow
Deny from All
Allow from None
</Directory>

# This configuration prevents mod_security at phpMyAdmin directories from
# filtering SQL etc. This may break your mod_security implementation.
#
#<IfModule mod_security.c>
# <Directory /usr/share/phpMyAdmin/>
# SecRuleInheritance Off
# </Directory>
#</IfModule>
Once you replace it with that restart your apache and also as I stated please make sure you can view your Default CentOS page from http://your_vps_ip
Reply
#13

"You don't have permissions ....." and shit now :/
Reply
#14

Quote:
Originally Posted by biker122
View Post
"You don't have permissions ....." and shit now :/
This is on your default page as well?
Reply
#15

Nah, I'm able to see the Apache 2.0's default page but can't access ip/phpmyadmin section.
Reply
#16

Did you restart httpd (apache) for every changes you did to the config files? Check your /var/log/httpd to see if there's any clue regarding this issue.. probably SELinux isn't disabled in your server?
Reply
#17

Quote:
Originally Posted by biker122
View Post
Nah, I'm able to see the Apache 2.0's default page but can't access ip/phpmyadmin section.
Sounds quite weird than your Apache is fine if you're restarting your Apache than your permissions should change fine. I'd remove phpmyadmin and attempt reinstalling it.
Reply
#18

Try to add this in the bottom of apache2.conf/httpd.conf file. (If you haven't already)

Code:
Include /etc/phpmyadmin/apache.conf
or

Code:
Include /etc/phpmyadmin/lighttpd.conf
Depending on what you use.

Then restart apache/httpd, it should work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)