Install Seafile 2 in CentOS 6
Install Seafile in CentOS 6.4 _ 64 using Apahce and SQLite.
1. Prepare the environment
1.1 centos6.4 _ 64 minimal installation
Yum-y install httpd # After deploying apache, refer to the https://github.com/haiwen/seafile/wiki/Deploy-Seafile-with-apache
Yum-y install python-setuptools python-simplejson python-imaging sqlite3 # The default value is python2.6.
Yum-y install apr-devel httpd-devel libtool # required for fastcgi Installation
Yum update-y
Chkconfig postfix off
/Etc/ini t. d/postfix stop # disable email service
Reboot
1.2 Firewall Configuration
Vi/etc/sysconfig/iptables
/Etc/sysconfig/iptables add three additional content to open ports 80, 10001, and 12001
-A input-m state -- state NEW-m tcp-p tcp -- dport 80-j ACCEPT
-A input-m state -- state NEW-m tcp-p tcp -- dport 10001-j ACCEPT
-A input-m state -- state NEW-m tcp-p tcp -- dport 12001-j ACCEPT
The firewall restart configuration takes effect.
/Etc/init. d/iptables restart
1.3 install fastcgi as a httpd Module
Deploy seafile apache to fastcgi, download fastcgi, and decompress
Curl-O http://www.fastcgi.com/dist/mod_fastcgi-current.tar.gz
Tar-xzvf mod_fastcgi-current.tar.gz
Cd mod_fastcgi-2.4.6/
Cp Makefile. AP2 Makefile
Change top_dir in Makefile
# Top_dir =/usr/local/apache2
Top_dir =/usr/lib64/httpd # For example, if the 32-bit machine is/usr/lib/httpd
Compile and install fastcgi and install it to/usr/lib64/httpd/modules/(32-bit machine/usr/lib/httpd/modules /)
Make
Make install
Configure httpd. conf
Add FastCGIExternalServer
LoadModule fastcgi_module modules/mod_fastcgi.so
##
FastCGIExternalServer/var/www/html/seahub. fcgi-host 127.0.0.1: 8000
Add/etc/httpd/conf. d/v. conf
NameVirtualHost *: 80
ServerName sf.bkjia.com # the corresponding dns needs to be configured. If not, modify the hosts of your machine.
DocumentRoot/var/www/html
Alias/media/opt/haiwen/seafile-server-2.0.3/seahub/media/
RewriteEngine On
#
# Seafile httpserver
#
ProxyPass/seafhttp http: // 127.0.0.1: 8082
ProxyPassReverse/seafhttp http: // 127.0.0.1: 8082
RewriteRule ^/seafhttp-[QSA, L]
# Seahub
#
RewriteRule ^/(media. *) $/$1 [QSA, L, PT]
RewriteCond % {REQUEST_FILENAME }! -F
RewriteRule ^ (. *) $/seahub. fcgi $1 [QSA, L, E = HTTP_AUTHORIZATION: % {HTTP: Authorization}]
2. Install seafile2.0
2.1 Download and decompress seafile
Download seafile and decompress it to the specified directory. Run the installation command.
Http://seafile.googlecode.com/files/seafile-server_2.0.3_x86-64.tar.gz
Tar-xzvf seafile-server_2.0.3_x86-64.tar.gz
Mkdir/opt/haiwen
Music seafile-server-2.0.3/opt/haiwen
To install seafile, you only need to follow the specified prompt. Generally, the default setting is used. See https://github.com/haiwen/seafile/wiki/download-and-setup-seafile-server.
/Setup-seafile.sh
2.2 configure selinux
Selinux is enabled by default under centos6.
Setsebool-P httpd_can_network_connect 1 # httpd network connection
Chcon-R-h-u system_u-t httpd_sys_content_t/opt/haiwen/seafile-server-2.0.3/seahub/media/# httpd accessible
Chcon-R-h-u system_u-t httpd_sys_content_t/opt/haiwen/seahub-data/avatars/# httpd accessible
3. Start the service
Start seafile and seahub, and restart httpd.
/Opt/hai文/ seafile-server-2.0.3/seafile. sh start
/Opt/haiwen/ seafile-server-2.0.3/seahub. sh start-fastcgi
/Etc/init. d/httpd restart
Congratulations on the successful installation, you can access the http://sf.bkjia.com directly
Or download the client http://seafile.com/download/access
4. Problems Encountered
4.1 httpd error apr_sockaddr_info_get () failed
Starting httpd: apr_sockaddr_info_get () failed for seafile.bkjia.com
Add seafile.bkjia.com to/etc/hosts and enter the machine name.
127.0.0.1 localhost. localdomain localhost4 localhost4.localdomain4 seafile.bkjia.com
4.2 FastCGI: apr_dir_open () failed
The error message is as follows:
[Wed Nov 20 10:51:13 2013] [error] (13) Permission denied: FastCGI: apr_dir_open () failed
[Wed Nov 20 10:51:13 2013] [notice] Digest: generating secret for digest authentication...
[Wed Nov 20 10:51:13 2013] [notice] Digest: done
[Wed Nov 20 10:51:13 2013] [error] (13) Permission denied: FastCGI: apr_dir_open () failed
[Wed Nov 20 10:51:13 2013] [notice] FastCGI: process manager initialized (pid 1823)
[Wed Nov 20 10:51:13 2013] [notice] Apache/2.2.15 (Unix) DAV/2 mod_fastcgi/2.4.6 configured -- resuming normal operations
This is a selinux problem. Run the following command:
Chcon-R-t var_log_t/var/log/httpd/fastcgi/