Drupal: Difference between revisions

From Alpine Linux
No edit summary
(replace /etc/init.d with rc-service)
 
(11 intermediate revisions by 5 users not shown)
Line 1: Line 1:
== What is drupal? ==
[https://drupal.org/ Drupal] is a free and open source content management system (CMS) written in PHP and distributed under the GNU General Public License. It is used as a back-end system for at least 1% of all websites worldwide ranging from personal blogs to larger corporate and political sites including whitehouse.gov and data.gov.uk. It is also used for knowledge management and business collaboration.
 
Drupal is a free and open source content management system (CMS) written in PHP and distributed under the GNU General Public License. It is used as a back-end system for at least 1% of all websites worldwide ranging from personal blogs to larger corporate and political sites including whitehouse.gov and data.gov.uk. It is also used for knowledge management and business collaboration.
 
== Set up drupal on Alpine Linux ==
 
This document will be a quick c/p guide to setup Drupal on Alpine linux. What we will setup is the following:
 
* Lighttpd with PHP
* Mysql
* drupal


== Install lighttpd, PHP and MySql ==
== Install lighttpd, PHP and MySql ==


apk add lighttpd mysql mysql-client php-mysql php-mysqli php php-sqlite php-imap php-xml php-pdo php-json php-xml php-gd php-pdo_mysql
{{:Setting Up Lighttpd With FastCGI}}


== Configuring Lighttpd==
Install extra packages:
 
{{Cmd|apk add mysql mysql-client php-mysql php-mysqli php-pdo_mysql}}
'''Edit lighttpd.conf'''
 
nano +46 /etc/lighttpd/lighttpd.conf
 
Uncomment lines:
 
uncoment    include "mod_fastcgi.conf", save and exit


== Installing and configuring drupal ==
== Installing and configuring drupal ==


'''Install drupal'''
Create a folder named {{Path|webapps}}


Make webapps folder
{{Cmd|mkdir -p /usr/share/webapps/}}


mkdir /usr/share/webapps/ -p
Download the source code archive


Download
{{Cmd|cd /usr/share/webapps/
wget https://ftp.drupal.org/files/projects/drupal-7.19.tar.gz}}


cd /usr/share/webapps/
Unpack the archive and delete the tarball afterwards
wget http://ftp.drupal.org/files/projects/drupal-7.0-alpha6.tar.gz


Unpack and delete tar file
{{Cmd|tar zxvf drupal-7.19.tar.gz  
 
rm drupal-7.19.tar.gz}}
tar zxvf drupal-7.0-alpha6.tar.gz  
rm drupal-7.0-alpha6.tar.gz
   
   
Change Folder Name
Change the folder name


mv drupal-7.0-alpha6 drupal
{{Cmd|mv drupal-7.19 drupal}}


Creating settings file
Change the folder permissions


cp  /usr/share/webapps/drupal/sites/default/default.settings.php /usr/share/webapps/drupal/sites/default/settings.php
{{Cmd|chown -R lighttpd /usr/share/webapps/}}


Change Folder Persmissions
Creating settings file


  chmod -R 777 /usr/share/webapps/drupal
{{Cmd|cp /usr/share/webapps/drupal/sites/default/default.settings.php /usr/share/webapps/drupal/sites/default/settings.php}}


Make symlinks to Drupal
Create a symlink to the {{Path|drupal}} folder


ln -s /usr/share/webapps/glpi/ /var/www/localhost/htdocs/drupal
{{Cmd|ln -s /usr/share/webapps/drupal/ /var/www/localhost/htdocs/drupal}}


== Starting ==
== Starting ==
Line 63: Line 44:
'''Starting http service and adding to boot'''
'''Starting http service and adding to boot'''


/etc/init.d/lighttpd start && rc-update add lighttpd default
{{Cmd|rc-service lighttpd start && rc-update add lighttpd default}}




== Config MySql ==
== Config MySql ==


/usr/bin/mysql_install_db --user=mysql
{{Cmd|<nowiki>/usr/bin/mysql_install_db --user=mysql
/etc/init.d/mysql start && rc-update add mysql default
rc-service mysql start && rc-update add mysql default
/usr/bin/mysqladmin -u root password 'password'
/usr/bin/mysqladmin -u root password 'password'</nowiki>}}


'''Create the drupal database'''
'''Create the drupal database'''


mysql -u root -p
{{Cmd|mysql -u root -p}}
 
{{Cmd|CREATE DATABASE drupal;
GRANT ALL PRIVILEGES ON drupal.* TO "root";
FLUSH PRIVILEGES;
EXIT}}


CREATE DATABASE drupal;
GRANT ALL PRIVILEGES ON drupal.* TO "root";
FLUSH PRIVILEGES;
EXIT
 
== Config your drupal ==
== Config your drupal ==


Browse to: http://WEBSERVER_IP_ADDRESS/drupal and Install Drupal completing the information as appropriate from the web browser.
Browse to: <nowiki>http://WEBSERVER_IP_ADDRESS/drupal</nowiki> and Install Drupal completing the information as appropriate from the web browser.


Drupal Installation steps:
Drupal Installation steps:


Note: After select each option, pres "Save and continue" button.
Note: After select each option, pres "Save and continue" button.


1 - Select an installation profile
1 - Select an installation profile
Line 105: Line 85:


4 - Set up database
4 - Set up database
Database type MySQL
Database type MySQL


* Database name ''drupal''
* Database name ''drupal''
* Database username ''root''
* Database username ''root''
* Database password ''your-mysql-password''
* Database password ''your-mysql-password''


Line 117: Line 94:


* SITE INFORMATION
* SITE INFORMATION
 
:* Site name  
* Site name  
:* Site e-mail address
* Site e-mail address


* SITE MAINTENANCE ACCOUNT
* SITE MAINTENANCE ACCOUNT
 
:* Username
* Username
:* E-mail address
* E-mail address
:* Password
* Password
:* Confirm password
* Confirm password


* SERVER SETTINGS
* SERVER SETTINGS
 
:* Default country
* Default country
:* Default time zone
* Default time zone


* UPDATE NOTIFICATIONS
* UPDATE NOTIFICATIONS
 
:* Check for updates automatically
* Check for updates automatically
:* Receive e-mail notifications
* Receive e-mail notifications


After click on "Save and continue" you will see ''Drupal installation complete''
After click on "Save and continue" you will see ''Drupal installation complete''
Line 143: Line 116:


Review the messages above before visiting your '''new site'''.
Review the messages above before visiting your '''new site'''.


Review the messages above before visiting your new site.
Review the messages above before visiting your new site.
You have drupal cloud computing system working, to access go to http://WEBSERVER_IP_ADDRESS/drupal and enjoy!
You have drupal cloud computing system working, to access go to <nowiki>http://WEBSERVER_IP_ADDRESS/drupal</nowiki> and enjoy!

Latest revision as of 09:54, 17 November 2023

Drupal is a free and open source content management system (CMS) written in PHP and distributed under the GNU General Public License. It is used as a back-end system for at least 1% of all websites worldwide ranging from personal blogs to larger corporate and political sites including whitehouse.gov and data.gov.uk. It is also used for knowledge management and business collaboration.

Install lighttpd, PHP and MySql

Basic Installation

For installing the additional packages first activate community packages and update the package index

Install the required packages:

# apk add lighttpd php82 fcgi php82-cgi

Configure Lighttpd

Edit lighttpd.conf (/etc/lighttpd/lighttpd.conf) and uncomment the line:

Contents of /etc/lighttpd/lighttpd.conf

... include "mod_fastcgi.conf" ...

Edit mod_fastcgi.conf (/etc/lighttpd/mod_fastcgi.conf), find and change /usr/bin/php-cgi to /usr/bin/php-cgi82.

Contents of /etc/lighttpd/mod_fastcgi.conf

... "bin-path" => "/usr/bin/php-cgi82" # php-cgi ...

Start lighttpd service and add it to default runlevel

# rc-service lighttpd start # rc-update add lighttpd default

Install extra packages:

apk add mysql mysql-client php-mysql php-mysqli php-pdo_mysql

Installing and configuring drupal

Create a folder named webapps

mkdir -p /usr/share/webapps/

Download the source code archive

cd /usr/share/webapps/ wget https://ftp.drupal.org/files/projects/drupal-7.19.tar.gz

Unpack the archive and delete the tarball afterwards

tar zxvf drupal-7.19.tar.gz rm drupal-7.19.tar.gz

Change the folder name

mv drupal-7.19 drupal

Change the folder permissions

chown -R lighttpd /usr/share/webapps/

Creating settings file

cp /usr/share/webapps/drupal/sites/default/default.settings.php /usr/share/webapps/drupal/sites/default/settings.php

Create a symlink to the drupal folder

ln -s /usr/share/webapps/drupal/ /var/www/localhost/htdocs/drupal

Starting

Starting http service and adding to boot

rc-service lighttpd start && rc-update add lighttpd default


Config MySql

/usr/bin/mysql_install_db --user=mysql rc-service mysql start && rc-update add mysql default /usr/bin/mysqladmin -u root password 'password'

Create the drupal database

mysql -u root -p

CREATE DATABASE drupal; GRANT ALL PRIVILEGES ON drupal.* TO "root"; FLUSH PRIVILEGES; EXIT

Config your drupal

Browse to: http://WEBSERVER_IP_ADDRESS/drupal and Install Drupal completing the information as appropriate from the web browser.

Drupal Installation steps:

Note: After select each option, pres "Save and continue" button.

1 - Select an installation profile

  • Standard ( Install with commonly used features pre-configured.)
  • Minimal ( Start with only a few modules enabled.)

2 - Choose language

  • English (built-in)

3 - Verify requirements

  • (Nothing to do here if all is ok)

4 - Set up database Database type MySQL

  • Database name drupal
  • Database username root
  • Database password your-mysql-password

- 5 Configure site

  • SITE INFORMATION
  • Site name
  • Site e-mail address
  • SITE MAINTENANCE ACCOUNT
  • Username
  • E-mail address
  • Password
  • Confirm password
  • SERVER SETTINGS
  • Default country
  • Default time zone
  • UPDATE NOTIFICATIONS
  • Check for updates automatically
  • Receive e-mail notifications

After click on "Save and continue" you will see Drupal installation complete

Congratulations, you installed Drupal!

Review the messages above before visiting your new site.

Review the messages above before visiting your new site. You have drupal cloud computing system working, to access go to http://WEBSERVER_IP_ADDRESS/drupal and enjoy!