Can’t enable mod_rewrite in XAMPP 1.8.3 – results in 404 errors

I just installed XAMPP 1.8.3 on a Mac. I'm having a hard time getting mod_rewrite to work properly. It seems to load fine as confirmed with the phpinfo() function, but a script requiring it just won't redirect properly.

I've confirmed

LoadModule rewrite_module modules/mod_rewrite.so

is uncommented, and have changed all instances of

AllowOverride to all

in my xamppfiles/etc/httpd.conf file.

What am I missing?

Vagrant chicken-and-egg: Shared folder with uid = apache user

My Vagrant box is build from a base linux (scientific linux), during provisioning (using shell scripts), Apache is installed.

I recently changed the Vagrant file (v2) to:

config.vm.synced_folder "public", "/var/www/sites.d/example.com",
   :owner => "apache", :group => "apache"

Which works well if the box is already provisioned and just rebooted.

Now, after a vagrant destroy && vagrant up I get the error:

mount -t vboxsf -o uid=`id -u apache`,gid=`id -g apache` 
   /var/www/sites.d/example.com /var/www/sites.d/example.com
id: apache: User does not exist

Which is clear - as during the initial run, apache is not yet installed.

An ugly workaround would of course be to do the basic provisioning with that synced_folder commented out, comment it in and then reboot.

Is there any clean trick to solve that? Especially in a way that vagrant up always runs without interruptions, even if the box is new.

Connection Error in Apache Pig

I am running Apache Pig .11.1 with Hadoop 2.0.5.

Most simple jobs that I run in Pig work perfectly fine.

However, whenever I try to use GROUP BY on a large dataset, or the LIMIT operator, I get these connection errors:

2013-07-29 13:24:08,591 [main] INFO  org.apache.hadoop.mapred.ClientServiceDelegate - Application state is completed. FinalApplicationStatus=SUCCEEDED. Redirecting to job history server 
013-07-29 11:57:29,421 [main] INFO  org.apache.hadoop.ipc.Client - Retrying connect to server: 0.0.0.0/0.0.0.0:10020. Already tried 0 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)

2013-07-29 11:57:30,421 [main] INFO  org.apache.hadoop.ipc.Client - Retrying connect to server: 0.0.0.0/0.0.0.0:10020. Already tried 1 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)

2013-07-29 11:57:31,422 [main] INFO  org.apache.hadoop.ipc.Client - Retrying connect to server: 0.0.0.0/0.0.0.0:10020. Already tried 2 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
...
2013-07-29 13:24:18,597 [main] INFO  org.apache.hadoop.ipc.Client - Retrying connect to server: 0.0.0.0/0.0.0.0:10020. Already tried 9 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
2013-07-29 13:24:18,598 [main] ERROR org.apache.hadoop.security.UserGroupInformation - PriviledgedActionException as:gpadmin (auth:SIMPLE) cause:java.io.IOException

The strange thing is that after these errors keeping appearing for about 2 minutes, they'll stop, and the correct output shows up at the bottom.

So Hadoop is running fine and computing the proper output. The problem is just these connection errors that keep popping up.

The LIMIT operator always gets this error. It happens on both MapReduce mode and local mode. The GROUP BY operator will work fine on small datasets.

One thing that I have noticed is that whenever this error appears, the job had created and ran multiple JAR files during the job. However, after a few minutes of these message popping up, the correct output finally appears.

Any suggestions on how to get rid of these messages?

Gitlab in a subdirectory with apache and passenger

I'm attempting to set up gitlab so that it is accessible through a subdirectory of an existing apache server, example.com/gitlab, for example. I am trying to use passenger, as this seems to be the easiest to set up, but other solutions would also be acceptable. Using a separate virtual host for gitlab is unfortunately not an option for me.

My Setup

In setting this up, I have followed the gitlab setup guide and the passenger documentation.

I believe the most relevant parts of /etc/httpd/conf/httpd.conf are the following:

DocumentRoot "/home/.www"

# gitlab config
RackBaseURI /gitlab
<Directory "/home/.www/gitlab">
    Options -MultiViews
</Directory>

The DocumentRoot of apache contains a symlink to the gitlab public directory:

$ ls -l /home/.www
lrwxrwxrwx  1 root  http    23 Jul 29 12:35 gitlab -> ../gitlab/gitlab/public

Passenger was installed using the passenger-install-apache2-module script, and the config lines output by the script are included in the apache config.

I have played with the relative_url_root in config/gitlab.yml; that did not have any effect (judging from the the comments in the file, this mechanism seems to be discouraged or deprecated---it would be nice to avoid it).

Results

When accessing example.com/gitlab, I get the following output (a plain text document):

Not Found: /

Apache's logs indicate that passenger has started, but that at least favicon.ico is being requested from the document root, when it should be be requested from the subdirectory as /gitlab/favicon.ico:

[ 2013-07-29 14:14:12.1029 2037/7f3502e1e740 agents/HelperAgent/Main.cpp:597 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.2033/generation-0/request
[ 2013-07-29 14:14:12.1150 2043/7fa24dbf3740 agents/LoggingAgent/Main.cpp:330 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.2033/generation-0/logging
[ 2013-07-29 14:14:12.1154 2034/7ff20a0cb740 agents/Watchdog/Main.cpp:635 ]: All Phusion Passenger agents started!
[Mon Jul 29 14:14:12 2013] [notice] Digest: generating secret for digest authentication ...
[Mon Jul 29 14:14:12 2013] [notice] Digest: done
[ 2013-07-29 14:14:13.0297 2057/7f5380ee3740 agents/Watchdog/Main.cpp:452 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nobody', 'default_python' => 'python', 'default_ruby' => '/usr/bin/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_instances_per_app' => '0', 'max_pool_size' => '6', 'passenger_root' => '/usr/lib/ruby/gems/2.0.0/gems/passenger-4.0.10', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_pid' => '2055', 'web_server_type' => 'apache', 'web_server_worker_gid' => '33', 'web_server_worker_uid' => '33' }
[ 2013-07-29 14:14:13.0367 2061/7f92eefef740 agents/HelperAgent/Main.cpp:597 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.2055/generation-0/request
[ 2013-07-29 14:14:13.0485 2067/7f4cc5205740 agents/LoggingAgent/Main.cpp:330 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.2055/generation-0/logging
[ 2013-07-29 14:14:13.0490 2057/7f5380ee3740 agents/Watchdog/Main.cpp:635 ]: All Phusion Passenger agents started!
[Mon Jul 29 14:14:13 2013] [notice] Apache/2.2.25 (Unix) mod_ssl/2.2.25 OpenSSL/1.0.1e DAV/2 Phusion_Passenger/4.0.10 configured -- resuming normal operations
[ 2013-07-29 14:14:16.8354 2061/7f92eef2a700 Pool2/Spawner.h:738 ]: [App 2096 stdout] 
[ 2013-07-29 14:14:24.8814 2061/7f92eef2a700 Pool2/SmartSpawner.h:301 ]: Preloader for /home/.www/../gitlab/gitlab started on PID 2096, listening on unix:/tmp/passenger.1.0.2055/generation-0/backends/preloader.2096
[Mon Jul 29 14:14:25 2013] [error] [client 129.241.220.221] File does not exist: /home/.www/favicon.ico

It seems to me that it should not be necessary to start any puma server or similar, so I have not run any bundle exec rake ... commands to start anything rails-related when generating the logs above (I have tried that but I'm not including the output here as it seems identical to me).

Does anyone see what I am doing wrong?

Git hooks doesn’t work on remote repository

I have a remote Git bare repository hosted on Ubuntu Linux virtual machine with Apache on it and accessible over http in local network. When I configured my server I used this manual: http://blog.bobbyallen.me/2012/07/23/installing-a-git-server-using-apache-webdav-on-ubuntu-server-12-04/

I intend to propagate this repository to my website (wich have non-bare repository), while Ubuntu has access to it's directory over a Samba share.

So, have something like this:

|my PC| ==push==> |http://[email protected]/myproject.git| ==(post-receive hook)==> |/samba/mywebsite/|

My thought was to write a post-receive hook which will do something like that when I push changes from my IDE (PhpStorm):

#!/bin/sh
echo "Pulling content from hub to website"
echo "Pulling content from hub to website" >> /tmp/git.log
cd /samba/mywebsite/ || exit
unset GIT_DIR
git pull hub master

cd /var/www/myproject.git
git update-server-info

Of course, before that I declared inside my website repository:

git remote add hub /var/www/myproject.git

The problem is that my post-receive hook doesn't run when I perform push from my IDE: I do not see any result of written in first to lines with echoes (nor in IDE log, nor in /tmp/git.log file). Note, that push itself performs successfully.

In fact, the problem is much deeper: hooks doesn't launch at all. I tried post-receive, update and post-update hooks, but nothing... I placed line like "echo 111>>/tmp/git.log" in every one of them, but nothing happens.

Furthermore, when I try to launch one these hooks manualy, everything works fine and webside recevies updates:

sudo -u www-data ./post-receive

Of course, I do have read/write/execute permitions for user www-data, and also www-data owns everything in /var/www directory. Actually, I set 0777 permissions for all content in that directory.

I tried to perform git push origin manually and from IDE - same result. I tried even to use !#/bin/sh and !#/bin/bash - no effect.

UPD:

I performed this on my server:

cd ~
git clone /var/www/myproject.git
cd myproject
echo "newline">>README.txt
commit -a -m "Test commit"
git push origin

And miracle happend - it worked! I saw answer from the main repo and hooks did perfomed in this order: update, post-receive, post-update.

So, I assume, I have some problem with pushing changes over http. But I have no idea why does it so.