4 For testing aurweb patches before submission, you can use the instructions in
5 TESTING for testing the web interface only.
7 Note that you can only do limited testing using the PHP built-in web server.
8 In particular, the cgit interface will be unusable as well as the ssh+git
9 interface. For a detailed description on how to setup a full aurweb server,
10 read the instructions below.
12 1) Clone the aurweb project:
15 $ git clone git://git.archlinux.org/aurweb.git
17 2) Setup a web server with PHP and MySQL. Configure the web server to redirect
18 all URLs to /index.php/foo/bar/. The following block can be used with nginx:
22 server_name aur.local aur;
24 root /srv/http/aurweb/web/html;
27 location ~ ^/[^/]+\.php($|/) {
28 fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
29 fastcgi_index index.php;
30 fastcgi_split_path_info ^(/[^/]+\.php)(/.*)$;
31 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
32 fastcgi_param PATH_INFO $fastcgi_path_info;
33 include fastcgi_params;
37 rewrite ^/(.*)$ /index.php/$1 last;
41 3) Copy conf/config.proto to /etc/aurweb/config and adjust the configuration
42 (pay attention to disable_http_login, enable_maintenance and aur_location).
44 4) Create a new MySQL database and a user and import the aurweb SQL schema:
46 $ mysql -uaur -p AUR </srv/http/aurweb/schema/aur-schema.sql
48 5) Install Python modules and dependencies:
50 # pacman -S python-mysql-connector python-pygit2 python-srcinfo
51 # python3 setup.py install
55 # useradd -U -d /srv/http/aurweb -c 'AUR user' aur
57 7) Initialize the Git repository:
59 # mkdir /srv/http/aurweb/aur.git/
60 # cd /srv/http/aurweb/aur.git/
62 # git config --local transfer.hideRefs '^refs/'
63 # git config --local --add transfer.hideRefs '!refs/'
64 # git config --local --add transfer.hideRefs '!HEAD'
65 # ln -s /usr/local/bin/aurweb-git-update hooks/update
68 It is recommended to read doc/git-interface.txt for more information on the
69 administration of the package Git repository.
71 8) Configure sshd(8) for the AUR. Add the following lines at the end of your
72 sshd_config(5) and restart the sshd. Note that OpenSSH 6.9 or newer is
76 PasswordAuthentication no
77 AuthorizedKeysCommand /usr/local/bin/aurweb-git-auth "%t" "%k"
78 AuthorizedKeysCommandUser aur
80 9) If you want to enable smart HTTP support with nginx and fcgiwrap, you can
81 use the following directives:
83 location ~ "^/([a-z0-9][a-z0-9.+_-]*?)(\.git)?/(git-(receive|upload)-pack|HEAD|info/refs|objects/(info/(http-)?alternates|packs)|[0-9a-f]{2}/[0-9a-f]{38}|pack/pack-[0-9a-f]{40}\.(pack|idx))$" {
84 fastcgi_pass unix:/run/fcgiwrap.sock;
85 include fastcgi_params;
86 fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend;
87 fastcgi_param PATH_INFO /aur.git/$3;
88 fastcgi_param GIT_HTTP_EXPORT_ALL "";
89 fastcgi_param GIT_NAMESPACE $1;
90 fastcgi_param GIT_PROJECT_ROOT /srv/http/aurweb/;
93 Sample systemd unit files for fcgiwrap can be found under conf/.