XAMPP + OSX + Virtualhosts + change user in httpd.conf = phpmyadmin create database not working - mysql

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 back to:
User nobody
Group nobody
then phpmyadmin works fine, but my virtualhost directory cannot be accessed due to permission issue.
I assume I somehow have to tell apache to not use the new user for mysql access somehow? Your help is appreciated. Thanks

See item 2.8 from phpMyAdmin FAQ (http://wiki.phpmyadmin.net/pma/FAQ_2.8)
In the php.ini directive session.save_path and upload_tmp_dir, if these directories don't exist, are read-only or not accessable (f.e.
due to base_dir restrictions) this error will occur. See trk
PHP installed from a packages (eg. an rpm) might set the permissions on these directories for an assumed user (eg. 'apache'). -
Users of other web servers, eg Lighttpd, may need to change the
ownership of these directories (eg. to 'lighttpd').
On Windows, if PHP is using directories for session.save_path and upload_tmp_dir that are somewhere within the main "Temp"
directory, you must create those directories yourself; unlike other
Windows programs PHP will not create them itself.
If you are using Hardened-PHP (/suhosin patch) with the ini directive varfilter.max_request_variables set to the default (200) or
another low value, you could get this error if your table has a high
number of columns. Adjust this setting accordingly ( request limits,
thanks to Klaus Dorninger for the hint).
In config.inc.php, try to leave the $cfg['PmaAbsoluteUri'] directive empty. See also FAQ 4.7.
Maybe you have a broken PHP installation or you need to upgrade your Zend Optimizer. See http://bugs.php.net/31134.
In the php.ini directive arg_separator.input, a value of ";" will cause this error. Replace it with "&;".
(tip from https://serverfault.com/questions/385465/phpmyadmin-missing-parameter)

Related

Forbidden Error When Running WP Theme in MAMP PRO

I cloned a private repository for a WordPress theme. The repository includes a wp-content folder (plus five other files - .png's, an .ico, and an .md). I'm trying to run the contents of this repository - the WordPress theme - locally on my Mac using MAMP PRO.
Running the repository should look like this: http://dynamic.switzercreative.com/
But I'm getting this:
In MAMP PRO, I have Apache and MySQL running:
You can also see that MySQL is configured to use port 8889.
Going into phpMyAdmin --> Database Name (on the left side) --> Privileges
I make sure that the username matches what I have in the wp-config.php file, and it does (line 3):
define( 'DB_USER', 'database_username' );
I also notice that under privileges, 'Grant' is set to no for this username. I'm guessing I need to edit this?
Should I be editing username privileges - is that what's causing this error message?
EDIT: I went ahead and hit "edit privileges" and checked "grant" under administration. That made the username display "all privileges", just like the other usernames
But I'm still getting the forbidden error message when typing localhost:8888/theme_name_wpe into the URL.
EDIT 2: I also considered that this might be a permissions issue. I followed the instructions in the second answer of this article - I cd'd into homefolder/wp-content/themes and ran sudo chown -R username:groupname theme_name to hopefully give the theme its necessary permissions. I'm still getting the same result in the browser, though.
EDIT 3: After checking the error log, I saw that the error message said:
Failed to load resource: the server responded with a status of 403 (Forbidden)
That led me to this article. Following the instructions in the top-rated answer, I cd'd into the root directory (the folder 'dynamictransit_wpe' that's sitting on my Desktop) and ran the following commands:
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
I'm still getting the same error, but the error message looks different now - like this:
Was I supposed to cd into the theme folder? (dynamictransit_wpe --> wp-content --> themes --> theme)
EDIT 4: After googling '403 forbidden httpd - t', I found this article, which suggests that I need to edit the httpd.conf file. At line 150 in the file, I found:
User #-1
Group #-1
I thought that I would need to change these to match the Database username / group name, but these changes this yielded no effect. I also tried a variety of other User and Group possibilities, including setting User to the Username for my Mac - still nothing.
A 403 means that something about the server's configuration is blocking your access to that particular file. In your case, since you are trying to access the site, the file is going to be index.php
From everything I can see in your documentation above, you already have WP installed correctly and the only potential problems I see are:
MAMP may not be running it's own Apache server. I say MAY because I don't have enough information to make that determination but it is a possibility.
Your Apache configuration forbids access to your web root. Did you create a folder specifically for this app in MAMP? If so, make sure that the root folder has 755 permissions and is owned by the web server's user and group.
Check your httpd.conf file and make sure that AllowOverride is set to All.
Ensure you don't have a funky .htaccess file somewhere that is blocking access to your site. When in doubt, rename the file to something like htaccess.txt and see if your site loads.
I'm not exactly sure which one of these adjustments caused it to work, but now going to "localhost/" renders the website:
1.) Changed username and password in wp-config.php to "root", like this:
define( 'DB_USER', 'root' );
define( 'DB_PASSWORD', 'root' );
(MAMP / MAMP PRO automatically sets "root" as the username and password for a database, so make sure that they are set correctly)
2.) Also make sure that the database name, host, home, and siteurl match:
define( 'DB_NAME', 'dynamic_transit' );
define( 'DB_HOST', 'localhost' );
define('WP_HOME','http://dynamic');
define('WP_SITEURL', 'http://dynamic');
3.) Make sure that the host name is set to localhost:
4.) Create an .htaccess file within your root folder (the folder that contains wp-content, wp-admin, and wp-includes. Leave that file blank.
5.) Make sure the username for Ports --> "Run Servers As:" is set to the username for your computer:
6.) Restart servers and go to localhost/ in the URL. If it's a WordPress site you should be able to go to localhost/wp-admin and enter your WordPress username and password to login.

Have index.html file but still getting a directory listing

I have an index.html file in my Apache DocumentRoot directory but when I go to my URL, I am still getting a directory listing of my DocumentRoot directory instead of the index.html file being displayed. The apache access_log shows 200's when I reload the page. Any suggestions?
Use
DirectoryIndex index.html
It tells apache what document to show for a directory request.
update
You should specify just the filename that apache will look for in the folder requested.
Not saying this will fix it for you, but for me when first getting started with Apache2 it was file permissions that would get forgotten when moving or writing new file under the web root directory
ls -hal /var/www/host_one/index.html
If above doesn't have read (r) permissions for the same user:group or if the ownership doesn't include the user/group of the web server, then try the following for allowing group reads
# Modify ownership, change 'www_host' to Apache2 group
chown ${USER}:www_host /var/www/host_one/index.html
# give read+write (6) to user and read (4) to group owners
chmod 640 /var/www/host_one/index.html
Try refreshing the website and see if permissions where the issue. Note most web documents only require read permissions and ownership to be correct for browsers to be allowed to pick them up for rendering, on rare occasions you may need executable (1 or x) permissions for server scripts (be cautious of ownership in such cases) and last write permissions (2 or w) should likely never be seen without good reasons on files within your web root.
Second thing to try, use the index.html within your browsers URL bar
# by IP
http://192.168.0.100/index.html
# by domain
http://site-name.local/index.html
If the above loaded your document then, like #Pekka 웃 stated already, you've likely got a server option that's missing or enabling directory listings instead of looking for a index page within that directory. If this is the problem then there's two ways of fixing it that I've tried in the past. One, htaccess configuration to disable directory listing within that sub-directory, two, server vhost configuration to prevent whole site from directory listings. Personally I prefer to use option two and then on directories that should be allowed to be listed place an htaccess config for permissions instead of denials.

can't access wamp projects online

A lot of similar questions to mine,, but really none addresses my issue!
I installed Wamp on a pc (win 7) connected to internet and i gave it a real IP (78.10*..) in which i can access it anywhere.
i did the following:
changes in httpd & phpmyadmin,, (deny all replaced with allow all) (server name "localhost:80" replaced with my public ip 78.10*..:80) ( denied replaced with granted) (added ::1)
changes in phpsysinfo, sqlbuddy,webgrin (requier local host removed ,, deny from all replaced with allow from all)
-put wamp online from its icon
-firewall is turned off
-full permission granted on local hard C and put on shared too
when i request 78.10*.. on another computer (not in my LAN) the wamp index previewed and i can access Tools(phpinfo, phpmyadminn) & Your Aliases(phpmyadmin, phpsysinfo, sqlbuddy, webgrin) but i can't access my project which located in the www directory
when i press on project named "m" a redirect page previewed and redirected me to page named localhost and says page not available, if i did same thing on my server the redirected page redirect me to localhost and i can access my project
any help will be appreciated
Thanks in advice
Change (wwwroot='localhost') to 78.10*.***.*** in your "Config.php" inside your Moodle folder.
To make your moodle folder your root directory, do the following:
You will have to edit two things inside of the httpd.conf file /wamp/apache2/conf/httd.conf find:
DocumentRoot "/wamp/www"
change to
DocumentRoot "your_moodle_folder"
then find:
<Directory "wamp/www">
change to
<Directory "your_moodle_folder">
Save it and restart apache.

Can't seem to get ACL to work with hgweb.wsgi

I have hgweb.wsgi setup on an ubuntu server under apache2. Furthermore I have basic authing using the apache2 htpasswd approach. This all works nicely. However, we want to control what each user have access to and ACL seems to be the best approach. So inside the repos .hg folder I've created a hgrc and modified it according to the documentation for getting ACL up and running ( I've also enabled the extension ). The problem is I get no indication that the hgrc is used at all. If I add [ui] debug = true I still get nothing from the remote client. Sadly I'm not quite sure how to go about debugging this so any help would be much appreciated.
To make sure that a .hg/hgrc file in a repository is being consulted add something noticable to the [web] section like:
[web]
description = Got this from the hgrc
style = coal
name = RENAMED
If you don't see those in the web interface your .hg/hgrc isn't being consulted, and the most common reason for that is -- permissions. Remember that the .hg/hgrc has to owned by a user or group that is trusted by the webserver user (usually apache or www-data or similar). If apache is running under the user apache then chown the .hg/hgrc file over to apache for ownership -- root won't do and htpasswd user is irrelevant.
If that file is being consulted then you need to start poking around in the apache error logs. Turning on debug and verbose will put more messages into the apache error log, not into the remote client's output.

RabbitMQ database files

I'm running RabbitMQ V.2.0.0. on a Linux machine. The mnesia base is current the default, but the within that directory Rabbit creates directories, eg. rabbit#ip-123.1.1.123.
The ip in the directory name is based on the inet addr of the machine. This directories hold information about user, exchanges, vhost (I think).
My question is, how can I fix/config these directory names with ip to be not based on ip?
To change the Mnesia directory, just set MNESIA_DIR in /etc/rabbitmq/rabbitmq.conf.
Also, a great place to ask RabbitMQ related questions is on the rabbitmq-discuss mailing list.
It seems you can edit the scripts files (rabbitmq-server, rabbitmq-mulit and rabbitmqcti). In these scripts at the top is a hostname variable.
I set the hostname to localhost and restarted.
This is not the best, but good enough for my requirements. The hostname must be a proper address, it cannot be something arbitrary.
The main problem is that your new machine has new hostname - and directory is named after it (just renaming directory as mentioned before, does not help) so we need to rename your machine hostname and make RabbitMq to work with old files.
Let "ip-0-0-0-0" be old machine name (so there should be a mnesia folder /var/lib/rabbitmq/mnsesia/ip-0-0-0-0), and new machine host
name is something like "ip-1-1-1-1", but new name doesnot matter as we will overwrite it. Execute following commands:
sudo -s
echo "127.0.0.1 ip-0-0-0-0" >> /etc/hosts
echo "ip-0-0-0-0" > /etc/hostname
reboot
After reboot your machine will have a new name and RabbitMq should work with old files.