- Installiere ein Basissystem nach deinen Wünschen
- Installiere einen Webserver deiner Wahl. Wir gehen im folgenden von einem NginX mit der Konfiguration von [[http://wiki.nginx.org/WordPress]] aus. Hinzu kommen folgende Anweisungen: auth_basic "Restricted"; auth_basic_user_file .htpasswd; sowie unten stehende Konfiguation für die öffentliche Seite. /etc/nginx/.htpasswd generieren.
- Lade ein aktuelle Wordpress herunter und entpacke es in /var/www (z.B. mit wget -O - [[http://wordpress.org/latest.tar.gz]] | tar xz )
- Richte Wordpress ein (eine Anleitung gibt es unter [[http://codex.wordpress.org/Installing_WordPress]] )
- Installiere folgende Plugins: **Ceceppa Multilingua, Disable Comments, List category posts, WP Static HTML Output**
- WP Static HTML Output unterstützt kein HTTP Basic Auth. Hierfür unten stehen patch anwenden.
- Backup importieren. Leider unterstützt das Wordpressbackup keine Sprachinformationen. Hier also am besten auf Datenbankebene migrieren.
- Unter Appearance -> Menus ein neues Menü erstellen, da Ceceppa doppelte Einträge im Default-Menu verursacht.
- Theme installieren (derzeit verwenden wir "Responsive")
TODO: Design -> Widgets -> Sidebar -> Meta auf den RSS-Feed einschränken (Wir wollen da keine Links zu Wordpress.org oder zur Login-Seite)
nginx config:
server {
listen 80; ## listen for ipv4; this line is default and implied
listen [::]:80 default_server ipv6only=on; ## listen for ipv6
root /var/www/public;
index index.html index.htm;
# Make site accessible from [[http://ccc.chaos-inkl.de/]]
server_name ccc.chaos-inkl.de;
if ( $args ~ language=de ) {
rewrite ^/(.*) /de/$1? permanent;
}
if ( $args ~ language=en ) {
rewrite ^/(.*) /en/$1? permanent;
}
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.html;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}
}
wp-static-patch:
--- library/StaticHtmlOutput.php 2014-03-01 17:48:34.224738002 -0500
+++ library/StaticHtmlOutput.php.new 2014-03-01 18:01:21.068737346 -0500
@@ -113,6 +113,9 @@
{
$this->_options
->setOption('version', self::VERSION)
+ ->setOption('requiresAuth', 0)
+ ->setOption('authUser', '')
+ ->setOption('authPass', '')
->setOption('baseUrl', home_url())
->setOption('additionalUrls', '')
->setOption('generateZip', '')
@@ -175,6 +178,9 @@
$this->_view
->setTemplate('options-page')
->assign('exportLog', $this->_exportLog)
+ ->assign('requiresAuth', $this->_options->getOption('requiresAuth'))
+ ->assign('authUser', $this->_options->getOption('authUser'))
+ ->assign('authPass', $this->_options->getOption('authPass'))
->assign('baseUrl', $this->_options->getOption('baseUrl'))
->assign('additionalUrls', $this->_options->getOption('additionalUrls'))
->assign('generateZip', $this->_options->getOption('generateZip'))
@@ -207,6 +213,9 @@
%%//%% Save options
$this->_options
+ ->setOption('requiresAuth', filter_input(INPUT_POST, 'requiresAuth'))
+ ->setOption('authUser', filter_input(INPUT_POST, 'authUser'))
+ ->setOption('authPass', filter_input(INPUT_POST, 'authPass'))
->setOption('baseUrl', filter_input(INPUT_POST, 'baseUrl', FILTER_SANITIZE_URL))
->setOption('additionalUrls', filter_input(INPUT_POST, 'additionalUrls'))
->setOption('generateZip', filter_input(INPUT_POST, 'generateZip'))
@@ -275,7 +284,12 @@
%%//%%echo "Processing ". $currentUrl."
";
- $urlResponse = new StaticHtmlOutput_UrlRequest($currentUrl);
+ if ( $this->_options->getOption('requiresAuth') == 1)
+ {
+ $urlResponse = new StaticHtmlOutput_UrlRequest($currentUrl, $this->_options->getOption('authUser'), $this->_options->getOption('authPass'));
+ } else {
+ $urlResponse = new StaticHtmlOutput_UrlRequest($currentUrl);
+ }
$urlResponse->cleanup();
%%//%% Add current url to the list of processed urls
--- library/StaticHtmlOutput/UrlRequest.php 2014-03-01 17:48:34.224738002 -0500
+++ library/StaticHtmlOutput/UrlRequest.php.new 2014-03-01 17:58:33.708737054 -0500
@@ -26,10 +26,12 @@
* Constructor
* @param string $url URI resource
*/
- public function %%__%%construct($url)
+ public function %%__%%construct($url, $username = "", $password = "")
{
$this->_url = filter_var($url, FILTER_VALIDATE_URL);
- $response = wp_remote_get($this->_url,array('timeout'=>300)); %%//%%set a long time out
+ if($username !== "" and $password !== "")
+ $headers = array('Authorization'=>'Basic ' . base64_encode("$username:$password"));
+ $response = wp_remote_get($this->_url,array('timeout'=>300, 'headers'=>$headers)); %%//%%set a long time out
$this->_response = (is_wp_error($response) ? '' : $response);
}
@@ -128,4 +130,4 @@
$this->setResponseBody($responseBody);
}
}
-}
\ No newline at end of file
+}
--- views/options-page.phtml 2014-03-01 17:48:34.224738002 -0500
+++ views/options-page.phtml.new 2014-03-01 18:03:29.004737897 -0500
@@ -23,6 +23,24 @@
+ requiresAuth == 1) echo "checked"; ?> /> + +
+ ++ + +
++ + +
+Die gegenwärtigen Setup-Instruktionen befinden sich momentam im Pad: https://codicill.us/p/UTSsdswX1q