gitweb + smart http

As the requirements for http-type push and pull, we must set up much more things. This post is a short report for how to set it up but discard the detail of how to install the packages.

1. git-http-backend:

As the resources from manual git-http-backend, we need to generate a configuration and its corresponding settings.

# vim /{the apache configs directory}/git-more.conf

And filled out settings like:

1
2
3
4
5
6
7
8
9
10
11
12
13
SetEnv GIT_PROJECT_ROOT {git repository root}
SetEnv GIT_HTTP_EXPORT_ALL

ScriptAliasMatch \
"(?x)^/git/(.*/(HEAD | \
info/refs | \
objects/(info/[^/]+ | \
[0-9a-f]{2}/[0-9a-f]{38} | \
pack/pack-[0-9a-f]{40}\.(pack|idx)) | \
git-(upload|receive)-pack))$"
\
/{path to git-http-backend}/$1

ScriptAlias /git/ /{path to gitweb.cgi}/

And Don’t forget to enable the WebDav for the repositories directory, like:

1
2
3
4
5
<Directory "{repositories root}">
Options Indexes FollowSymlinks ExecCGI
Allow From All
Dav On
</Directory>

On the other hand, also the ExecCGI permission for the cgis. But there also problems when we use git push

Continue reading “gitweb + smart http”

mysql’s “SET NAMES”

One of my friend encounter a prblem after reconstruction of mysql server. The process is too detail and complex to write down that I only point out the result.

After surveying some resources of the “SET NAMES XXX” command for mysql connection, I realize that the charset settings of client, connection, server, and result are important for an old website. For eample, webpages use big5 but databases use big5 or other more strange settings.

From the resources: [轉載]MySQL 的 “SET NAMES xxx” 字元編碼問題分析, we can use the separate commands for more detail settings:

SET character_set_client = big5;
SET character_set_results = big5;
SET character_set_connection = utf8;

when the tables use utf8 but pages uses big5 and the server default settings are utf8.

Anyway, trying this solution if there is no other choices. 😀

bash_complete in gentoo

To enable this feature, gentoo will have come auto completion/notify for command. But in gentoo, there are some tricky should be note.

1. install gentoo-bashcomp, it will also imstall bash_completion and mush more syntax file

# emerge gentoo-bashcomp

2. enable the syntax of gentoo

# eselect bashcomp enable --global gentoo

3. for other syntax, IMPORTANT: the base must be enable by default

# eselect bashcomp enable --global base ssh info man

After enabling base and ssh, you can use ssh<TAB><TAB> to get the listing you have connected. And the man and info are also useful when we want to search for partial command. Enjoy it 😀

Switch the tomcat listings options

This post is about how to override default tomcat options for each apps. For the default settings we used for tomcat will listings the directories when there is no feasible welcome pages. But we want to do separate settings for each apps.

After some search, according to this page: EnablingOrDisablingDirectoryListingsUsingWeb.xml, the answer is clear. That is, opening the configure file (web.xml) in what we want set up, and add the corresponding  <servlet> and <servlet-mapping> section as the example below.

<servlet>
<servlet-name>DefaultServletOverride</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
<init-param>
<param-name>listings</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>

<!– Add a mapping for our new default servlet –>
<servlet-mapping>
<servlet-name>DefaultServletOverride</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>

Then finished.

ipv6 in sinica

是說資訊室竟然沒有開放 ipv6 的設定(還是說也許有但是我不知道)

只能跑去使用計中的 6-to-4 broker 來做轉換的動作…

計中只提供 windows 設定方式, 不過因為 linux 的也很簡單, 所以分享一下

0.a register for Gateway 6 interface; then will receive an mail later for account actived

0.b install gogoc (or tspc in previous version)

# apt-get install gogoc

1. setting up gogoc.conf

# vim /etc/gogoc/gogoc.conf

1.a put the userid and passwd in line 30 and 31 (not absolutely)

1.b change the connect server as server=tb2.ipv6.ascc.net in line 52

1.c change authentication method as auth_method=digest-md5 by the suggestion of ascc in line 72

AND THE MOST IMPORTANT THING TO DO IS:

TO CHANGE THE TUNNEL MODE BECAUSE FIREWALL IN IIS WILL NOT ALLOW THE DEFAULT SETTING

2. change tunnel setting by tunnel_mode=v6udpv4 in line 165

3. finally, start the service, and the ipv6 is passed and the result via ping6 is listing:

moneycat@Galaxy:~$ ping6 ipv6.google.com
PING ipv6.google.com(2404:6800:8003::67) 56 data bytes
64 bytes from 2404:6800:8003::67: icmp_seq=1 ttl=58 time=2.84 ms

Enjoy it 😀

named ‘managed-keys.bind’ error

After upgrade to bind 9.3.0, I’ve got an error message while starting service:

managed-keys-zone ./IN: loading from master file managed-keys.bind failed: file not found.

Althouth it will not affect DNS server’s functionality, but it is annoying. The solution is to create an empty missing file in its WORKING directory. In my gentoo box, the named working directory is on /var/bind, so the step is:

# cd /var/bind
# touch managed-keys.bind
# /etc/init.d/named restart

And that’s all, the error has gone. 🙂

php warning after updraded to 5.3

After upgrading to PHP 5.3, my Cacti got lots of warnings like:

Warning: strtotime() [function.strtotime]: It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function….

Thanks to Google, I found the best way to solve it is in the php.ini configure file. And the solution is to add a DEFAULT TIMEZONE for it. THat is, to modify the DATE section of cgi-/cli-php. My configure is:

date.timezone = Asia/Taipei

And that’s all 😀