Debian 9手工编译安装ocserv 0.12.6 2024-06-06 Website News 暂无评论 374 次阅读 Debian 9默认的ocserv是0.11。6的版本,会有一些兼容性的问题,加上Debian没有CentOS的EPEL套件,所以只能手工编译,来回折腾了好几遍终于编译成功了。 ```csharp apt update apt install wget net-tools curl less wget https://github.com/radcli/radcli/releases/download/1.3.1/radcli-1.3.1.tar.gz tar zxvf radcli-1.3.1.tar.gz cd radcli-1.3.1 ./configure --sysconfdir=/etc/ && make && make install apt install build-essential autoconf automake libtool pkg-config libgnutls28-dev libev-dev libprotobuf-c-dev libnl-route-3-dev libseccomp-dev libreadline-dev libtalloc-dev libhttp-parser-dev gnutls-bin liboath-dev libradcli-dev ./configure --sysconfdir=/etc/ && make && make install nano servers nano radiusclient.conf cd /root wget ftp://ftp.infradead.org/pub/ocserv/ocserv-0.12.6.tar.xz tar -xvf ocserv-0.12.6.tar.xz cd ocserv-0.12.6 ./configure --enable-radius --prefix=/usr/local --sysconfdir=/etc/ocserv && make && make install find / -name libradcli.so.5 cp /usr/local/lib/libradcli.so.5 /usr/lib/x86_64-linux-gnu/ ldconfig ocserv mkdir /etc/ocserv cd /etc/ocserv nano ca.cert.pem nano server.cert.pem nano server.pem nano ocserv.conf ocserv -f -d 1 ocserv -h ``` 由于手工编译的没有service文件,需要自己搞一个出来,我就从其他版本copy了一个过来,直接使用。 ```csharp nano /etc/init.d/ocserv ``` ```csharp #! /bin/sh ### BEGIN INIT INFO # Provides: ocserv # Required-Start: $remote_fs $syslog dbus # Required-Stop: $remote_fs $syslog dbus # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: OpenConnect SSL VPN server # Description: secure, small, fast and configurable OpenConnect SSL VPN server ### END INIT INFO set -e NAME=ocserv DESC="OpenConnect SSL VPN server" DAEMON=/usr/local/sbin/ocserv DAEMON_CONFIG=/etc/${NAME}/${NAME}.conf DAEMON_PIDFILE=/var/run/${NAME}.pid DAEMON_ARGS="--pid-file $DAEMON_PIDFILE --config $DAEMON_CONFIG" test -x $DAEMON || exit 0 umask 022 . /lib/lsb/init-functions export PATH="${PATH:+$PATH:}/usr/local/sbin:/sbin" daemon_start() { if [ ! -s "$DAEMON_CONFIG" ]; then log_failure_msg "please create ${DAEMON_CONFIG}, not starting..." log_end_msg 1 exit 0 fi log_daemon_msg "Starting $DESC" "$NAME" || true if start-stop-daemon --start --quiet --oknodo --pidfile $DAEMON_PIDFILE --exec $DAEMON -- $DAEMON_ARGS ; then log_end_msg 0 || true else log_end_msg 1 || true fi } case "$1" in start) daemon_start ;; stop) log_daemon_msg "Stopping $DESC" "$NAME" || true if start-stop-daemon --stop --quiet --oknodo --pidfile $DAEMON_PIDFILE; then log_end_msg 0 || true else log_end_msg 1 || true fi ;; reload|force-reload) log_daemon_msg "Reloading $DESC" "$NAME" || true if start-stop-daemon --stop --signal 1 --quiet --oknodo --pidfile $DAEMON_PIDFILE --exec $DAEMON; then log_end_msg 0 || true else log_end_msg 1 || true fi ;; restart) log_daemon_msg "Restarting $DESC" "$NAME" || true start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile $DAEMON_PIDFILE daemon_start ;; try-restart) log_daemon_msg "Restarting $DESC" "$NAME" || true RET=0 start-stop-daemon --stop --quiet --retry 30 --pidfile $DAEMON_PIDFILE || RET="$?" case $RET in 0) # old daemon stopped daemon_start ;; 1) # daemon not running log_progress_msg "(not running)" || true log_end_msg 0 || true ;; *) # failed to stop log_progress_msg "(failed to stop)" || true log_end_msg 1 || true ;; esac ;; status) status_of_proc -p $DAEMON_PIDFILE $DAEMON $NAME && exit 0 || exit $? ;; *) log_action_msg "Usage: /etc/init.d/$NAME {start|stop|reload|force-reload|restart|try-restart|status}" || true exit 1 esac exit 0 ``` 标签: Debian, ocserv, debian 9 本作品采用 知识共享署名-相同方式共享 4.0 国际许可协议 进行许可。
评论已关闭