2017-06-01 3 views
1

Ich möchte Processwire CMS auf CircleCI einrichten und einige Probleme mit Apache Webserver haben.Keine Erlaubnis mit Apache auf CircleCI

In meinem Test mit CasperJS erhalte ich immer die Fehlermeldung:

<!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>

Mein Apache config:

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> 

Mein circle.yml ist:

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/" 

Diese Einstellung wird auch von circleci documention empfohlen. Alle meine PHP-Dateien befinden sich im Ordner ~/content-hub-test. Ich denke ich mache etwas falsch in der Apache Config - aber was?

Antwort

1

fand ich diese Lösung und es funktioniert:

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>