KDE.org/Local Setup: Difference between revisions

From KDE Community Wiki
(Update instruction)
(Replace outdated instructions with a link to README)
 
(13 intermediate revisions by 3 users not shown)
Line 3: Line 3:
[[Image:Webworld-128.png|right]]
[[Image:Webworld-128.png|right]]


== Setting up kde.org ==
== Introduction ==
This page will help you getting started improving the KDE websites. <s>Currently all pages are being ported to WordPress since it offers a full CMS.</s>
 
== Setting up kde.org (new fancy way) ==
 
You need svn, php-composer and docker installed.
 
Refer to instructions in the [https://websvn.kde.org/trunk/www/sites/www/README.md?view=markup README].
 
kde.org/applications, kde.org/fundraisers and kde.org/announcement/release are not yet supported. :(
 
You can submit a patch with arc using:


This was done with Arch Linux, PHP 7.3 and Apache 7.4. Expect minor change with another distribution.
arc diff --conduit-uri=https://phabricator.kde.org/


* Install apache and enable php-fpm (See https://wiki.archlinux.org/index.php/Apache_HTTP_Server#Using_php-fpm_and_mod_proxy_fcgi).
== Setting up kde.org (old way)==


* In {{Path|/var/www/}}, clone the following repository:
This was done with Arch Linux, PHP 7.3 and Apache 2.4. Expect minor change with another Linux distribution. You will also need [https://getcomposer.org/ Composer].
 
* First we need to install and enable apache and php-fpm (See https://wiki.archlinux.org/index.php/Apache_HTTP_Server#Using_php-fpm_and_mod_proxy_fcgi). We also need to enable virtual host.
 
* In {{Path|/var/www/}}, clone the following repositories:
{{Input|svn co svn://anonsvn.kde.org/home/kde/trunk/www/sites/www/ kde.org
{{Input|svn co svn://anonsvn.kde.org/home/kde/trunk/www/sites/www/ kde.org
git clone https://anongit.kde.org/websites/capacity
git clone https://anongit.kde.org/websites/capacity
Line 18: Line 33:
}}
}}


You should get following directory stucture:
The resulting directory structure should now look like this:
{{Output|├── capacity
{{Output|├── capacity
└── kde.org
└── kde.org
Line 26: Line 41:




* Create following vhost file
* Create the following vhost file in {{Path|/etc/httpd/conf/vhosts/kde.org.dom}} (Arch Linux)
{{Input|<VirtualHost *:80>
{{Input|<VirtualHost *:80>
     ServerName localhost
     ServerName localhost
Line 38: Line 53:
         Require all granted
         Require all granted
         FallbackResource /index.php
         FallbackResource /index.php
        DirectoryIndex index.php
     </Directory>
     </Directory>
</VirtualHost>}}
</VirtualHost>}}


* Enable the virtual host
* Enable the newly created virtual host. In Debian/Ubuntu with a2ensite, in Arch Linux by adding the following line to the config file: <code>Include conf/vhosts/kde.org.dom</code>


* In {{Path|/etc/php/php.ini}}, update the <code>include_path</code> variable.
* Update the <code>include_path</code> variable in the PHP config file, for example in {{Path|/etc/php/7.2/cli/php.ini}} (you can find out which file to use with the command <code>php -i | grep 'php.ini'</code>).
{{Input|1=include_path = ".:/php/includes:/var/www/capacity/includes:"}}
{{Input|1=include_path = ".:/php/includes:/var/www/capacity/includes:"}}
* Run <code>composer install</code> or (for a local composer setup) <code>php composer.phar install</code> to get all the other php dependencies.


* Restart the httpd and php-fpm services
* Restart the httpd and php-fpm services
Line 51: Line 69:
* Setup kde.org/applications. See [[KDE.org/applications]].
* Setup kde.org/applications. See [[KDE.org/applications]].


If the instruction didn't work for you, and you were able to fix it. Please add how you did it.
If the instruction didn't work for you, and you weren't able to fix it. Please contact [kde-promo at kde dot org] and ask for help.


If the instruction didn't work for you, and you weren't able to fix it. Please contact me carl at carlschwan dot eu.
If the instruction didn't work for you, but you were able to fix it. Please add how you did it to this article.


{{Note|The information below is mostly outdated.}}
{{Warning|The information below is mostly outdated.}}
== Introduction ==
This page will help you getting started improving the KDE websites. Currently all pages are being ported to WordPress since it offers a full CMS.


=== Prerequirements ===
=== Prerequirements ===

Latest revision as of 18:56, 31 January 2020

Introduction

This page will help you getting started improving the KDE websites. Currently all pages are being ported to WordPress since it offers a full CMS.

Setting up kde.org (new fancy way)

You need svn, php-composer and docker installed.

Refer to instructions in the README.

kde.org/applications, kde.org/fundraisers and kde.org/announcement/release are not yet supported. :(

You can submit a patch with arc using:

arc diff --conduit-uri=https://phabricator.kde.org/

Setting up kde.org (old way)

This was done with Arch Linux, PHP 7.3 and Apache 2.4. Expect minor change with another Linux distribution. You will also need Composer.

  • In /var/www/, clone the following repositories:
svn co svn://anonsvn.kde.org/home/kde/trunk/www/sites/www/ kde.org
git clone https://anongit.kde.org/websites/capacity
cd kde.org
git clone [email protected]:websites/kde-org-applications.git applications
cd applications
git clone [email protected]:websites/kde-org-applications-extractor.git

The resulting directory structure should now look like this:

├── capacity
└── kde.org
    └── applications
        └── kde-org-applications-extractor


  • Create the following vhost file in /etc/httpd/conf/vhosts/kde.org.dom (Arch Linux)
<VirtualHost *:80>
    ServerName localhost

    DocumentRoot /var/www/kde.org
    ErrorLog /var/log/httpd/kde.org-error.log
    CustomLog /var/log/httpd/kde.org.log combined

    <Directory /var/www/kde.org>
        AllowOverride All
        Require all granted
        FallbackResource /index.php
        DirectoryIndex index.php
    </Directory>
</VirtualHost>
  • Enable the newly created virtual host. In Debian/Ubuntu with a2ensite, in Arch Linux by adding the following line to the config file: Include conf/vhosts/kde.org.dom
  • Update the include_path variable in the PHP config file, for example in /etc/php/7.2/cli/php.ini (you can find out which file to use with the command php -i | grep 'php.ini').
include_path = ".:/php/includes:/var/www/capacity/includes:"
  • Run composer install or (for a local composer setup) php composer.phar install to get all the other php dependencies.
  • Restart the httpd and php-fpm services
systemctl restart httpd php-fpm

If the instruction didn't work for you, and you weren't able to fix it. Please contact [kde-promo at kde dot org] and ask for help.

If the instruction didn't work for you, but you were able to fix it. Please add how you did it to this article.

Warning

The information below is mostly outdated.


Prerequirements

You should have some things running on your machine already before starting. You will need:

  • Apache2 and the usual modules (php such as libapache2-mod-php5)
  • mysql

This could for example look like:

apt-get install apache2 libapache2-mod-php5 php5-mysql mysql-server

Make sure that it works by checking out localhost in a web browser.


You can modify the default setup to do the development in your home directory if it isn't already set up like that. Read up on apache if you want to. Some hints:

sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/kdesites
sudo a2ensite kdesites

The easiest will be to have all kde sites in a subfolder structure, such as:

~/public_html/kdesites/kde.org
~/public_html/kdesites/edu.kde.org

Thus point the apache setup to ~/public_html/kdesites

You can set up local subdomains in /etc/hosts

Setting up

For new sites we use WordPress. You should get the latest WordPress release from: wordpress.org

Simply unzip/tar the download in a sub-folder. Get WordPress working. Next after testing that wordpress works, check out the Neverland theme and create a symlink:

git clone git://anongit.kde.org/websites/neverland
cd neverland
git checkout devel # currently the devel branch is the right one, this might change
cd ../wordpress/wp-content/themes
ln -s ../../../neverland/themes/wordpress/neverland/ .

Check that you have the Neverland theme in wordpress. The header of the page will look a bit strange until you configured a menu in wordpress. Log in as administrator and use Appearance -> Menus to set it up. Also select Screen Options -> Description to be able to edit the menu description (second line of the header).