virtualhost - phpmyadmin not working

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

virtualhost - phpmyadmin not working

Postby careykwong » 16. February 2012 10:03

please help ! I have installed xampp on mac and I have used the virtual host to host 2 domains.
after the virtual host setup, I cannot acccess phpmyadmin
I got this error
MySQL said: Documentation
#1045 - Access denied for user 'root'@'localhost' (using password: NO)

I access this on my localhost machine
http://localhost/phpmyadmin/

<VirtualHost *:80>
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs"
ServerName localhost
ErrorLog "logs/localhost.com-error_log"
CustomLog "logs/localhost.com-access_log" common
</VirtualHost>



<VirtualHost *:80>
ServerAdmin info@vio-style.com
DocumentRoot "/Applications/XAMPP/xamppfiles/vio-style"
ServerName vio-style.com
ServerAlias www.vio-style.com
ErrorLog "logs/vio-style.com-error_log"
CustomLog "logs/vio-style.com-access_log" common
</VirtualHost>


<VirtualHost *:80>
ServerAdmin info@hk-ict.com
DocumentRoot "/Applications/XAMPP/xamppfiles/hk-ict"
ServerName hk-ict.com
ServerAlias www.hk-ict.com
ErrorLog "logs/hk-ict.com-error_log"
CustomLog "logs/hk-ict.com-access_log" common
</VirtualHost>
careykwong
 
Posts: 2
Joined: 16. February 2012 09:42
XAMPP Version: 1.8.3-2
Operating System: mac

Re: virtualhost - phpmyadmin not working

Postby JonB » 17. February 2012 02:01

Did it work before you created your virtual hosts???
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
XAMPP Version: 1.8.3-2
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: virtualhost - phpmyadmin not working

Postby johowie » 08. July 2012 05:08

Have you had any luck with this. I have a similar prblem. I just posted a similar question on stackoverflow, and still dont have an answer.
Heres a link to the stack overflow Queston: http://stackoverflow.com/questions/11372079/xampp-osx-virtualhosts-change-user-in-httpd-conf-phpmyadmin-create-datab
And here is that question copy and pasted here again:
I have installed XAMPP on OSX Lion. Because I want to serve a folder from one of my development folders I have added a virtualhost to /Applications/XAMPP/xamppfiles/etc/extra/httpd-vhosts.conf

<VirtualHost *:80>
ServerAdmin email@gmail.com
DocumentRoot "/Users/myosxUsername/Documents/dir/dir/htdocs"
ServerName qmh
ErrorLog "logs/qmh-error_log"
CustomLog "logs/qmh-access_log" common
</VirtualHost>

and also added an entry to the hosts file:

127.0.0.1 qmh


Because of permission issue with the server accessing the directory /Users/myosxUsername/Documents/dir/dir/htdocs I have also changed the user in httpd.conf to my myosxUsername:

User myosxusername
Group admin
# previous setting below
# User nobody
# Group nobody


After those changes virtual hosts work fine. The problem is that when i now use phpmyadmin to create a new database i get the error message

db_create.php: Missing parameter: new_db

if I change the user in xampp's httpd.config back to:

User nobody
Group nobody

then phpmyadmin works fine, but my virtualhost directory cannot be accessed due to permission issue.

Not sure what to do here to make bot virtualsots and phpmyadmin work
johowie
 
Posts: 1
Joined: 08. July 2012 05:00
XAMPP Version: 1.8.3-2
Operating System: OSX Lion 10.7.4

Re: virtualhost - phpmyadmin not working

Postby JonB » 09. July 2012 16:13

You need to make the ownership of your vhosts folder the same as your other xampp/mampp folders - such as the phpmyadmin folder.
(and not change the ownership in httpd.conf)

The Apache process owner generally should own the files in any DocumentRoot, Vhost(s) or Aliases. In theory you could also create a group to accomplish the same, but you might also have to change some permissions. The thing is that files in any 'webviewable' folders - must be 'world-readable'. That is the owner,owners primary group, and 'others' must all have Read permissions. Thus the prevalence of 755 (folders)/644 (files) permissions in Apache servers.
The local OS doesn't care much about Apache, so when the Apache process locally (as a user) goes to read a file - the easiest way to ensure there won't be an issue is to make the Apache process user the owner of the file. Alternatively, the Apache user's primary group could also be the owner.
http://www.onlineconversion.com/html_ch ... ulator.htm

XAMPP is not a typical installation of a 'LAMP' for Mac, its a script, so many things are 'pre-set' and difficult to fix if you don't know what they are doing.

BTW - 'nobody' is a reserved/special user on Linux/Unix systems.
http://unix.stackexchange.com/questions ... ps-purpose

Google 'Apache ownership and permissions' for many links on this topic.

Remembering that MacOS is really Unix - this was the best write-up I could find to explain things -
http://www.linuxhomenetworking.com/wiki ... Web_Server

Good Luck
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
XAMPP Version: 1.8.3-2
Operating System: Windows XP/7 - Fedora 15 1.7.7


Return to XAMPP for Mac OS X

Who is online

Users browsing this forum: No registered users and 9 guests