Tag Archives: Apache

Install Graphite under pyenv virtualenv on Ubuntu

It took me one and an half day to get the Graphite working…

1. Make sure you have pyenv and pyenv-virtualenv installed.


2. Install the following packages.

sudo apt-get install python-dev pkg-config libcairo2-dev memcached


3. Install Python 2.7 with enable-shared.

env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 2.7.8

Continue reading

About these ads

Git – Setup a bare repository which is writable by both user and group

We have made the HTTP protocol works for our git repository.


We need to made the files writable by Apache otherwise you could never push the commits back to the server.

To setup a new repository, we could flag it as a shared repository during initialization. Then we could change the repository root folder.

git init --bare --shared=group <new-repo>.git
chgrp -R <group> <new-repo>.git

Continue reading

Make Git work on HTTP protocol

Assume SELinux is disabled on your Git server…

The following setup is on CentOS and assume your Git repositories are all located under /data/repos.

1. Install Git and Apache.

yum install git httpd


2. Create the /etc/httpd/conf.d/git.conf.

# Git over HTTP
<VirtualHost *:80>
  SetEnv GIT_PROJECT_ROOT /data/repos
  ScriptAlias /git/ /usr/libexec/git-core/git-http-backend/

  <Location /git/>
    AuthType Basic
    AuthName "Git Access"
    AuthUserFile /var/www/passwd.git
    Require valid-user

Continue reading

TortoiseSVN – SVN+SSH protocol with SSL key authentication

In the past, i usually integrate SVN with Apache such that i could access the SVN repository through the HTTP protocol.
Apache and SVN Integration

I could use TortoiseSVN to checkout the SVN repository with correct username and password. But sometimes, we need to use SVN+SSH to access the SVN repository. Here are the steps using SSH key authentication.

1. Add your private key in pageant.exe.
Continue reading

Apache – Enable Cross-origin resource sharing CORS

Long time ago, we talked about using JSONP to tackle to cross domain ajax issue.
jQuery & JSON – Make Cross Domain Request Using jQuery.getJSON() with JSONP

But this requires server side coding. If you are allow to edit the Apache config, you can simply Enable the CORS (Cross-origin resource sharing) in the VirtualHost file as follow.

1. Enable the mod_headers in Apache by entering the following command in shell.

a2enmod headers

Continue reading

PHP – http:// wrapper is disabled in the server configuration by allow_url_fopen=0

If you find these 2 errors in the error log.

  • …file_get_contents() [function.file-get-contents]: http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in…
  • …failed to open stream: no suitable wrapper could be found in…


Edit the php.ini and enable the following 2 settings.

allow_url_fopen = On
allow_url_include = On


Restart Apache and they should be fixed.

Done =)


Nginx – Setup HTTP Authentication

HTTP Authentication is the easiest way to prevent anonymous user access to your website. If you are on Apache, you can refer to the following post.
.htaccess – Setting Password For Your Web Folder

After you have created the password file, you could add the following line in the .htaccess or in the Apache VirtualHost.
Continue reading