Drupal: Difference between revisions

From Alpine Linux
(Created page with '== What is drupal? == 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-...')
 
(add composer dependencies)
 
(20 intermediate revisions by 6 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.
== Install lighttpd, PHP and MySql ==


== Set up drupal on Alpine Linux ==
{{:Setting Up Lighttpd With FastCGI}}


This document will be a quick c/p guide to setup MediaWiki on Alpine linux. What we will setup is the following:
Install extra packages:
{{Cmd|apk add mysql mysql-client php-mysql php-mysqli php-pdo_mysql php-session php-tokenizer php-simplexml php-xml php-gd php-dom php-opcache php-mbstring composer}}


* Lighttpd with PHP
{{note|The <code>php-mbstring</code> and <code>php-opcache</code> packages are optional. If they are not installed, the Drupal installer will show a warning.}}
* Mysql
* drupal


== Install lighttpd, PHP and MySql ==
== Installing and configuring drupal ==


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
Create a folder named {{Path|webapps}}


== Configuring Lighttpd==
{{Cmd|mkdir -p /usr/share/webapps/}}


'''Edit lighttpd.conf'''
Download the source code archive


nano +46 /etc/lighttpd/lighttpd.conf
{{Cmd|cd /usr/share/webapps/
wget https://ftp.drupal.org/files/projects/drupal-11.3.0-beta1.tar.gz}}


Uncomment lines:
{{tip|You can view the file names at https://ftp.drupal.org/files/projects/}}


uncoment    include "mod_fastcgi.conf", save and exit
Unpack the archive and delete the tarball afterwards


== Installing and configuring drupal ==
{{Cmd|tar zxvf drupal-11.3.0-beta1.tar.gz
 
rm drupal-11.3.0-beta1.tar.gz}}
'''Install drupal'''
 
Change the folder name
Download


cd /tmp
{{Cmd|mv drupal-11.3.0-beta1 drupal}}
wget http://ftp.drupal.org/files/projects/drupal-7.0-alpha6.tar.gz


Unpack
Change the folder permissions


tar zxvf drupal-7.0-alpha6.tar.gz
{{Cmd|chown -R lighttpd /usr/share/webapps/}}


Change Folder Name
Creating settings file


  mv drupal-7.0-alpha6 drupal
{{Cmd|cp /usr/share/webapps/drupal/sites/default/default.settings.php /usr/share/webapps/drupal/sites/default/settings.php}}
mv drupal /etc/


Change Folder Persmissions
To [https://www.drupal.org/docs/getting-started/installing-drupal/install-dependencies-with-composer Install dependencies with Composer], navigate to the Drupal root directory and run Composer.


  chmod -R 777 /etc/drupal/
{{Cmd|cd /usr/share/webapps/drupal/
composer install --no-dev}}


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


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


== Starting ==
== Starting ==
Line 55: Line 53:
'''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</nowiki>}}
/etc/init.d/mysql start && rc-update add mysql default
 
/usr/bin/mysqladmin -u root password 'password'
{{note|<code>/usr/bin/mysql_install_db</code>: Deprecated program name. It will be removed in a future release, use <code>mariadb-install-db</code> instead}}
 
{{cmd|<nowiki>rc-service mariadb start && rc-update add mariadb default
/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}}
{{note|<code>mysql</code>: Deprecated program name. It will be removed in a future release, use <code>/usr/bin/mariadb</code> instead}}
 
{{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
Browse to: <nowiki>http://WEBSERVER_IP_ADDRESS/drupal</nowiki> 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!


Install Drupal completing the information as appropriate from the web browser.
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!
Review the messages above before visiting your new site.
You have drupal cloud computing system working, to access go to <nowiki>http://WEBSERVER_IP_ADDRESS/drupal</nowiki> and enjoy!

Latest revision as of 15:49, 5 December 2025

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 php fcgi php-cgi

Configure Lighttpd

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

Contents of /etc/lighttpd/lighttpd.conf

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

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 php-session php-tokenizer php-simplexml php-xml php-gd php-dom php-opcache php-mbstring composer

Note: The php-mbstring and php-opcache packages are optional. If they are not installed, the Drupal installer will show a warning.

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-11.3.0-beta1.tar.gz

Tip: You can view the file names at https://ftp.drupal.org/files/projects/

Unpack the archive and delete the tarball afterwards

tar zxvf drupal-11.3.0-beta1.tar.gz rm drupal-11.3.0-beta1.tar.gz

Change the folder name

mv drupal-11.3.0-beta1 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

To Install dependencies with Composer, navigate to the Drupal root directory and run Composer.

cd /usr/share/webapps/drupal/ composer install --no-dev

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

Note: /usr/bin/mysql_install_db: Deprecated program name. It will be removed in a future release, use mariadb-install-db instead

rc-service mariadb start && rc-update add mariadb default /usr/bin/mysqladmin -u root password 'password'


Create the drupal database

mysql -u root -p

Note: mysql: Deprecated program name. It will be removed in a future release, use /usr/bin/mariadb instead

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!