不允许在CircleCl上使用Apache
问题描述:
我想在CircleCI上设置Processwire CMS并且在Apache Webserver上遇到一些麻烦。不允许在CircleCl上使用Apache
在我的测试与CasperJS我总是得到错误:
<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN"><html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access/
on this server.</p>
<hr>
<address>Apache/2.4.7 (Ubuntu) Server at contenthub.dev Port 8080</address>
</body></html>
我的Apache的配置是:
Listen 8080
<VirtualHost *:8080>
LoadModule php7_module /opt/circleci/php/7.0.17/usr/lib/apache2/modules/libphp7.so
DocumentRoot /home/ubuntu/content-hub-test
ServerName contenthub.dev
DirectoryIndex index.html index.json index.php
LogLevel notice
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
<Directory /home/ubuntu/content-hub-test>
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
我circle.yml是:
machine:
timezone:
Europe/Vienna
ruby:
version: ruby-2.2.6
node:
version: 8.0.0
php:
version: 7.0.17
python:
version: 3.6.1
hosts:
contenthub.dev: 127.0.0.1
dependencies:
pre:
- npm install
- npm install -g casperjs
- gem install compass
post:
- sudo rm /etc/apache2/mods-enabled/php5.load #damit php 7 geht
- sudo cp ~/content-hub-test/apache_ci.conf /etc/apache2/sites-available
- sudo a2ensite apache_ci.conf
- sudo service apache2 restart
checkout:
post:
- sudo mv ~/content-hub-test/site/config-circleci.php ~/content-hub-test/site/config.php
database:
override:
- mysql -u ubuntu circle_test < ~/content-hub-test/processwire_ci_db.sql
compile:
override:
- ~/content-hub-test/node_modules/gulp/bin/gulp.js --gulpfile ~/content-hub-test/Gulpfile.js --cwd ~/content-hub-test --testing
test:
override:
- casperjs ~/content-hub-test/tests/test.js
general:
artifacts:
- "/var/log/apache2/"
此设置也由circleci documention推荐。 我所有的PHP文件都在〜/ content-hub-test文件夹中。我认为我在Apache配置中做了错误的事情 - 但是什么?
答
,我发现这个解决方案,它的工作:
Listen 8080
<VirtualHost *:8080>
LoadModule php7_module /opt/circleci/php/7.0.17/usr/lib/apache2/modules/libphp7.so
DocumentRoot /home/ubuntu/content-hub-test
ServerName contenthub.dev
DirectoryIndex index.html index.json index.php
LogLevel notice
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
<Directory /home/ubuntu/content-hub-test>
AllowOverride All
Allow from All
Require all granted
</Directory>
</VirtualHost>