Mercurial-Bugzilla-Hook only works once - mercurial

In order to integrate our Mercurial repository and our bug tracker (Bugzilla 4.0.1), I have set up the server-side hgrc file like this:
[extensions]
hgext.bugzilla=
[hooks]
incoming.bugzilla=python:hgext.bugzilla.hook
[bugzilla]
bzurl=http://localhost/bugzilla
user=some.user#this.domain
password=password
version=xmlrpc
hgweb=http://this-server:65432/
template=Changeset {node|short} in {root|basename}.\nDetails siehe {hgweb}{webroot}?cmd=changeset;node={node|short}\nBeschreibung:\n\t{desc|tabindent}
[usermap]
committer_email=bugzilla_user_name
[web]
push_ssl=False
allow_push=*
baseurl=http://this-server:65432
Mercurial is set to serve on this-server, port 65432.
Now, after starting hg serve, the very first push will be handled just fine. All bug references found in the commit messages will generate Bugzilla comments. But on every subsequent push with at least one bug reference present, the following error message is presented to the user:
pushing to http://this-server:65432/
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 1 changes to 1 files
remote: error: incoming.bugzilla hook failed: Bugzilla error:
On several occasions, this message has been observed:
remote: error: incoming.bugzilla hook failed: Bugzilla error: [Errno 54] Connection reset by peer
No comments are created in bugzilla. Restarting hg will make it work exactly once again.
I have also tried starting the Mercurial server with arguments -A ... -E ... to have it create access and error logs. The access log shows the same kind of interaction for every request, regardless if successful or not:
192.168.117.78 - - [20/Feb/2013 10:19:03] "GET /?cmd=capabilities HTTP/1.1" 200 -
192.168.117.78 - - [20/Feb/2013 10:19:03] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3Dc3ee38280c255a62c2742304622d8fcf29959863+b8cbc9948834a83b9a8f6dd9f1b96d5f39224324+54f5e40379910d6026b8656fe0982bb5b7e9e22b
192.168.117.78 - - [20/Feb/2013 10:19:03] "GET /?cmd=branchmap HTTP/1.1" 200 -
192.168.117.78 - - [20/Feb/2013 10:19:03] "GET /?cmd=branchmap HTTP/1.1" 200 -
192.168.117.78 - - [20/Feb/2013 10:19:04] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks
192.168.117.78 - - [20/Feb/2013 10:19:09] "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=686173686564+be8d19f7ab04e73ad36715ec876b4dd74384a920
192.168.117.78 - - [20/Feb/2013 10:19:09] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases
192.168.117.78 - - [20/Feb/2013 10:19:09] "POST /?cmd=pushkey HTTP/1.1" 200 - x-hgarg-1:key=54f5e40379910d6026b8656fe0982bb5b7e9e22b&namespace=phases&new=0&old=1
192.168.117.78 - - [20/Feb/2013 10:19:10] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks
192.168.117.78 - - [20/Feb/2013 10:20:04] "GET /?cmd=capabilities HTTP/1.1" 200 -
192.168.117.78 - - [20/Feb/2013 10:20:05] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3Dc3ee38280c255a62c2742304622d8fcf29959863+b8cbc9948834a83b9a8f6dd9f1b96d5f39224324+7fbb4c09e39db549ed01532785e80eda480e8862
192.168.117.78 - - [20/Feb/2013 10:20:05] "GET /?cmd=branchmap HTTP/1.1" 200 -
192.168.117.78 - - [20/Feb/2013 10:20:05] "GET /?cmd=branchmap HTTP/1.1" 200 -
192.168.117.78 - - [20/Feb/2013 10:20:05] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks
192.168.117.78 - - [20/Feb/2013 10:20:05] "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=686173686564+f71bb72e20c8f91b9d0ca3b5fbdef2aac667c265
192.168.117.78 - - [20/Feb/2013 10:20:05] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases
192.168.117.78 - - [20/Feb/2013 10:20:06] "POST /?cmd=pushkey HTTP/1.1" 200 - x-hgarg-1:key=7fbb4c09e39db549ed01532785e80eda480e8862&namespace=phases&new=0&old=1
192.168.117.78 - - [20/Feb/2013 10:20:06] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks
The error log is empty.
How can I further diagnose this issue?

The hg serve invocation is not for long term use. It's for "hey, clone this thing I started on" between buddies on a LAN. From the Mercurial wiki
It is not really recommended except for temporary situations where you need to publish a repository for a few minutes, for example to pull changes from a laptop.
I suspect if you spin up a real wsgi container things will work. I've not used the bugzilla hook, but I'm guessing it's not cleaning up after itself since it's expects to be in a wsgi container or command line invocation that gets cleared away.

Related

Communication Wordpress inside Kubernetes and external MySQL server. - MySQL Connection Error: (2002)

In Azure cloud, I have the following infrastructure:
A Vnet with two subnets in.
Vnet: 10.0.0.0/8
aks-subnet: 10.240.0.0/16
persistence-subnet: 10.241.0.0/27
An Azure Kubernetes cluster was installed and associated to the aks-subnet.
In the persistence-subnet a managed Azure Database for MySQL paas, is deployed and associated to it.
The persistence-subnet has two service endpoints: Microsoft.Sql and Microsoft.Storage
The aks-subnet has the Microsoft.Sql service endpoint
The Azure Kubernetes cluster was deployed using the Azure CNI network profile so, every pod get an ip address belonging to the aks-subnet. Also I decided to choose Azure CNI,because I need to to communicate the pods inside aks-subnet with the MySQL managed service.
In the managed Azure Database for MySQL paas service I have whitelisted the aks-subnet ip address range, in order to allow to the pods inside aks-subnet access to the MySQL service.
"StartIpAddress": "10.240.0.0",
"EndIpAddress": "10.240.255.255"
In the AKS cluster, I am using helm3 to deploy the Wordpress helm chart, with this command
helm3 install wordpress-site-1 stable/wordpress --set image.registry=myregistry.azurecr.io,image.repository=wordpress,image.tag=5.2.4,image.pullPolicy=Always,wordpressUsername=site1,wordpressPassword=my-password,wordpressEmail=my#gmail.com,mariadb.enabled=false,externalDatabase.host=database-db.mysql.database.azure.com,externalDatabase.user=user#wdatabase-db,externalDatabase.password=my-password,externalDatabase.database=wordpress-site-1,externalDatabase.port=3306
NAME: wordpress-site-1
LAST DEPLOYED: Tue Oct 29 13:24:03 2019
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
1. Get the WordPress URL:
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
Watch the status with: 'kubectl get svc --namespace default -w wordpress-site-1'
export SERVICE_IP=$(kubectl get svc --namespace default wordpress-site-1 --template "{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}")
echo "WordPress URL: http://$SERVICE_IP/"
echo "WordPress Admin URL: http://$SERVICE_IP/admin"
2. Login with the following credentials to see your blog
echo Username: site1
echo Password: $(kubectl get secret --namespace default wordpress-site-1 -o jsonpath="{.data.wordpress-password}" | base64 --decode)
The deployment is running, but when I check the wordpress pod logs, I got this error message:
MySQL Connection Error: (2002) php_network_getaddresses: getaddrinfo failed: Name or service not known
[29-Oct-2019 13:01:13 UTC] PHP Warning: mysqli::__construct(): php_network_getaddresses: getaddrinfo failed: Name or service not known in Standard input code on line 22
[29-Oct-2019 13:01:13 UTC] PHP Warning: mysqli::__construct(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: Name or service not known in Standard input code on line 22
MySQL Connection Error: (2002) php_network_getaddresses: getaddrinfo failed: Name or service not known
WARNING: unable to establish a database connection to 'mysql'
continuing anyways (which might have unexpected results)
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.240.0.36. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.240.0.36. Set the 'ServerName' directive globally to suppress this message
[Tue Oct 29 13:01:14.027023 2019] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.38 (Debian) PHP/7.3.11 configured -- resuming normal operations
[Tue Oct 29 13:01:14.027099 2019] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
10.240.0.4 - - [29/Oct/2019:13:01:22 +0000] "GET /wp-login.php HTTP/1.1" 500 3003 "-" "kube-probe/1.14"
10.240.0.4 - - [29/Oct/2019:13:01:32 +0000] "GET /wp-login.php HTTP/1.1" 500 3003 "-" "kube-probe/1.14"
10.240.0.4 - - [29/Oct/2019:13:01:42 +0000] "GET /wp-login.php HTTP/1.1" 500 3003 "-" "kube-probe/1.14"
Looks like the wordpress pod, located inside aks-subnet is not able to reach the MySQL service, located in the persistence-subnet, despite I am providing it via helm install command the correct parameters.
It's weird, the pods has access to Internet, and also I have been checking of a careful way the rules and permissions to allow that communication.
Is there something that I am unknowing?
How can I reach the MySQL database from the Wordpress service deployed inside the Aks cluster?
UPDATE:
Before to deploy Wordpress with helm install command, I've created the docker registry secret pointing to Azure Container Registry data, of a manual way:
kubectl create secret docker-registry regcred --docker-server=my-registry.azurecr.io --docker-username=my-username --docker-password=my-password --docker-email=my-email#outlook.com
I referenced that regcred in my local helm chart in the deployment.yaml and I deployed Wordpress using the helm install command and looks like it works, or at least MySQL is not causing problems.
Just the ServerName Apache directive, because I don't have any hostname yet involved in my deploymnet process, not yet.
⟩ kubectl logs pod/wordpress-site-1-7f44b567d6-2949w -f
WordPress not found in /var/www/html - copying now...
Complete! WordPress has been successfully copied to /var/www/html
### APACHE SERVERNAME WARNING
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.240.0.103. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.240.0.103. Set the 'ServerName' directive globally to suppress this message
#####
[Tue Oct 29 16:13:16.327549 2019] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.38 (Debian) PHP/7.3.11 configured -- resuming normal operations
[Tue Oct 29 16:13:16.327630 2019] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
10.240.0.4 - - [29/Oct/2019:16:13:18 +0000] "GET / HTTP/1.1" 302 255 "-" "kube-probe/1.14"
10.240.0.4 - - [29/Oct/2019:16:13:18 +0000] "GET /wp-admin/setup-config.php HTTP/1.1" 200 4289 "http://10.240.0.103:80/" "kube-probe/1.14"
10.240.0.4 - - [29/Oct/2019:16:13:28 +0000] "GET / HTTP/1.1" 302 255 "-" "kube-probe/1.14"
10.240.0.4 - - [29/Oct/2019:16:13:28 +0000] "GET /wp-admin/setup-config.php HTTP/1.1" 200 4289 "http://10.240.0.103:80/" "kube-probe/1.14"
10.240.0.4 - - [29/Oct/2019:16:13:38 +0000] "GET / HTTP/1.1" 302 255 "-" "kube-probe/1.14"
10.240.0.4 - - [29/Oct/2019:16:13:40 +0000] "GET / HTTP/1.1" 302 255 "-" "kube-probe/1.14"
10.240.0.4 - - [29/Oct/2019:16:13:40 +0000] "GET /wp-admin/setup-config.php HTTP/1.1" 200 4289 "http://10.240.0.103:80/" "kube-probe/1.14"
10.240.0.4 - - [29/Oct/2019:16:13:38 +0000] "GET /wp-admin/setup-config.php HTTP/1.1" 200 4289 "http://10.240.0.103:80/" "kube-probe/1.14"
10.240.0.4 - - [29/Oct/2019:16:13:48 +0000] "GET / HTTP/1.1" 302 255 "-" "kube-probe/1.14"
10.240.0.4 - - [29/Oct/2019:16:13:50 +0000] "GET / HTTP/1.1" 302 255 "-" "kube-probe/1.14"
10.240.0.4 - - [29/Oct/2019:16:13:50 +0000] "GET /wp-admin/setup-config.php HTTP/1.1" 200 4289 "http://10.240.0.103:80/" "kube-probe/1.14"
I understand that at this point nothing should happens with the database because we need to access to the Wordpress site via web and deploy the site, so is at that moment when the database tables will be created right?
So I did a port-forward operation from kubernetes:
⟩ kubectl port-forward pod/wordpress-site-1-7f44b567d6-2949w 8002:80
Forwarding from 127.0.0.1:8002 -> 80
Forwarding from [::1]:8002 -> 80
Handling connection for 8002
Handling connection for 8002
Handling connection for 8002
Handling connection for 8002
Handling connection for 8002
And when I go to http://localhost:8002/, the browser redirect to me to
http://localhost:8002/wp-admin/setup-config.php and I can see the wordpress wizard.
So I fill the data with my db name previously created in the database server
And when I submit the data in the wizard UI I got the following:
The message reference problems with the data connection
This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at wordpresssentiaassessment-db.mysql.database.azure.com. This could mean your host’s database server is down.
Are you sure you have the correct username and password?
Are you sure that you have typed the correct hostname?
Are you sure that the database server is running?
But maybe because from port-forward operation we cannot contact to the database from my local machine?
I mean, the process is not in able to do a reverse port forward to contact the database?
Do I need to expose the Wordpress service application to some domain and Ip public address in order to contact to the db and install Wordpresss?
So, I enter to the pod wordpress container to check wp-config.php
⟩ kubectl exec -it pod/wordpress-site-1-7f44b567d6-2949w /bin/sh
But the wp-config.php file does not exist,
# ls
index.php wp-activate.php wp-comments-post.php wp-cron.php wp-load.php wp-settings.php xmlrpc.php
license.txt wp-admin wp-config-sample.php wp-includes wp-login.php wp-signup.php
readme.html wp-blog-header.php wp-content wp-links-opml.php wp-mail.php wp-trackback.php
# cat wp-config.php
cat: wp-config.php: No such file or directory
I have a wp-config-sample.php and this is their content, but I cannot see anything about FQDN.
Or maybe do I need to do something in the wp-config.php, maybe rename the wp-config-sample.php to wp-config.php and add the variables injected in the pod in that file?
# nano wp-config-sample.php
<?php
/**
* The base configuration for WordPress
*
* The wp-config.php creation script uses this file during the
* installation. You don't have to use the web site, you can
* copy this file to "wp-config.php" and fill in the values.
*
* This file contains the following configurations:
*
* * MySQL settings
* * Secret keys
* * Database table prefix
* * ABSPATH
*
* #link https://codex.wordpress.org/Editing_wp-config.php
*
* #package WordPress
*/
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'database_name_here' );
/** MySQL database username */
define( 'DB_USER', 'username_here' );
/** MySQL database password */
define( 'DB_PASSWORD', 'password_here' );
/** MySQL hostname */
define( 'DB_HOST', 'localhost' );
/** Database Charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8' );
/** The Database Collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );
/**##+
* Authentication Unique Keys and Salts.
*
* Change these to different unique phrases!
* You can generate these using the {#link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
*
* #since 2.6.0
*/
define( 'AUTH_KEY', 'put your unique phrase here' );
define( 'SECURE_AUTH_KEY', 'put your unique phrase here' );
define( 'LOGGED_IN_KEY', 'put your unique phrase here' );
define( 'NONCE_KEY', 'put your unique phrase here' );
define( 'AUTH_SALT', 'put your unique phrase here' );
define( 'SECURE_AUTH_SALT', 'put your unique phrase here' );
define( 'LOGGED_IN_SALT', 'put your unique phrase here' );
define( 'NONCE_SALT', 'put your unique phrase here' );
/**##-*/
/**
* WordPress Database Table prefix.
*
* You can have multiple installations in one database if you give each
* a unique prefix. Only numbers, letters, and underscores please!
*/
$table_prefix = 'wp_';
/**
* For developers: WordPress debugging mode.
*
* Change this to true to enable the display of notices during development.
* It is strongly recommended that plugin and theme developers use WP_DEBUG
* in their development environments.
*
* For information on other constants that can be used for debugging,
* visit the Codex.
*
* #link https://codex.wordpress.org/Debugging_in_WordPress
*/
define( 'WP_DEBUG', false );
/* That's all, stop editing! Happy publishing. */
/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', dirname( __FILE__ ) . '/' );
}
/** Sets up WordPress vars and included files. */
require_once( ABSPATH . 'wp-settings.php' );
It looks as though the application is trying to perform a reverse lookup of the IP address you have specified, probably because it intends on using SSL to authenticate the remote server. PTR records to assist in reverse lookup will not be available with a standard configuration for an internal IP address.
Try using the FQDN for your MySQL instance instead of the IP address.
It should look something like this:
{yourservername}.mysql.database.azure.com
This way your application will not need to perform reverse lookup, and Azure will cater for the routing appropriately.
EDIT:
The following line indicated your application is trying to connect to host 'mysql':
WARNING: unable to establish a database connection to 'mysql'
Check the FQDN has populated properly in wp-config.php

.htaccess - How to redirect if NO specific useragent?

Hello dear Stackoverflow,
I have an issue with DoS attacks, I tried to filter the attacks with .htaccess but at the moment there is no user agent sent at all, so how can I filter this attack? I have managed to filter many of the useragents - but now Apache does not show any user agents.
I have tried to add RewriteConditions:
RewriteCond %{HTTP_USER_AGENT} ^$ [nocase] RewriteRule ^(.*)$ http://example.com/ [L,R=301]
Requests:
x.x.x.x - - [21/Jun/2019:03:25:00 +0200] "GET / HTTP/1.1" 200 3397
x.x.x.x - - [21/Jun/2019:03:24:50 +0200] "GET / HTTP/1.1" 200 3397
x.x.x.x - - [21/Jun/2019:03:24:50 +0200] "GET / HTTP/1.1" 200 3397
x.x.x.x - - [21/Jun/2019:03:24:48 +0200] "GET / HTTP/1.1" 200 3397
x.x.x.x - - [21/Jun/2019:03:24:57 +0200] "GET / HTTP/1.1" 200 3397
how can I filter this?
Thank you very much

HG clone - abort : HTTP Error 403: Forbidden/empty destination path not valid

Basically, I'm trying to serve (hg serve) my local repository and clone the same.
When I gave "hg clone http://localhost:8000/" (the served URL), I got "abort: HTTP Error 403: Forbidden"
When I did "unset http_proxy", tried again, abort: empty destination path is not valid popped up!
Why does it happen? Are there any prerequisites to be done in hgrc or any config files before the cloning?
hg clone http://localhost:8000/ .
Specifying the destination viz.current working directory(.) solved it.
There's no prior setup required:
(df)Ry4ans-MacBook-Air:www ry4an$ cd /tmp
(df)Ry4ans-MacBook-Air:tmp ry4an$ hg init janani ; cd janani ; hg serve &
[1] 22358
(df)Ry4ans-MacBook-Air:janani ry4an$ listening at http://Ry4ans-MacBook-Air.local:8000/ (bound to *:8000)
(df)Ry4ans-MacBook-Air:janani ry4an$ cd ..
(df)Ry4ans-MacBook-Air:tmp ry4an$ hg clone http://localhost:8000/ janani-clone
127.0.0.1 - - [24/Feb/2015 14:24:39] "GET /?cmd=capabilities HTTP/1.1" 200 -
127.0.0.1 - - [24/Feb/2015 14:24:39] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks
127.0.0.1 - - [24/Feb/2015 14:24:39] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D
no changes found
127.0.0.1 - - [24/Feb/2015 14:24:39] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases
updating to branch default
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
Could it be that you already have a different server listening on port 8000, so your hg serve isn't getting the connections?

Issues with RoR Mysql deployment in Open shift

I am trying to deploy a simple RoR in openshift.I am using Ruby-1.9 and mysql-5.1 , the app works fine with local deployment and it is not working in openshift.Previously i had the same issue and there was an open bug with passenger fusion in openshift has any one fixed this or is this still an issue.If there is any work around please do let me know.
I am posting my database yml config in here.
mysql: &mysql
adapter: mysql2
database: "<%=ENV['OPENSHIFT_APP_NAME']%>"
username: "<%=ENV['OPENSHIFT_MYSQL_DB_USERNAME']%>"
password: "<%=ENV['OPENSHIFT_MYSQL_DB_PASSWORD']%>"
host: <%=ENV['OPENSHIFT_MYSQL_DB_HOST']%>
port: <%=ENV['OPENSHIFT_MYSQL_DB_PORT']%>
enter code here
my rhc tail output is as follows
==> app-root/logs/ruby.log <==
10.80.227.1 - - [03/Jun/2014:01:11:48 -0400] "HEAD / HTTP/1.1" 200 - "-" "Ruby"
10.80.227.1 - - [03/Jun/2014:01:11:48 -0400] "HEAD / HTTP/1.1" 200 - "-" "Ruby"
10.80.227.1 - - [03/Jun/2014:02:11:28 -0400] "HEAD / HTTP/1.1" 200 - "-" "Ruby"
10.80.227.1 - - [03/Jun/2014:02:11:28 -0400] "HEAD / HTTP/1.1" 200 - "-" "Ruby"
10.80.227.1 - - [03/Jun/2014:03:11:37 -0400] "HEAD / HTTP/1.1" 200 - "-" "Ruby"
10.80.227.1 - - [03/Jun/2014:03:11:37 -0400] "HEAD / HTTP/1.1" 200 - "-" "Ruby"
10.80.227.1 - - [03/Jun/2014:04:13:34 -0400] "HEAD / HTTP/1.1" 200 - "-" "Ruby"
10.80.227.1 - - [03/Jun/2014:04:13:34 -0400] "HEAD / HTTP/1.1" 200 - "-" "Ruby"
==> app-root/logs/mysql.log <==
140602 21:52:59 mysqld_safe Logging to '/var/lib/openshift/538ce6295973caef290000fd/mysql//stdout.err'.
140602 21:52:59 mysqld_safe Starting mysqld daemon with databases from /var/lib/openshift/538ce6295973caef290000fd/mysql/data/
140602 21:52:59 mysqld_safe Starting mysqld daemon with databases from /var/lib/openshift/538ce6295973caef290000fd/mysql/data/
140602 21:52:59 InnoDB: Initializing buffer pool, size = 32.0M
140602 21:52:59 InnoDB: Completed initialization of buffer pool
140602 21:53:00 InnoDB: Started; log sequence number 0 44233
140602 21:53:01 [Note] Event Scheduler: Loaded 0 events
140602 21:53:01 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73' socket: '/var/lib/openshift/538ce6295973caef290000fd/mysql//socket/mysql.sock' port: 3306 Source distribution
For testing purposes i have a welcome controller and index page in rails that works fine with local machine.
Can any one please point me to the right resource or help it would be great help for me.
You have mysql: &mysql in your database.yml file. Try this
production:
adapter: mysql2
encoding: utf8
database: <%=ENV['OPENSHIFT_APP_NAME']%>
pool: 30
timeout: 30000
checkout_timeout: 30000
host: <%=ENV['OPENSHIFT_MYSQL_DB_HOST']%>
port: <%=ENV['OPENSHIFT_MYSQL_DB_PORT']%>
username: <%=ENV['OPENSHIFT_MYSQL_DB_USERNAME']%>
password: <%=ENV['OPENSHIFT_MYSQL_DB_PASSWORD']%>

apache2: configuration of mod_dav, mod_dav_fs

On a mountpoint (specifically: /var/data/) I have mounted a 3tb raid partition that stores all kind of data and I would like to share it through WebDAV. So I installed davfs2 on my client and set up the server site by adding:
ScriptAlias "/var/www/webdav" "/var/data"
<Directory "/var/www/webdav">
Dav On
</Directory>
Finally I added the www-data user to the media group, which is the group that has read/write access to all the /var/data stuff (file mode for all contents is 660, chown is "some_owner_which_is_part_of_media:media").
Then a a2enmod mod_dav and a restart of the apache should arise it to life. Ok, fine until here. I mounted the davfs on my client pc and it worked like a glance. At least it looked like that. The contents were listed and I was happy. Later I tried to open some file on my client, but sadly it failed with an IO error. And here the problems begin.
==> /var/log/apache2/access.log <==
jin.local - - [26/Jun/2010:14:04:45 +0200] "PROPFIND /webdav/ HTTP/1.1" 207 25152 "-" "davfs2/1.4.5 neon/0.29.0"
jin.local - - [26/Jun/2010:14:04:46 +0200] "GET /webdav/test HTTP/1.1" 500 823 "-" "davfs2/1.4.5 neon/0.29.0"
==> /var/log/apache2/error.log <==
[Sat Jun 26 14:04:46 2010] [error] [client 192.168.2.50] (13)Permission denied: exec of '/var/data/test' failed
[Sat Jun 26 14:04:46 2010] [error] [client 192.168.2.50] Premature end of script headers: test
In the assumption it might be a problem with the permissions that apache2 has no right to access this stuff I swiftly chowned the files and therefore I am quite sure it must be fine like this:
# ls -la /var/data
-rw-r--r-- 1 www-data www-data 22 2010-06-27 10:07 anotherTest
-rw-r--r-- 1 www-data www-data 5 2010-06-26 19:28 test
# cat anotherTest
this is another test
# cat test
test
Lately I also added authentication, in case WebDAV could need that to allow me the GET request. The authentication works but the rest just stays the same.
At this point I don't know what I could change. Anyone got an idea what I could try?
Greetings,
D.
-- EDIT --
some more log stuff and the current configuration. i just dont get what is wrong with it. as you can see in the log i can create (PUT) and delete (DELETE) files. but get just doesnt work.
ScriptAlias /webdav/ /test/
<Location /webdav/>
DAV On
AuthType Basic
AuthName "Restricted Files"
AuthBasicProvider file
AuthUserFile /var/www/passwords
AuthGroupFile /var/www/groups
<LimitExcept PROPFIND>
require group webdav
</LimitExcept>
</Location>
This is so odd?!
192.168.2.158 - - [02/Jul/2010:21:11:38 +0200] "GET /webdav/test HTTP/1.1" 500 823 "-" "-"
192.168.2.158 - - [02/Jul/2010:21:11:38 +0200] "GET /webdav/test HTTP/1.1" 500 823 "-" "-"
192.168.2.158 - dominik [02/Jul/2010:21:11:39 +0200] "PROPFIND /webdav/ HTTP/1.1" 207 1882 "-" "-"
192.168.2.158 - - [02/Jul/2010:21:11:39 +0200] "GET /webdav/test HTTP/1.1" 500 823 "-" "-"
192.168.2.158 - - [02/Jul/2010:21:11:39 +0200] "GET /webdav/test HTTP/1.1" 500 823 "-" "-"
192.168.2.158 - - [02/Jul/2010:21:11:39 +0200] "GET /webdav/test HTTP/1.1" 500 823 "-" "-"
192.168.2.158 - dominik [02/Jul/2010:21:11:42 +0200] "PROPFIND /webdav/.test.swp HTTP/1.1" 404 467 "-" "-"
192.168.2.158 - dominik [02/Jul/2010:21:11:42 +0200] "PUT /webdav/.test.swp HTTP/1.1" 201 481 "-" "-"
192.168.2.158 - dominik [02/Jul/2010:21:11:42 +0200] "DELETE /webdav/.test.swp HTTP/1.1" 204 141 "-" "-"
192.168.2.158 - dominik [02/Jul/2010:21:11:45 +0200] "PROPFIND /webdav/ HTTP/1.1" 207 497 "-" "-"
==> /var/log/apache2/private-error.log <==
[Fri Jul 02 21:11:38 2010] [error] [client 192.168.2.158] (13)Permission denied: exec of '/test/test' failed
[Fri Jul 02 21:11:38 2010] [error] [client 192.168.2.158] Premature end of script headers: test
[Fri Jul 02 21:11:38 2010] [error] [client 192.168.2.158] (13)Permission denied: exec of '/test/test' failed
[Fri Jul 02 21:11:38 2010] [error] [client 192.168.2.158] Premature end of script headers: test
[Fri Jul 02 21:11:39 2010] [error] [client 192.168.2.158] (13)Permission denied: exec of '/test/test' failed
[Fri Jul 02 21:11:39 2010] [error] [client 192.168.2.158] Premature end of script headers: test
[Fri Jul 02 21:11:39 2010] [error] [client 192.168.2.158] (13)Permission denied: exec of '/test/test' failed
[Fri Jul 02 21:11:39 2010] [error] [client 192.168.2.158] Premature end of script headers: test
[Fri Jul 02 21:11:39 2010] [error] [client 192.168.2.158] (13)Permission denied: exec of '/test/test' failed
[Fri Jul 02 21:11:39 2010] [error] [client 192.168.2.158] Premature end of script headers: test
I could bang my head. The solution was simple:
Alias /webdav/ /var/data/
<Location /webdav/>
DAV On
AuthType Basic
AuthName "Restricted Files"
AuthBasicProvider file
AuthUserFile /etc/passwords
AuthGroupFile /etc/groups
<LimitExcept PROPFIND>
require group webdav
</LimitExcept>
</Location>
Note the "Alias" in the place of "ScriptAlias". The reason why this works can be found here.