我通过如上所述创建文件的符号链接解决了这个问题,但在2
最后添加了尾随数字,版本号。
例如:ln -s /usr/local/lib/libfastcgipp.so.2.0.0 /usr/lib/libfastcgipp.so.2
更新
再次遇到这个问题并且无法再次解决同样的问题,所以我发布了一个 docker 文件,它将让你的 fastCGI++ 脚本运行(可能只有我会使用它,但无论如何......)
fastcgi++2.1 源码:http ://www.nongnu.org/fastcgipp/
FROM ubuntu:14.04
ENV DEBIAN_FRONTEND noninteractive
RUN ln -snf /usr/share/zoneinfo/Europe/Stockholm /etc/localtime \
&& echo "Europe/Stockholm" > /etc/timezone
ENV TERM xterm
RUN echo "deb http://us.archive.ubuntu.com/ubuntu/ trusty multiverse" >> /etc/apt/sources.list
RUN echo "deb-src http://us.archive.ubuntu.com/ubuntu/ trusty multiverse" >> /etc/apt/sources.list
RUN echo "deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse" >> /etc/apt/sources.list
RUN echo "deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse" >> /etc/apt/sources.list
RUN apt-get -y update && apt-get -y install \
build-essential \
libboost-all-dev \
git \
apache2 \
libapache2-mod-fastcgi
COPY dependencies/fastcgi++-2.1.tar.bz2 /tmp/fastcgi++-2.1.tar.bz2
RUN cd /tmp \
&& tar xvf fastcgi++-2.1.tar.bz2 \
&& cd fastcgi++-2.1 \
&& ./configure \
&& make \
&& make install
RUN ln -s /usr/local/lib/libfastcgipp.so.2.0.0 /usr/lib/libfastcgipp.so.2
COPY rep /tmp/app
RUN cd /tmp/app \
&& g++ main.cpp -o example -std=gnu++11 -lfastcgipp -lboost_system -lboost_thread \
&& mv example /var/www/example
COPY config/apache/default.conf /etc/apache2/sites-available/example.conf
COPY config/apache/.htaccess /var/www/.htaccess
RUN mkdir -p /tmp/log/apache/
RUN a2enmod rewrite
RUN a2dissite 000-default
RUN a2ensite example.conf
RUN service apache2 restart
RUN apt-get autoremove -y && apt-get clean all
EXPOSE 80
CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]
配置/apache/default.conf
ServerName example
<VirtualHost *:80>
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
SetHandler fastcgi-script
<Directory "/var/www">
AllowOverride All
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /tmp/log/apache/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /tmp/log/apache/access.log combined
</VirtualHost>
.htaccess
RewriteEngine On
RewriteRule (.+)/$ /$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ example [NC,L]
DirectoryIndex example