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 Ensure to enable the pdo_mysql extension in php.ini.
43 3) Optionally copy conf/config.defaults to /etc/aurweb/. Create or copy
44 /etc/aurweb/config (this is expected to contain all configuration settings
45 if the defaults file does not exist) and adjust the configuration (pay
46 attention to disable_http_login, enable_maintenance and aur_location).
48 4) Create a new MySQL database and a user and import the aurweb SQL schema:
50 $ mysql -uaur -p AUR </srv/http/aurweb/schema/aur-schema.sql
52 5) Install Python modules and dependencies:
54 # pacman -S python-mysql-connector python-pygit2 python-srcinfo
55 # pacman -S python-bleach python-markdown
56 # python3 setup.py install
60 # useradd -U -d /srv/http/aurweb -c 'AUR user' aur
62 7) Initialize the Git repository:
64 # mkdir /srv/http/aurweb/aur.git/
65 # cd /srv/http/aurweb/aur.git/
67 # git config --local transfer.hideRefs '^refs/'
68 # git config --local --add transfer.hideRefs '!refs/'
69 # git config --local --add transfer.hideRefs '!HEAD'
70 # ln -s /usr/local/bin/aurweb-git-update hooks/update
73 It is recommended to read doc/git-interface.txt for more information on the
74 administration of the package Git repository.
76 8) Configure sshd(8) for the AUR. Add the following lines at the end of your
77 sshd_config(5) and restart the sshd. Note that OpenSSH 6.9 or newer is
81 PasswordAuthentication no
82 AuthorizedKeysCommand /usr/local/bin/aurweb-git-auth "%t" "%k"
83 AuthorizedKeysCommandUser aur
84 AcceptEnv AUR_OVERWRITE
86 9) If you want to enable smart HTTP support with nginx and fcgiwrap, you can
87 use the following directives:
89 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))$" {
90 fastcgi_pass unix:/run/fcgiwrap.sock;
91 include fastcgi_params;
92 fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend;
93 fastcgi_param PATH_INFO /aur.git/$3;
94 fastcgi_param GIT_HTTP_EXPORT_ALL "";
95 fastcgi_param GIT_NAMESPACE $1;
96 fastcgi_param GIT_PROJECT_ROOT /srv/http/aurweb/;
99 Sample systemd unit files for fcgiwrap can be found under conf/.
101 10) If you want memcache to cache MySQL data.
103 # pacman -S php-memcached
105 And edit the configuration file to enabled memcache caching.