<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
	<id>https://feministwiki.org/fr/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Technician</id>
	<title>FeministWiki - Contributions [fr]</title>
	<link rel="self" type="application/atom+xml" href="https://feministwiki.org/fr/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Technician"/>
	<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/wiki/Sp%C3%A9cial:Contributions/Technician"/>
	<updated>2026-06-03T00:55:27Z</updated>
	<subtitle>Contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=Accueil&amp;diff=1207</id>
		<title>Accueil</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=Accueil&amp;diff=1207"/>
		<updated>2024-11-13T11:58:11Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Who&amp;#039;s behind the project? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageSeo&lt;br /&gt;
|description = Welcome to the FeministWiki, a digital platform for feminism consisting of a wiki, forum, chat, blog hosting, and more.&lt;br /&gt;
}}&lt;br /&gt;
&#039;&#039;Services: [https://blogs.feministwiki.org FeministBlog] - [https://files.feministwiki.org/ FeministFiles] - [https://mail.feministwiki.org/ FeministMail] - [https://forum.feministwiki.org/ FeministForum] - [https://chat.feministwiki.org/ FeministChat] - [[Help:IRC|FeministIRC]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Welcome to &#039;&#039;&#039;FeministWiki&#039;&#039;&#039;, a wiki and integrated digital platform for feminism.&lt;br /&gt;
&lt;br /&gt;
A wiki is a knowledge-base like an encyclopedia, but managed by the public.  The FeministWiki specializes on feminism, and is managed by feminists and their supporters.  It aims to archive and present information relevant to feminism, and explain feminist perspectives to the reader.&lt;br /&gt;
&lt;br /&gt;
Further, the FeministWiki aims to offer a complete integrated digital platform for feminists, with components such as a blogging platform, a discussion forum, a messaging/chat system, private and shared online storage for large files, and more.  You don&#039;t need to provide any personally identifying information to become a member, nor do you need to pay; the modest number of users makes the platform cheap to run.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to become a member:&lt;br /&gt;
* Use the [https://account.feministwiki.org/register.html Registration Request] form to ask for an account.&lt;br /&gt;
* Contact an existing member and have them create an account for you by using the [https://account.feministwiki.org/add-member.html Add Member] form.&lt;br /&gt;
* Ask for an account by manually contacting technician@feministwiki.org or by messaging an official social media account of the FeministWiki.&lt;br /&gt;
&lt;br /&gt;
Spinster: [https://spinster.xyz/@FeministWiki @FeministWiki] (preferred) &amp;lt;br/&amp;gt;&lt;br /&gt;
Twitter: [https://twitter.com/@FeministWiki @FeministWiki] &amp;lt;br/&amp;gt;&lt;br /&gt;
Facebook: [https://www.facebook.com/FeministWiki/ FeministWiki]&lt;br /&gt;
&lt;br /&gt;
Once you are a member, you will be given a username and password with which you can log in to all FeministWiki services.  For example, to log in to the wiki itself (which you are reading right now), use the small &amp;quot;Log in&amp;quot; link at the top right of the page.&lt;br /&gt;
&lt;br /&gt;
See the &#039;&#039;&#039;[[FW:Welcome|Welcome page]]&#039;&#039;&#039; for further information on the FeministWiki, written with new members in mind.&lt;br /&gt;
&lt;br /&gt;
Heads up: &#039;&#039;&#039;the FeministWiki needs you&#039;&#039;&#039;.  All of the technical infrastructure of the FeministWiki is only useful if there&#039;s a community making use of it, and content on the wiki doesn&#039;t write itself!  Be bold, don&#039;t shy off of asking for membership, and let the community and the world benefit from your added knowledge.  You can become a member even if you have no intention to contribute to the actual wiki; feel free to chat away with other members, discuss matters important to you on the forum, or use the file storage to have a central place to store your favorite information-material on feminism.&lt;br /&gt;
&lt;br /&gt;
== Check out some articles ==&lt;br /&gt;
&lt;br /&gt;
=== Notable feminists ===&lt;br /&gt;
&lt;br /&gt;
* [[Magdalen Berns]]&lt;br /&gt;
&lt;br /&gt;
=== Sex, gender, and trans activism ===&lt;br /&gt;
&lt;br /&gt;
* [[Gender]]&lt;br /&gt;
* [[Transgender ideology]]&lt;br /&gt;
* [[Cisgender]]&lt;br /&gt;
* [[Autogynephilia]]&lt;br /&gt;
* [[TERF]]&lt;br /&gt;
* [[Transwomen in women&#039;s sports]]&lt;br /&gt;
&lt;br /&gt;
=== Sex industry ===&lt;br /&gt;
&lt;br /&gt;
* [[Nordic Model]]&lt;br /&gt;
&lt;br /&gt;
=== Black feminism ===&lt;br /&gt;
&lt;br /&gt;
* [[Black feminism]]&lt;br /&gt;
&lt;br /&gt;
== What is feminism? ==&lt;br /&gt;
&lt;br /&gt;
There are a variety of ideological groupings which call themselves feminism, and some of them are in contradiction with each other.  As such, one cannot support all types of feminism at the same time.  The FeministWiki is for people who adhere to a relatively straightforward and classical interpretation of feminism: the liberation of female people from male supremacism.  This is sometimes called &#039;&#039;radical feminism&#039;&#039; because male supremacism is a radical notion for many people, and its elimination requires radical changes to society.&lt;br /&gt;
&lt;br /&gt;
Male supremacism refers to social and political systems that use stereotypes, myths, discrimination, belittlement, violence, and other means to keep men in power and women oppressed.  Women are then exploited for reproductive and domestic labor, men&#039;s sexual gratification, and more.  Male supremacism also causes collateral damage to some men and boys.  For instance, effeminate boys and gay men are often targeted with punishment for failing to uphold the myth that men are inherently masculine.&lt;br /&gt;
&lt;br /&gt;
The FeministWiki promotes second-wave feminist literature:&lt;br /&gt;
&lt;br /&gt;
* [https://radfem.org/ Radical Feminist Archives]&lt;br /&gt;
&lt;br /&gt;
The FeministWiki is in full support of the Women&#039;s Human Rights Campaign:&lt;br /&gt;
&lt;br /&gt;
* [https://www.womensdeclaration.com/ Declaration on Women&#039;s Sex-Based Rights]&lt;br /&gt;
&lt;br /&gt;
The FeministWiki recommends Spinster as a feminism-friendly social media platform:&lt;br /&gt;
&lt;br /&gt;
* [https://spinster.xyz Spinster.xyz]&lt;br /&gt;
&lt;br /&gt;
Further, the FeministWiki promotes and stands in solidarity with the following groups and organizations:&lt;br /&gt;
&lt;br /&gt;
* [http://lgballiance.org.uk LGB Alliance]: The LGB Alliance&lt;br /&gt;
* [http://womensliberationfront.org/ WoLF]: The Women&#039;s Liberation Front&lt;br /&gt;
* [https://feministcurrent.com/ Feminist Current]: Canadian feminist news, commentary, and podcasts&lt;br /&gt;
* [https://www.rapereliefshelter.bc.ca/ Vancouver Rape Relief]: Female-only rape-relief and women&#039;s shelter&lt;br /&gt;
* [https://nordicmodelnow.org/ Nordic Model Now]: Educational movement for the abolition of prostitution&lt;br /&gt;
* [http://www.spaceintl.org/ SPACE International]: Survivors of Prostitution Abuse Calling for Enlightenment&lt;br /&gt;
* [https://womansplaceuk.org/ Woman&#039;s Place UK]: Women&#039;s campaigning group scrutinizing gender self-identification&lt;br /&gt;
* [https://speakupforwomen.nz/ Speak Up for Women]: New Zealand group opposing gender self-identification&lt;br /&gt;
* [https://feministstruggle.org/ Feminists in Struggle - FIST]: US-based female-only radical feminist network&lt;br /&gt;
* [https://pussychurchofmodernwitchcraft.com/ The Pussy Church of Modern Witchcraft]: Lesbian-led Church for Women and Girls&lt;br /&gt;
&lt;br /&gt;
== Who&#039;s behind the project? ==&lt;br /&gt;
&lt;br /&gt;
The FeministWiki platform is offered to the public for free by the German LLC &#039;&#039;&#039;WikiWiz UG (haftungsbeschränkt)&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
For legal inquiries please contact info@feministwiki.org or feministwiki@gmail.com.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Language links --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[de:Hauptseite]] [[en:Main_Page]] [[es:Página_principal]] [[it:Pagina_principale]] [[pt:Página_principal]]&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=Accueil&amp;diff=1205</id>
		<title>Accueil</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=Accueil&amp;diff=1205"/>
		<updated>2022-08-30T09:04:48Z</updated>

		<summary type="html">&lt;p&gt;Technician : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageSeo&lt;br /&gt;
|description = Welcome to the FeministWiki, a digital platform for feminism consisting of a wiki, forum, chat, blog hosting, and more.&lt;br /&gt;
}}&lt;br /&gt;
&#039;&#039;Services: [https://blogs.feministwiki.org FeministBlog] - [https://files.feministwiki.org/ FeministFiles] - [https://mail.feministwiki.org/ FeministMail] - [https://forum.feministwiki.org/ FeministForum] - [https://chat.feministwiki.org/ FeministChat] - [[Help:IRC|FeministIRC]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Welcome to &#039;&#039;&#039;FeministWiki&#039;&#039;&#039;, a wiki and integrated digital platform for feminism.&lt;br /&gt;
&lt;br /&gt;
A wiki is a knowledge-base like an encyclopedia, but managed by the public.  The FeministWiki specializes on feminism, and is managed by feminists and their supporters.  It aims to archive and present information relevant to feminism, and explain feminist perspectives to the reader.&lt;br /&gt;
&lt;br /&gt;
Further, the FeministWiki aims to offer a complete integrated digital platform for feminists, with components such as a blogging platform, a discussion forum, a messaging/chat system, private and shared online storage for large files, and more.  You don&#039;t need to provide any personally identifying information to become a member, nor do you need to pay; the modest number of users makes the platform cheap to run.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to become a member:&lt;br /&gt;
* Use the [https://account.feministwiki.org/register.html Registration Request] form to ask for an account.&lt;br /&gt;
* Contact an existing member and have them create an account for you by using the [https://account.feministwiki.org/add-member.html Add Member] form.&lt;br /&gt;
* Ask for an account by manually contacting technician@feministwiki.org or by messaging an official social media account of the FeministWiki.&lt;br /&gt;
&lt;br /&gt;
Spinster: [https://spinster.xyz/@FeministWiki @FeministWiki] (preferred) &amp;lt;br/&amp;gt;&lt;br /&gt;
Twitter: [https://twitter.com/@FeministWiki @FeministWiki] &amp;lt;br/&amp;gt;&lt;br /&gt;
Facebook: [https://www.facebook.com/FeministWiki/ FeministWiki]&lt;br /&gt;
&lt;br /&gt;
Once you are a member, you will be given a username and password with which you can log in to all FeministWiki services.  For example, to log in to the wiki itself (which you are reading right now), use the small &amp;quot;Log in&amp;quot; link at the top right of the page.&lt;br /&gt;
&lt;br /&gt;
See the &#039;&#039;&#039;[[FW:Welcome|Welcome page]]&#039;&#039;&#039; for further information on the FeministWiki, written with new members in mind.&lt;br /&gt;
&lt;br /&gt;
Heads up: &#039;&#039;&#039;the FeministWiki needs you&#039;&#039;&#039;.  All of the technical infrastructure of the FeministWiki is only useful if there&#039;s a community making use of it, and content on the wiki doesn&#039;t write itself!  Be bold, don&#039;t shy off of asking for membership, and let the community and the world benefit from your added knowledge.  You can become a member even if you have no intention to contribute to the actual wiki; feel free to chat away with other members, discuss matters important to you on the forum, or use the file storage to have a central place to store your favorite information-material on feminism.&lt;br /&gt;
&lt;br /&gt;
== Check out some articles ==&lt;br /&gt;
&lt;br /&gt;
=== Notable feminists ===&lt;br /&gt;
&lt;br /&gt;
* [[Magdalen Berns]]&lt;br /&gt;
&lt;br /&gt;
=== Sex, gender, and trans activism ===&lt;br /&gt;
&lt;br /&gt;
* [[Gender]]&lt;br /&gt;
* [[Transgender ideology]]&lt;br /&gt;
* [[Cisgender]]&lt;br /&gt;
* [[Autogynephilia]]&lt;br /&gt;
* [[TERF]]&lt;br /&gt;
* [[Transwomen in women&#039;s sports]]&lt;br /&gt;
&lt;br /&gt;
=== Sex industry ===&lt;br /&gt;
&lt;br /&gt;
* [[Nordic Model]]&lt;br /&gt;
&lt;br /&gt;
=== Black feminism ===&lt;br /&gt;
&lt;br /&gt;
* [[Black feminism]]&lt;br /&gt;
&lt;br /&gt;
== What is feminism? ==&lt;br /&gt;
&lt;br /&gt;
There are a variety of ideological groupings which call themselves feminism, and some of them are in contradiction with each other.  As such, one cannot support all types of feminism at the same time.  The FeministWiki is for people who adhere to a relatively straightforward and classical interpretation of feminism: the liberation of female people from male supremacism.  This is sometimes called &#039;&#039;radical feminism&#039;&#039; because male supremacism is a radical notion for many people, and its elimination requires radical changes to society.&lt;br /&gt;
&lt;br /&gt;
Male supremacism refers to social and political systems that use stereotypes, myths, discrimination, belittlement, violence, and other means to keep men in power and women oppressed.  Women are then exploited for reproductive and domestic labor, men&#039;s sexual gratification, and more.  Male supremacism also causes collateral damage to some men and boys.  For instance, effeminate boys and gay men are often targeted with punishment for failing to uphold the myth that men are inherently masculine.&lt;br /&gt;
&lt;br /&gt;
The FeministWiki promotes second-wave feminist literature:&lt;br /&gt;
&lt;br /&gt;
* [https://radfem.org/ Radical Feminist Archives]&lt;br /&gt;
&lt;br /&gt;
The FeministWiki is in full support of the Women&#039;s Human Rights Campaign:&lt;br /&gt;
&lt;br /&gt;
* [https://www.womensdeclaration.com/ Declaration on Women&#039;s Sex-Based Rights]&lt;br /&gt;
&lt;br /&gt;
The FeministWiki recommends Spinster as a feminism-friendly social media platform:&lt;br /&gt;
&lt;br /&gt;
* [https://spinster.xyz Spinster.xyz]&lt;br /&gt;
&lt;br /&gt;
Further, the FeministWiki promotes and stands in solidarity with the following groups and organizations:&lt;br /&gt;
&lt;br /&gt;
* [http://lgballiance.org.uk LGB Alliance]: The LGB Alliance&lt;br /&gt;
* [http://womensliberationfront.org/ WoLF]: The Women&#039;s Liberation Front&lt;br /&gt;
* [https://feministcurrent.com/ Feminist Current]: Canadian feminist news, commentary, and podcasts&lt;br /&gt;
* [https://www.rapereliefshelter.bc.ca/ Vancouver Rape Relief]: Female-only rape-relief and women&#039;s shelter&lt;br /&gt;
* [https://nordicmodelnow.org/ Nordic Model Now]: Educational movement for the abolition of prostitution&lt;br /&gt;
* [http://www.spaceintl.org/ SPACE International]: Survivors of Prostitution Abuse Calling for Enlightenment&lt;br /&gt;
* [https://womansplaceuk.org/ Woman&#039;s Place UK]: Women&#039;s campaigning group scrutinizing gender self-identification&lt;br /&gt;
* [https://speakupforwomen.nz/ Speak Up for Women]: New Zealand group opposing gender self-identification&lt;br /&gt;
* [https://feministstruggle.org/ Feminists in Struggle - FIST]: US-based female-only radical feminist network&lt;br /&gt;
* [https://pussychurchofmodernwitchcraft.com/ The Pussy Church of Modern Witchcraft]: Lesbian-led Church for Women and Girls&lt;br /&gt;
&lt;br /&gt;
== Who&#039;s behind the project? ==&lt;br /&gt;
&lt;br /&gt;
The FeministWiki platform is offered to the public by the German non-profit organization &#039;&#039;&#039;FeministWiki gemeinnützige UG (haftungsbeschränkt)&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The FeministWiki g. UG is bound by German law to abide by the following mission statement (translated from German):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
1. The company exclusively and directly pursues charitable purposes within the meaning of the section &amp;quot;tax-privileged purposes&amp;quot; of the tax code (AO). The purpose of the company is to promote equality between women and men.&lt;br /&gt;
&lt;br /&gt;
2. The purpose of the statutes is achieved by operating an online platform called feministwiki.org. The platform serves as an information center on the subject of feminism, as well as a communication platform for people who want to stand up for the rights of women. &lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The technical infrastructure is managed by [[FW:Technician|the technician]], who also offers user support.  For support, please contact technician@feministwiki.org.&lt;br /&gt;
&lt;br /&gt;
For legal inquiries please contact info@feministwiki.org or feministwiki@gmail.com.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Language links --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[de:Hauptseite]] [[en:Main_Page]] [[es:Página_principal]] [[it:Pagina_principale]] [[pt:Página_principal]]&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=Accueil&amp;diff=1204</id>
		<title>Accueil</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=Accueil&amp;diff=1204"/>
		<updated>2022-08-30T07:19:09Z</updated>

		<summary type="html">&lt;p&gt;Technician : Technician a déplacé la page Main Page vers Accueil sans laisser de redirection&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageSeo&lt;br /&gt;
|description = Welcome to the FeministWiki, a digital platform for feminism consisting of a wiki, forum, chat, blog hosting, and more.&lt;br /&gt;
}}&lt;br /&gt;
&#039;&#039;Services: [https://blogs.feministwiki.org FeministBlog] - [https://files.feministwiki.org/ FeministFiles] - [https://mail.feministwiki.org/ FeministMail] - [https://forum.feministwiki.org/ FeministForum] - [https://chat.feministwiki.org/ FeministChat] - [[Help:IRC|FeministIRC]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Welcome to &#039;&#039;&#039;FeministWiki&#039;&#039;&#039;, a wiki and integrated digital platform for feminism.&lt;br /&gt;
&lt;br /&gt;
A wiki is a knowledge-base like an encyclopedia, but managed by the public.  The FeministWiki specializes on feminism, and is managed by feminists and their supporters.  It aims to archive and present information relevant to feminism, and explain feminist perspectives to the reader.&lt;br /&gt;
&lt;br /&gt;
Further, the FeministWiki aims to offer a complete integrated digital platform for feminists, with components such as a blogging platform, a discussion forum, a messaging/chat system, private and shared online storage for large files, and more.  You don&#039;t need to provide any personally identifying information to become a member, nor do you need to pay; the modest number of users makes the platform cheap to run.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to become a member:&lt;br /&gt;
* Use the [https://account.feministwiki.org/register.html Registration Request] form to ask for an account.&lt;br /&gt;
* Contact an existing member and have them create an account for you by using the [https://account.feministwiki.org/add-member.html Add Member] form.&lt;br /&gt;
* Ask for an account by manually contacting technician@feministwiki.org or by messaging an official social media account of the FeministWiki.&lt;br /&gt;
&lt;br /&gt;
Spinster: [https://spinster.xyz/@FeministWiki @FeministWiki] (preferred) &amp;lt;br/&amp;gt;&lt;br /&gt;
Twitter: [https://twitter.com/@FeministWiki @FeministWiki] &amp;lt;br/&amp;gt;&lt;br /&gt;
Facebook: [https://www.facebook.com/FeministWiki/ FeministWiki]&lt;br /&gt;
&lt;br /&gt;
Once you are a member, you will be given a username and password with which you can log in to all FeministWiki services.  For example, to log in to the wiki itself (which you are reading right now), use the small &amp;quot;Log in&amp;quot; link at the top right of the page.&lt;br /&gt;
&lt;br /&gt;
See the &#039;&#039;&#039;[[FW:Welcome|Welcome page]]&#039;&#039;&#039; for further information on the FeministWiki, written with new members in mind.&lt;br /&gt;
&lt;br /&gt;
Heads up: &#039;&#039;&#039;the FeministWiki needs you&#039;&#039;&#039;.  All of the technical infrastructure of the FeministWiki is only useful if there&#039;s a community making use of it, and content on the wiki doesn&#039;t write itself!  Be bold, don&#039;t shy off of asking for membership, and let the community and the world benefit from your added knowledge.  You can become a member even if you have no intention to contribute to the actual wiki; feel free to chat away with other members, discuss matters important to you on the forum, or use the file storage to have a central place to store your favorite information-material on feminism.&lt;br /&gt;
&lt;br /&gt;
== Check out some articles ==&lt;br /&gt;
&lt;br /&gt;
=== Notable feminists ===&lt;br /&gt;
&lt;br /&gt;
* [[Magdalen Berns]]&lt;br /&gt;
&lt;br /&gt;
=== Sex, gender, and trans activism ===&lt;br /&gt;
&lt;br /&gt;
* [[Gender]]&lt;br /&gt;
* [[Transgender ideology]]&lt;br /&gt;
* [[Cisgender]]&lt;br /&gt;
* [[Autogynephilia]]&lt;br /&gt;
* [[TERF]]&lt;br /&gt;
* [[Transwomen in women&#039;s sports]]&lt;br /&gt;
&lt;br /&gt;
=== Sex industry ===&lt;br /&gt;
&lt;br /&gt;
* [[Nordic Model]]&lt;br /&gt;
&lt;br /&gt;
=== Black feminism ===&lt;br /&gt;
&lt;br /&gt;
* [[Black feminism]]&lt;br /&gt;
&lt;br /&gt;
== What is feminism? ==&lt;br /&gt;
&lt;br /&gt;
There are a variety of ideological groupings which call themselves feminism, and some of them are in contradiction with each other.  As such, one cannot support all types of feminism at the same time.  The FeministWiki is for people who adhere to a relatively straightforward and classical interpretation of feminism: the liberation of female people from male supremacism.  This is sometimes called &#039;&#039;radical feminism&#039;&#039; because male supremacism is a radical notion for many people, and its elimination requires radical changes to society.&lt;br /&gt;
&lt;br /&gt;
Male supremacism refers to social and political systems that use stereotypes, myths, discrimination, belittlement, violence, and other means to keep men in power and women oppressed.  Women are then exploited for reproductive and domestic labor, men&#039;s sexual gratification, and more.  Male supremacism also causes collateral damage to some men and boys.  For instance, effeminate boys and gay men are often targeted with punishment for failing to uphold the myth that men are inherently masculine.&lt;br /&gt;
&lt;br /&gt;
The FeministWiki promotes second-wave feminist literature:&lt;br /&gt;
&lt;br /&gt;
* [https://radfem.org/ Radical Feminist Archives]&lt;br /&gt;
&lt;br /&gt;
The FeministWiki is in full support of the Women&#039;s Human Rights Campaign:&lt;br /&gt;
&lt;br /&gt;
* [https://www.womensdeclaration.com/ Declaration on Women&#039;s Sex-Based Rights]&lt;br /&gt;
&lt;br /&gt;
The FeministWiki recommends Spinster as a feminism-friendly social media platform:&lt;br /&gt;
&lt;br /&gt;
* [https://spinster.xyz Spinster.xyz]&lt;br /&gt;
&lt;br /&gt;
Further, the FeministWiki promotes and stands in solidarity with the following groups and organizations:&lt;br /&gt;
&lt;br /&gt;
* [http://lgballiance.org.uk LGB Alliance]: The LGB Alliance&lt;br /&gt;
* [http://womensliberationfront.org/ WoLF]: The Women&#039;s Liberation Front&lt;br /&gt;
* [https://feministcurrent.com/ Feminist Current]: Canadian feminist news, commentary, and podcasts&lt;br /&gt;
* [https://www.rapereliefshelter.bc.ca/ Vancouver Rape Relief]: Female-only rape-relief and women&#039;s shelter&lt;br /&gt;
* [https://nordicmodelnow.org/ Nordic Model Now]: Educational movement for the abolition of prostitution&lt;br /&gt;
* [http://www.spaceintl.org/ SPACE International]: Survivors of Prostitution Abuse Calling for Enlightenment&lt;br /&gt;
* [https://womansplaceuk.org/ Woman&#039;s Place UK]: Women&#039;s campaigning group scrutinizing gender self-identification&lt;br /&gt;
* [https://speakupforwomen.nz/ Speak Up for Women]: New Zealand group opposing gender self-identification&lt;br /&gt;
* [https://feministstruggle.org/ Feminists in Struggle - FIST]: US-based female-only radical feminist network&lt;br /&gt;
* [https://pussychurchofmodernwitchcraft.com/ The Pussy Church of Modern Witchcraft]: Lesbian-led Church for Women and Girls&lt;br /&gt;
&lt;br /&gt;
== Who&#039;s behind the project? ==&lt;br /&gt;
&lt;br /&gt;
The FeministWiki platform is offered to the public by the German non-profit organization &#039;&#039;&#039;FeministWiki gemeinnützige UG (haftungsbeschränkt)&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The FeministWiki g. UG is bound by German law to abide by the following mission statement (translated from German):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
1. The company exclusively and directly pursues charitable purposes within the meaning of the section &amp;quot;tax-privileged purposes&amp;quot; of the tax code (AO). The purpose of the company is to promote equality between women and men.&lt;br /&gt;
&lt;br /&gt;
2. The purpose of the statutes is achieved by operating an online platform called feministwiki.org. The platform serves as an information center on the subject of feminism, as well as a communication platform for people who want to stand up for the rights of women. &lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The technical infrastructure is managed by [[FW:Technician|the technician]], who also offers user support.  For support, please contact technician@feministwiki.org.&lt;br /&gt;
&lt;br /&gt;
For legal inquiries please contact info@feministwiki.org or feministwiki@gmail.com.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Language links --&amp;gt;&lt;br /&gt;
[[de:Hauptseite]] [[pt:Página_principal]]&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Privacy_policy&amp;diff=1203</id>
		<title>FeministWiki:Privacy policy</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Privacy_policy&amp;diff=1203"/>
		<updated>2022-06-19T13:03:00Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Activity data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Privacy Policy =&lt;br /&gt;
&lt;br /&gt;
The entity responsible in the context of data protection laws, in particular the EU General Data Protection Regulation (GDPR), is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FeministWiki gemeinnützige UG (haftungsbeschränkt)&lt;br /&gt;
Richard-Wagner-Str. 25&lt;br /&gt;
DE-35321 Laubach&lt;br /&gt;
&lt;br /&gt;
District court Giessen, HRB 10100&lt;br /&gt;
&lt;br /&gt;
Legal correspondent: Taylan Ulrich Kammer&lt;br /&gt;
&lt;br /&gt;
Email: info@feministwiki.org&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Your rights as a data subject ===&lt;br /&gt;
&lt;br /&gt;
You can exercise the following rights at any time using the contact details of our data protection officer:&lt;br /&gt;
&lt;br /&gt;
* Information about your data stored by us and their processing (Art. 15 GDPR),&lt;br /&gt;
* Correction of incorrect personal data (Art. 16 GDPR),&lt;br /&gt;
* Deletion of your data stored by us (Art. 17 GDPR),&lt;br /&gt;
* Restriction of data processing if we are not yet allowed to delete your data due to legal obligations (Art. 18 GDPR),&lt;br /&gt;
* Objection to the processing of your data by us (Art. 21 GDPR) and&lt;br /&gt;
* Data portability, provided you have consented to the data processing or have concluded a contract with us (Art. 20 GDPR).&lt;br /&gt;
&lt;br /&gt;
If you have given us your consent, you can revoke it at any time with effect for the future.&lt;br /&gt;
&lt;br /&gt;
You can contact a supervisory authority with a complaint at any time, e.g. to the responsible supervisory authority of the federal state of your place of residence or to the authority responsible for us as the responsible body.&lt;br /&gt;
&lt;br /&gt;
A list of the supervisory authorities (for the non-public area) with addresses can be found at: https://www.bfdi.bund.de/DE/Infothek/Anschriften_Links/anschriften_links-node.html.&lt;br /&gt;
&lt;br /&gt;
=== Changes to our privacy policy ===&lt;br /&gt;
&lt;br /&gt;
We reserve the right to adapt this data protection declaration so that it always complies with current legal requirements or to implement changes to our services in the data protection declaration, e.g. when introducing new services. The new data protection declaration will then apply to your next visit.&lt;br /&gt;
&lt;br /&gt;
=== Embedded content from other websites ===&lt;br /&gt;
&lt;br /&gt;
Articles on this website may refer to other content (links).&lt;br /&gt;
&lt;br /&gt;
These websites can collect data about you, use cookies, embed additional tracking services from third parties and your interaction with the embedded content, if you have an account and are logged in to this website.&lt;br /&gt;
&lt;br /&gt;
=== Liability for content ===&lt;br /&gt;
&lt;br /&gt;
The articles that can be called up on the website are for general information only and not for advice in specific cases. We endeavor to ensure that all information and data contained on the website are correct and up to date in accordance with Section 7 (1) of the German Telemedia Act. For the correctness, completeness, up-to-dateness or quality of the information and data provided, no guarantee is given according to Sections 8 to 10 of the Act. Liability for the content of the information that can be accessed is excluded unless it is intentional or grossly negligent incorrect information. Obligations to remove or block the use of information under general law remain unaffected. Liability in this regard is only possible from the point in time at which we become aware of a specific legal violation. As soon as we become aware of such legal violations, we will remove this content immediately.&lt;br /&gt;
&lt;br /&gt;
=== Liability for links ===&lt;br /&gt;
&lt;br /&gt;
We are not responsible for the content of websites that can be reached via a hyperlink. The operators of the linked pages are solely responsible for their content. We expressly do not adopt the content of these Internet pages as our own and can therefore not guarantee the correctness, completeness and availability of the content. When the link was first established, we checked the third-party content to see whether it might trigger civil or criminal liability. However, we are not obliged to constantly check the content to which we refer in our offer for changes that could give rise to new responsibility. Only if we discover or are informed by others that a specific offer to which we have provided a link triggers civil or criminal liability, we will remove the reference to this offer, insofar as this is technically possible and reasonable for us.&lt;br /&gt;
&lt;br /&gt;
=== Copyright ===&lt;br /&gt;
&lt;br /&gt;
The content and works on this website created by the operator of this website are subject to German copyright law. All contributions from third parties are marked as such. The duplication, processing, distribution and any kind of exploitation outside the limits of copyright require the written consent of the respective author or creator. Copies of these pages are only permitted for private use, but not for commercial purposes.&lt;br /&gt;
&lt;br /&gt;
=== Data protection ===&lt;br /&gt;
&lt;br /&gt;
As a rule, our website can be used without providing personal data. Insofar as personal data (e.g. name, address or email address) is collected on our website, this is always done on a voluntary basis as far as possible. These data will not be passed on to third parties without your express consent.&lt;br /&gt;
&lt;br /&gt;
In connection with your access, data is temporarily stored in our server for the purpose of data security, which may allow identification (website visited, time of access, amount of data sent in bytes, source / reference from which you came to the page, browser used, operating system used, visible IP address). The data collected are only used for statistical evaluations. However, we reserve the right to check server log files retrospectively if there are concrete indications of illegal use. An evaluation, with the exception of statistical purposes in anonymous form, does not take place.&lt;br /&gt;
&lt;br /&gt;
= In lay terms =&lt;br /&gt;
&lt;br /&gt;
This section does not constitute a legal privacy policy.  This is an honest summary of everything you might want to know about the FeministWiki and privacy, explained in lay terms instead of legalese.&lt;br /&gt;
&lt;br /&gt;
Data stored by the FeministWiki could be split in two categories: data stored about your account, and data generated by your usage of FeministWiki services like opening pages, editing pages, using the chat system, or uploading files.&lt;br /&gt;
&lt;br /&gt;
== Account data ==&lt;br /&gt;
&lt;br /&gt;
At its core, the FeministWiki doesn&#039;t save anything about you other than your chosen username, a &amp;quot;cryptographic hash&amp;quot; of your current password, and the username of the member who added you.  In addition, it can save an e-mail address and a &amp;quot;display name&amp;quot; of your choosing, if you enter these in the account settings page or provide them in the account request form.  A detailed listing of all data stored in relation to your FeministWiki account follows.&lt;br /&gt;
&lt;br /&gt;
=== The username ===&lt;br /&gt;
&lt;br /&gt;
Your username doesn&#039;t need to correspond to your real identity in any way.  If it does, note that other members can see it in some places such as the list of names in the chat service.  It&#039;s almost impossible to keep 100% of malicious people from getting a FeministWiki membership, so a malicious person could end up seeing your username too.  Furthermore, if you edit the wiki, post on public parts of the forum, publish a FeministWiki blog post etc., then your username will be publicly visible.  If this is a problem for you, please contact the technician to change your username to one that doesn&#039;t relate to your real identity.&lt;br /&gt;
&lt;br /&gt;
=== The password ===&lt;br /&gt;
&lt;br /&gt;
Your password is not saved in plain text.  Rather, a &amp;quot;salted SHA1 hash&amp;quot; of your password is saved.  In layperson terms, this means: even in case of a data leak, attackers won&#039;t immediately know your password, though it&#039;s technically possible for them to figure it out if they spend a lot of time processing the leaked data.  For this reason, the password you use here should not be a very important one, such as the password you use for online banking.  (This issue applies to almost all websites that use passwords; the FeministWiki is not any less secure in this regard than other websites.)  All FeministWiki services use encrypted communication, so your password doesn&#039;t travel over the network in plain text either.&lt;br /&gt;
&lt;br /&gt;
=== The member who added you ===&lt;br /&gt;
&lt;br /&gt;
The username of the FeministWiki member who created your account is visible to the [[FW:Technician|technician]], if she/he cares to look it up from the internally kept database.&lt;br /&gt;
&lt;br /&gt;
=== Your regular e-mail address ===&lt;br /&gt;
&lt;br /&gt;
In the account settings, you can set an e-mail address that should be associated with your FeministWiki account instead of the default address of &#039;&#039;(username)@feministwiki.org&#039;&#039;.  (In the account request form, this corresponds to the address you provide in the first e-mail input field.)  While this address won&#039;t be listed publicly anywhere, it&#039;s possible that other FeministWiki members may see it.  Given that it&#039;s practically impossible to keep out 100% of malicious persons from getting a FeministWiki member account, you should consider the risk that a malicious person will see this e-mail address.  As such, consider not providing one and just using the &#039;&#039;(username)@feministwiki.org&#039;&#039; address provided by the FeministWiki, or providing one that cannot be traced to your real identity, if keeping your identity hidden is important to you.&lt;br /&gt;
&lt;br /&gt;
=== Your recovery e-mail address ===&lt;br /&gt;
&lt;br /&gt;
Also in the account settings, you can provide a secondary, hidden e-mail address that will be used solely for account recovery in case you forget your FeministWiki password.  This address is only visible to the [[FW:Technician|technician]].  However, despite state of the art security measures, please note that a data leak can never be ruled out 100%, so if keeping your identity secret is very important to you, consider leaving this empty and instead taking good care of your password, or using an address that can&#039;t be traced to your real identity.&lt;br /&gt;
&lt;br /&gt;
=== Data provided in the account request form ===&lt;br /&gt;
&lt;br /&gt;
If you use the account registration/request form, if you leave out the primary e-mail address field, you are asked to fill out a secondary e-mail field so your account request can be responded to.  While this address is not recorded in the member database (unless you explicitly opt in), it will appear in the automatic e-mail sent to admin@feministwiki.org.  Likewise with the text you write in the &amp;quot;personal declaration&amp;quot; field of the form.  The e-mail containing this data is stored on the mail server of the FeministWiki, meaning that the same data leak concerns as explained in the previous section might apply.  That said, the technician will try to make sure that these e-mails are deleted after the account request is processed.  (So far, a technical guarantee of this is not provided; this will come in a future rework of the account request system.)&lt;br /&gt;
&lt;br /&gt;
== Activity data ==&lt;br /&gt;
&lt;br /&gt;
When you use any of the FeministWiki services, like visiting any part of the website, editing wiki pages, posting to the forum, sending chat messages, sending FeministWiki e-mail, uploading files, or writing or commenting on blog posts, you generate data that is stored on the server, some of which is also publicly shown.  Details follow.&lt;br /&gt;
&lt;br /&gt;
=== Visiting pages ===&lt;br /&gt;
&lt;br /&gt;
Every new page of the FeministWiki that you open or navigate to (including forum pages, blog posts, the on-site chat or email clients, etc.) generates an &amp;quot;access log&amp;quot; entry on the web server.  These entries contain your IP address, the time of access, and optional information sent by your web browser.  This helps with alleviating abuse of the website, and searching for technical problems.&lt;br /&gt;
&lt;br /&gt;
Note: This is a standard feature of web servers and is done by most websites you visit on the Internet.&lt;br /&gt;
&lt;br /&gt;
Usually, your IP address cannot easily be traced back to your real identity.  However, it reveals information about your Internet Service Provider and an approximate geographic location (such as the nearest large city).  If this is an issue for you, please look into software such as the [https://www.torproject.org/ Tor Project], a VPN Provider, or other ways to hide your IP address from websites you visit.&lt;br /&gt;
&lt;br /&gt;
The FeministWiki will never reveal the contents of the access logs to anyone, unless mandated by law enforcement.&lt;br /&gt;
&lt;br /&gt;
=== Editing the wiki ===&lt;br /&gt;
&lt;br /&gt;
All individual edits made to the wiki (including talk pages and other types of special pages) are permanently recorded, with the username of the editor and the date and time of the edit.  These records remain even if the page is later edited by someone else so thoroughly that none of the content written by you remains.  This recording of all edits helps to resolve issues with vandalism by malicious editors.  (E.g. if someone removes all content on a page and replaces it with garbage, the original content can be recovered in a few clicks, and the edit logs will show who did the vandalism.)&lt;br /&gt;
&lt;br /&gt;
Note: This is a standard feature of the wiki software &#039;&#039;MediaWiki&#039;&#039; that is also used by Wikipedia.&lt;br /&gt;
&lt;br /&gt;
=== Posting on the forum ===&lt;br /&gt;
&lt;br /&gt;
Most sections of the forum are publicly visible.  Your username will appear aside your forum post, as well as the date and time of the post.  There are sections of the forum that are only visible to members, but please remember that it&#039;s difficult to keep out 100% of malicious persons from getting a FeministWiki account.  All forum posts are also stored on the server, and data leaks &#039;&#039;&#039;may&#039;&#039;&#039; happen despite state of the art security measures.&lt;br /&gt;
&lt;br /&gt;
=== Using the chat system ===&lt;br /&gt;
&lt;br /&gt;
Chat messages sent through the FeministWiki chat service are only visible to the recipient(s) of the message.  However, they are stored on the server to provide you your chat history when you log in to the chat with a different device.  Ideally, don&#039;t ever send personal information through the FeministWiki chat service if you want it to remain absolutely secret.&lt;br /&gt;
&lt;br /&gt;
Furthermore, any device you use to log in to the chat system leads to an access log entry to be stored by the software.  This helps identifying the cause of technical problems, like when someone is having difficulties logging in.&lt;br /&gt;
&lt;br /&gt;
=== Writing blog posts or comments ===&lt;br /&gt;
&lt;br /&gt;
The blog posts as well as the comments beneath them are publicly visible, and have your username attached to them, as well as the date and time of the comment, much like public posts on the forum.&lt;br /&gt;
&lt;br /&gt;
=== Uploading files to the file storage system ===&lt;br /&gt;
&lt;br /&gt;
The files you upload to the FeministWiki file storage are private by default.  You have the option of sharing them with others by creating a sharing link or making files or whole folders accessible to other members.  Since the files are stored on the server however, you should ideally never upload any files with personal information that you want to keep absolutely secret.&lt;br /&gt;
&lt;br /&gt;
=== Sending and receiving FeministWiki e-mail ===&lt;br /&gt;
&lt;br /&gt;
The e-mails you send and receive with your &#039;&#039;(username)@feministwiki.org&#039;&#039; account are stored on the server.  Ideally, don&#039;t send any e-mail that provides personal information which you want to keep absolutely secret.&lt;br /&gt;
&lt;br /&gt;
Furthermore, any e-mail client software you&#039;ve configured to automatically fetch your received FeministWiki e-mail leads to access log entries to be stored by the e-mail server whenever the software in question opens a connection to look for any incoming mail.  This helps with identifying technical problems like when someone is having difficulty receiving their FeministWiki e-mail, and is a standard feature of all e-mail servers, meaning your regular e-mail provider is doing it as well.&lt;br /&gt;
&lt;br /&gt;
== Contact for further questions ==&lt;br /&gt;
&lt;br /&gt;
Please contact technician@feministwiki.org if you have any privacy related concerns or questions that aren&#039;t answered above.&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=TERF&amp;diff=1202</id>
		<title>TERF</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=TERF&amp;diff=1202"/>
		<updated>2022-06-03T21:51:49Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Trans activist Dana Rivers commits triple homicide */ Not sure if adopted, one of them could be the biological mother.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageSeo&lt;br /&gt;
|description = TERF is a slur used by transgender activists to debase anyone who criticizes their movement on the basis of feminist concerns.&lt;br /&gt;
|image = Sonicfox.png&lt;br /&gt;
}}&lt;br /&gt;
[[File:Terf-slur-02.png|thumb|300px|A typical tweet containing &amp;quot;terf&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
The word &#039;&#039;TERF&#039;&#039; (or &#039;&#039;terf&#039;&#039;; pl &#039;&#039;terfs&#039;&#039; or &#039;&#039;terves&#039;&#039;) is a slur that is used predominantly by transgender activists and their allies against people who criticize the transgender movement on the basis of feminist concerns.  Since the slur is used for people with feminist concerns, the main target tend to be women.  As such, it&#039;s usually understood to be an anti-feminist, sexist and misogynist slur.&lt;br /&gt;
&lt;br /&gt;
The word was invented as an acronym for &#039;&#039;Trans-Exclusionary Radical Feminist&#039;&#039;, where the &amp;quot;trans-exclusionary&amp;quot; part referred to those holding roughly the position that transwomen should not be included under a feminist definition of womanhood, and the &amp;quot;radical feminist&amp;quot; part was meant neutrally, i.e. for people who would indeed describe themselves as [[Radical feminism|radical feminists]] in the true sense.&lt;br /&gt;
&lt;br /&gt;
Over time, the acronym pretty much became a [[Wikipedia:Four-letter word|four-letter word]].  Nowadays the capitalization is frequently omitted, and the already ambiguous original meaning ignored entirely.  Still, users of the term tend to claim that it&#039;s a neutral description.  The &amp;quot;trans-exclusionary&amp;quot; part may now refer to anyone who thinks transwomen should not have unfettered access to all female-only spaces (e.g. changing rooms), should not partake in women&#039;s sports where they have [[Transwomen in women&#039;s sports|unfair advantages]], should not be considered a natural part of the lesbian dating pool, etc.  Although most members of the public would see these as rather sensible positions (especially when considering that a &amp;quot;transwoman&amp;quot; may have intact male anatomy), transgender activists nevertheless see all of these types of &amp;quot;exclusion&amp;quot; as unacceptable.&lt;br /&gt;
&lt;br /&gt;
A closely associated term is &#039;&#039;SWERF&#039;&#039;, which is supposed to stand for &#039;&#039;Sex-Worker-Exclusionary Radical Feminist&#039;&#039; and is used for those who see the sex industry (prostitution, pornography, etc.) as highly exploitative and sexist.  Like &#039;&#039;TERF&#039;&#039;, the term is almost always applied as a slur, and to misrepresent the political position of the person it&#039;s used against.  Ironically, some of those who have to face the term most commonly are women who worked in prostitution and became anti-prostitution activists as a result of their own experiences as so-called sex workers.&lt;br /&gt;
&lt;br /&gt;
== History and evolution towards hate speech ==&lt;br /&gt;
&lt;br /&gt;
=== Origin ===&lt;br /&gt;
&lt;br /&gt;
The oldest known use of the term is by Viv Smythe aka &amp;quot;tigtog&amp;quot; in a blog post from 2008.&amp;lt;ref name=terf-origin/&amp;gt;  She defended the term as late as 2018, in an article for The Guardian.&amp;lt;ref name=guardian-smythe/&amp;gt;  Transgender activists frequently try to defend the term on the grounds that Viv Smythe is a woman who herself claims to be a radical feminist, and seems to have first used the term in a way that is not derogatory.  Of course, the benign origins of a term does not mean that it cannot evolve into a slur.&lt;br /&gt;
&lt;br /&gt;
=== Early years and first principled critique ===&lt;br /&gt;
&lt;br /&gt;
The evolution of the term from 2008 into the early to mid 2010s is not well documented.  Mostly, feminists had to face the term on social media, where it began to be used regularly to debase their position.  In July 2014, [https://www.feministcurrent.com/ Feminist Current] published two articles referencing the term.  The first, written by C. K. Egbert and titled &#039;&#039;Defending the &#039;TERF&#039;: Gender as political&#039;&#039;, explains and defends in length the political theory underlining the ideas supported by feminists who are slurred as &amp;quot;terf.&amp;quot;&amp;lt;ref name=fc-egbert/&amp;gt;  The second, written by [[Sarah Ditum]] and titled &#039;&#039;How &#039;TERF&#039; works&#039;&#039;, shortly analyses a situation in which a woman is pressured to retract a statement opposing violence against women, on the grounds that the statement originally stems from a feminist who is considered a &amp;quot;terf&amp;quot;.&amp;lt;ref name=fc-ditum/&amp;gt;  Since Feminist Current is highly acclaimed among radical-leaning feminists, its decision to support the women slurred with &amp;quot;terf&amp;quot; could be seen as a turning point.&lt;br /&gt;
&lt;br /&gt;
In August 2014, Vice published an article titled &#039;&#039;I Am Now Officially a Transphobic Twitter Troll&#039;&#039; (subtitle: &#039;&#039;At least according to the &#039;Block Bot&#039; I am&#039;&#039;) by author Martin Robbins.&amp;lt;ref name=vice-robbins/&amp;gt;  In the article, Robbins talks about how the &amp;quot;Block Bot&amp;quot; project on Twitter, which is supposed to help people avoid abusive trolls, has included feminist authors and journalists such as [[Caroline Criado-Perez]] and [[Helen Lewis]] among the people who should be blocked.  Ironically, Lewis seems to have made it to the list for complaining about abusive trolls, as the &amp;quot;evidence&amp;quot; for the reason to ban her includes objections to tweets such as &amp;quot;kill TERFS&amp;quot;, &amp;quot;burn TERFS&amp;quot;, or hateful jokes such as &amp;quot;what&#039;s better than 1 dead terf? 2 dead terfs.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Another Feminist Current article defending those targeted with the slur was published in November 2015, written by [[Penny White]] and titled &#039;&#039;Why I no longer hate ‘TERFs’&#039;&#039;.&amp;lt;ref name=fc-white/&amp;gt;  In the article, White explains how she herself used to be convinced that so-called &amp;quot;TERFs&amp;quot; are worthy of contempt, but changed her mind after starting to look closer into the issue.  This experience seems to resonate with many women and some socially liberal men to this day, who start out being supportive of the transgender movement, only to start becoming skeptical after negative experiences and observations, ultimately leading them to be also labeled &amp;quot;terf&amp;quot; and shunned by transgender activists and their allies.  After that, Feminist Current started publishing articles critical of the transgender movement with some frequency, much to the enragement of transgender activists.&lt;br /&gt;
&lt;br /&gt;
=== The mainstreaming of hatred ===&lt;br /&gt;
&lt;br /&gt;
[[File:Mya-byrne-punches-terfs.jpg|thumb|left|150px|Totally not a slur!]]&lt;br /&gt;
&lt;br /&gt;
In June 2017, transgender activist [[Wikipedia:Mya Byrne|Mya Byrne]] came to the San Francisco Pride Parade with a t-shirt reading &amp;quot;I PUNCH TERFS&amp;quot;, decorated with a large fake blood-stain.  Byrne uploaded a selfie of him wearing the t-shirt at the parade, captioned &amp;quot;This is what gay liberation looks like #pride #yesallterfs&amp;quot; which sparked many negative reactions.&amp;lt;ref name=fc-tra-violence/&amp;gt;  The t-shirt would later be displayed at an &amp;quot;art exhibit&amp;quot; at the San Francisco Public Library, set up by the trans activist group &#039;&#039;The Degenderettes&#039;&#039;.  After complaints, the library removed the t-shirt from the exhibition, though similar items showcasing a violent mentality remained, such as baseball bats wrapped in barbed wire and painted in the colors of the transgender pride flag.&amp;lt;ref name=fc-tra-violence/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Sonicfox.png|thumb|right|250px|Dominique McLean&#039;s tweet glorifying violence against women.]]&lt;br /&gt;
&lt;br /&gt;
In April 2019, professional video gamer [[Wikipedia:SonicFox|Dominique McLean]] aka &amp;quot;SonicFox&amp;quot; uploaded a video on Twitter, captioned &amp;quot;what I do to terfs,&amp;quot; in which a male video game character strikes a female character&#039;s neck so hard that her skin comes off, while the camera shows her agony-filled face.  McLean can be heard yelling &amp;quot;terf!&amp;quot; into his microphone with each blow dealt to the female character, reminiscent of a lynching.&amp;lt;ref name=sonicfox/&amp;gt;  The tweet garnered hundreds of thousands of views, and many thousands of retweets and likes.&lt;br /&gt;
&lt;br /&gt;
McLean&#039;s tweet is made even worse by the fact that the hatred is not just directed at an imagined &amp;quot;terf&amp;quot; character, but at the voice actress behind the character, [[Wikipedia:Ronda Rousey|Ronda Rousey]].  Rousey, who is an MMA (mixed martial arts) fighter, is deemed a &amp;quot;TERF&amp;quot; for having stated, with blunt wording, that it&#039;s unfair for male MMA fighter [[Transwomen in women&#039;s sports#Fallon_Fox|Fallon Fox]] to compete against women.&amp;lt;ref name=rousey-fox/&amp;gt;&amp;lt;ref name=rousey-marysue/&amp;gt;&amp;lt;ref name=rousey-reddit/&amp;gt;  A year after Rousey&#039;s remarks, female MMA fighter Tamikka Brents had suffered a concussion and an orbital bone fracture during a fight with Fallon Fox,&amp;lt;ref name=fallon-fox/&amp;gt; but this does not seem to have changed the opinion of trans activists.&lt;br /&gt;
&lt;br /&gt;
After McLean&#039;s tweet was reported for hate speech, Twitter initially decided that it [[:File:Sonicfox2.png|did not break their rules]].  Only after continued protest and many more reports did Twitter react, by removing the tweet and issuing SonicFox a mere 24-hour ban.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Aftermath of McLean&#039;s tweet&amp;quot; widths=300px heights=150px&amp;gt;&lt;br /&gt;
File:Sonicfox3.jpg | McLean defending his tweet on the grounds that Ronda Rousey is a &amp;quot;TERF&amp;quot; and as such deserving of the violent contempt&lt;br /&gt;
File:Sonicfox-copycat1.png | A copycat tweet showing another video game character dying brutally, with the caption &amp;quot;FUCK TERFS&amp;quot;&lt;br /&gt;
File:Sonicfox-copycat2.png | Another copycat tweet.  The GIF is of [[Wikipedia:Mortal Kombat 11|Mortal Kombat 11]] character [[Wikipedia:Scorpion (Mortal Kombat)|Scorpion]] burning his opponent alive.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== New trend: Threaten women with your face attached ===&lt;br /&gt;
&lt;br /&gt;
In late 2019, a social media trend dubbed &amp;quot;POV you&#039;re a TERF in my mentions&amp;quot; started, in which trans activists would pose with a weapon (baseball bat, sword, machete, or the like), sometimes preparing to strike or showing them mid-strike, taken as a [[Wikipedia:Point-of-view shot|point-of-view (POV) shot]] and captioned with the phrase &amp;quot;POV you&#039;re a TERF in my mentions&amp;quot; or variations thereof.&amp;lt;ref name=pov-terf/&amp;gt;  The pictures are supposed to represent the point-of-view (POV) of a &amp;quot;TERF&amp;quot; being assaulted by the depicted person.  In other words, women called &amp;quot;TERF&amp;quot; who look at the pictures are supposed to imagine themselves being violently assaulted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Some examples of the trend&amp;quot; widths=300px heights=150px&amp;gt;&lt;br /&gt;
File:Pov-terf-1.webp&lt;br /&gt;
File:Pov-terf-2.webp&lt;br /&gt;
File:Pov-terf-3.webp&lt;br /&gt;
File:Pov-terf-4.webp&lt;br /&gt;
File:Pov-terf-5.webp&lt;br /&gt;
File:Pov-terf-6.webp&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Political justification of physical violence ===&lt;br /&gt;
&lt;br /&gt;
In May 2020, a blog post was published on Medium.com equating so-called TERFs with Nazis in a credible-sounding tone and explaining how various methods such as infiltration, censorship, property damage, and physical violence should be used against them.&amp;lt;ref name=medium-izaguirre/&amp;gt;  The account posting the article was suspended from Medium.com on the same day and the content re-uploaded on WordPress.com soon after.&amp;lt;ref name=wp-izaguirre/&amp;gt;  (Still online as of February 20th, 2021)&lt;br /&gt;
&lt;br /&gt;
=== Not even pretending that this isn&#039;t a witch hunt? ===&lt;br /&gt;
&lt;br /&gt;
[[File:Spain-witch-puppet.jpg|thumb|right|150px|Effigy of [[Wikipedia:Carmen Calvo|Carmen Calvo]] hanging from a tree.]]&lt;br /&gt;
&lt;br /&gt;
In February 2021, Spanish news reported about the appearance of a puppet hanging from a tree, with its face made to resemble female politician, author, and vice president [[Wikipedia:Carmen Calvo|Carmen Calvo]] of the Socialist Workers&#039; Party.&amp;lt;ref name=elcomun-calvo/&amp;gt;  Calvo had come under fire from trans activists for her opposition to a proposed [[gender self-identification]] law.  The puppet was hanging from a tree in Plaza 8 de Marzo in Santiago de Compostela, with a sign hanging from its neck saying &amp;quot;Me he perdido…por dónde queda el patriarcado&amp;quot; which could be translated as &amp;quot;I&#039;m lost... where&#039;s the patriarchy again?&amp;quot; referring clearly to trans activist claim that it&#039;s not them who uphold patriarchal norms, but rather the feminists who oppose them.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Real-life assault, vandalism, and harassment ==&lt;br /&gt;
&lt;br /&gt;
This section lists known incidents of real-life (offline) assault, vandalism, verbal abuse and other harassment against feminist organizations or women, by trans activists who are radicalized by the notion that so-called &amp;quot;TERFs&amp;quot; are after their human rights.  (The only case in which the motivation is not entirely clear is the triple homicide of a lesbian couple and their son, committed by formerly prominent trans activist Dana Rivers.)&lt;br /&gt;
&lt;br /&gt;
=== Vandalism of Vancouver Women&#039;s Library ===&lt;br /&gt;
&lt;br /&gt;
In February 2017, the newly opened Vancouver Women&#039;s Library was met with a small group of vandals, including a very obviously male person who claimed to be a female sex worker.  They ripped off a poster, poured wine on a book, and harassed those trying to partake in the opening celebration.  Their stated reason was that the library included books which they deemed to support so-called &amp;quot;TERF&amp;quot; and &amp;quot;SWERF&amp;quot; ideology.&amp;lt;ref name=vwl/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Images of the vandalism&amp;quot; widths=210px heights=175px&amp;gt;&lt;br /&gt;
File:VWL-Vandalized-1.jpg | Crude graffiti sprayed at the entrance&lt;br /&gt;
File:VWL-Vandalized-2.jpg | Close-up of some of the sprayed text&lt;br /&gt;
File:VWL-Vandalized-3.jpg | Wine poured on one of the books&lt;br /&gt;
File:VWL-Defamation.jpg | The supposed reason for the vandalism&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Physical assault at Speakers&#039; Corner, London ===&lt;br /&gt;
&lt;br /&gt;
In September 2017, Maria MacLachlan was physically assaulted by a transgender activist.&lt;br /&gt;
&lt;br /&gt;
Initially, a group of feminists wanted to hold a meeting to discuss proposed changes to the [https://www.feministcurrent.com/2018/09/14/never-mind-reforming-gender-recognition-act-theres-no-need-gender-recognition-certificates/ Gender Recognition Act] (GRA) in the [https://newxlearning.org/ New Cross Learning] community Library in London.  The library had to cancel the event after harassment by transgender activists.  The organizers of the meeting then decided to meet at Speakers&#039; Corner, before going to the newly chosen meeting place, which was not announced to protect it from harassment.&lt;br /&gt;
&lt;br /&gt;
[[File:Tara-Flik-Wood-threat.webp|thumb|right|300px|Wolf going by the name &amp;quot;Tara Flik Wood&amp;quot; on social media, posting intent to assault prior to the event]]&lt;br /&gt;
&lt;br /&gt;
At Speakers&#039; Corner, the women were met with a group of transgender activists shouting slogans, notably &amp;quot;when TERFs attack, we fight back.&amp;quot;  Maria MacLachlan, who was filming the protesters with her digital camera, was attacked by someone running out of the trans activist group, who then tried to grab her camera.  As the unsuccessful attacker ran back behind his friends, MacLachlan tried to get closer to the group to get his face on camera.  Several of the activists started assaulting her in that moment.  The whole sequence of events was [https://www.youtube.com/watch?v=9_d3ozhSE-U caught on camera] thanks others at the place also filming what was going on.  MacLachlan&#039;s camera was broken and the memory card stolen.&lt;br /&gt;
&lt;br /&gt;
One of the attackers, later revealed to be Tara Wolf, was ultimately charged with assault by beating.  Prior to the event, he had posted that he wants to &amp;quot;f*ck up some terfs&amp;quot; on social media.&lt;br /&gt;
&lt;br /&gt;
The event could be considered a cornerstone in the escalating hatred transgender activists show against feminists, as no such clearly documented assault in relation to the slur &amp;quot;TERF&amp;quot; existed before, and the event gained widespread attention in the news, being covered by The Guardian,&amp;lt;ref name=guardian/&amp;gt; The New Statesman,&amp;lt;ref name=statesman1/&amp;gt;&amp;lt;ref name=statesman2/&amp;gt; The Telegraph,&amp;lt;ref name=telegraph/&amp;gt; The Times,&amp;lt;ref name=times1/&amp;gt;&amp;lt;ref name=times2/&amp;gt; The Evening Standard,&amp;lt;ref name=standard/&amp;gt; and The Daily Mail.&amp;lt;ref name=dailymail/&amp;gt;  Of course, it was also covered by Feminist Current.&amp;lt;ref name=fc1/&amp;gt;&amp;lt;ref name=fc2/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the aftermath of the event, many transgender activists online defended or even celebrated the assault, leading Meghan Murphy to publish the piece [https://www.feministcurrent.com/2017/09/21/terf-isnt-slur-hate-speech/ &#039;&#039; &#039;TERF&#039; isn&#039;t just a slur, it&#039;s hate speech&#039;&#039;].  Some publications in support of transgender activists have tried to claim that the assailant was really acting in self-defense, and tried to prove this claim by uploading carefully edited cuts of the recording showing the assault,&amp;lt;ref name=planettrans/&amp;gt; or by framing the assault as &amp;quot;standing up to bullies&amp;quot; who &amp;quot;provoke&amp;quot; transgender activists (by having opinions they don&#039;t like, we have to presume).&amp;lt;ref name=queerness/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Images&amp;quot; widths=300px heights=175px&amp;gt;&lt;br /&gt;
File:Tara-Flik-Wood-attack.png | A frame from the video documenting the assault&lt;br /&gt;
File:Tara-Flik-Wood-supporters.jpg | Some of Wolf&#039;s supporters outside court&lt;br /&gt;
File:MacLachlan-supporters.jpg | For contrast, MacLachlan&#039;s supporters&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Verbal abuse and other harassment against Prof. Rosa Freedman ===&lt;br /&gt;
&lt;br /&gt;
In December 2018, human rights lawyer Prof. [[Rosa Freedman]] found her office door covered in urine after attending debates surrounding proposed changes to the UK&#039;s Gender Recognition Act.  She also reported being called a &amp;quot;Nazi&amp;quot; (she is Jewish) who &amp;quot;should be raped&amp;quot; (she is a survivor of sexual violence) and receiving abusive anonymous phone calls.&amp;lt;ref name=freedman/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Trans activist Dana Rivers commits triple homicide ===&lt;br /&gt;
&lt;br /&gt;
In 2018, transgender activist Dana Rivers was on trial for triple murder.&amp;lt;ref name=rivers/&amp;gt;  The victims were a lesbian couple and their son.  Rivers stabbed and shot the victims, before trying to set their house on fire, in November 2016.  It remains unclear whether Rivers was motivated by the hatred against feminists and lesbians promulgated by transgender activists.  Rivers was, however, a member of the group [[Wikipedia:Camp Trans|Camp Trans]], which was created to protest the women-only rule of the Michigan Womyn&#039;s Music Festival (aka MichFest).&amp;lt;ref name=camptrans/&amp;gt;  Autostraddle described Rivers as a &amp;quot;very well-known transgender activist.&amp;quot;&amp;lt;ref name=autostraddle/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Trans activist lashes at Julie Bindel after speech ===&lt;br /&gt;
&lt;br /&gt;
[[File:Joe-brennan-twitter.jpg|thumb|right|200px|&amp;quot;Cathy Brennan&amp;quot; encouraging physical violence against women]]&lt;br /&gt;
&lt;br /&gt;
In June 2019, [[Julie Bindel]] was physically attacked by a trans-identifying male person after holding a keynote speech about male violence against women at the Edinburgh University, together with Prof. Rosa Freedman.&amp;lt;ref name=edinburgh/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bindel recounted the incidence the following way: &amp;quot;He was shouting and ranting and raving, &#039;you&#039;re a f***** c***, you&#039;re a f****** bitch, a f****** Terf&amp;quot; and the rest of it.  We were trying to walk to the cab to take us to the airport, and then he just lunged at me and almost punched me in the face, but a security guard pulled him away.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The male person, who calls himself &amp;quot;[[Cathy Brennan]]&amp;quot; (not to be confused with the lesbian and radical feminist lawyer who was born with that name) had previously stood out on social media for encouraging physical violence against feminists at Gay Pride events.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
=== Harassment and vandalism against Vancouver Rape Relief ===&lt;br /&gt;
&lt;br /&gt;
In August 16, 2019, the Facebook account of [[Vancouver Rape Relief and Women&#039;s Shelter]] reported that a dead rat had been nailed to their door frame.&amp;lt;ref name=vrr-fb/&amp;gt;  On August 26, their Twitter account followed up by reporting their door and windows were vandalized with phrases such as &amp;quot;FUCK TERFS&amp;quot; and &amp;quot;KILL TERFS&amp;quot; as well as &amp;quot;TRANS POWER&amp;quot;.&amp;lt;ref name=vrr-twitter/&amp;gt;  The repeated harassment and vandalism garnered attention in local and national news.&amp;lt;ref name=vrr-vancouverisawesome/&amp;gt;&amp;lt;ref name=vrr-nationalreview/&amp;gt;&amp;lt;ref name=vrr-citynews/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Images of the vandalism&amp;quot; widths=300px heights=175px&amp;gt;&lt;br /&gt;
File:Vrr-vandalism1.jpg | A dead rat nailed to the door frame of VRR&lt;br /&gt;
File:Vrr-vandalism2.jpg | The text &amp;quot;KILL TERFS ... TRANS POWER&amp;quot; written on the window&lt;br /&gt;
File:Vrr-vandalism3.jpg | The phrases &amp;quot;FUCK TERFS&amp;quot; and &amp;quot;TRANS WOMEN ARE WOMEN&amp;quot; written on the door and window&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Analysis of the term ==&lt;br /&gt;
&lt;br /&gt;
[[File:Theterfs-delusion.png|thumb|right|500px|Some of the extreme hyperbole used to justify hatred against radical feminists]]&lt;br /&gt;
&lt;br /&gt;
The original acronym could be split in two halves: &amp;quot;trans-exclusionary&amp;quot; and &amp;quot;radical feminist.&amp;quot;  Though many people targeted with the word do not see themselves as radical feminists, their ideals most often tend to align with [[radical feminism]] anyway, making that part somewhat accurate.  The &amp;quot;trans-exclusionary&amp;quot; part however is rather ambiguous, and its meaning seems to change at the whim of the person using the term.&lt;br /&gt;
&lt;br /&gt;
When those using the term want to justify it as an objective and accurate description, they will use rather mundane and basic definitions of &amp;quot;exclusion&amp;quot; that applies easily to most people the term is used against.  Examples of this might include:&lt;br /&gt;
&lt;br /&gt;
* Wanting transwomen with unfair anatomic advantages to be excluded from women&#039;s sports&lt;br /&gt;
* Wanting transwomen with an obvious male anatomy (such as intact male genitals) to be excluded from sex segregated spaces of privacy, such as changing rooms&lt;br /&gt;
* Not considering transwomen to be &#039;&#039;literally&#039;&#039; women, by pointing at the dictionary definition that is &amp;quot;adult human female&amp;quot;&lt;br /&gt;
* Wanting to exclude transwomen from some political groups that want to focus on struggles unique to people born with female anatomy&lt;br /&gt;
* Wanting to exclude crimes committed by transwomen from being recorded as female criminality, especially since the crime patterns of transwomen seem more in line with crime patterns of men,&amp;lt;ref name=dhejne/&amp;gt; who commit the vast majority of violent crimes, specifically sexual violence&amp;lt;ref name=wpcrime/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, once the term &amp;quot;TERF&amp;quot; is applied to someone on the basis of them holding these opinions (which many people including non-feminists would agree are sensible), the definition of &amp;quot;exclusion&amp;quot; is quickly sharpened to justify expressions of hatred.  Sometimes, the &amp;quot;trans-exclusionary&amp;quot; is even hyperbolically turned into &amp;quot;trans-exterminatory&amp;quot; to increase its panic-inducing effect.  The website (or should we say whacksite) [http://theterfs.com/ &#039;&#039;The TERFs&#039;&#039;] goes as far as claiming that the people labeled &amp;quot;TERF&amp;quot; want to:&lt;br /&gt;
&lt;br /&gt;
* Exclude trans people from housing (make them homeless)&lt;br /&gt;
* Exclude trans people from employment (make them unemployed)&lt;br /&gt;
* Exclude them from education (keep them uneducated)&lt;br /&gt;
* Exclude them from accommodation equality&lt;br /&gt;
* Exclude them from local, state, national and United Nations protections(!)&lt;br /&gt;
&lt;br /&gt;
As such, the women labeled &amp;quot;TERF&amp;quot; are represented less as women who simply want to uphold women&#039;s sex-based rights, and more like fascist monsters.  This is then used to incite hatred and violence against them.  It&#039;s also noteworthy how exclusion of transwomen (from female-only spaces etc.) turns here into supposed exclusion of all trans people (from whatever).  In fact, women targeted as &amp;quot;TERFs&amp;quot; will frequently say explicitly that they welcome transmen in their groups, since transmen also face the sex-based oppression all women face from birth.&lt;br /&gt;
&lt;br /&gt;
The strategy of transgender activists of using simple definitions of &amp;quot;TERF&amp;quot; to make the term look accurate, but then twist the definition to justify hatred, is quite similar to a &amp;quot;troll&amp;quot; strategy that has been noted by philosopher Nicholas Shackel, and dubbed the &#039;&#039;Motte and Bailey Doctrine&#039;&#039; in a paper titled [https://philpapers.org/archive/SHATVO-2.pdf &#039;&#039;The Vacuity of Postmodernist Methodology&#039;&#039;]:&lt;br /&gt;
&lt;br /&gt;
[[File:Motte-Bailey.png|thumb|right|500px|An illustration of the &amp;quot;motte and bailey&amp;quot; style of fallacious argumentation.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;em&amp;gt;&lt;br /&gt;
&amp;quot;Troll’s Truisms are used to insinuate an exciting falsehood, which is a desired doctrine, yet permit retreat to the trivial truth when pressed by an opponent.  In so doing they exhibit a property which makes them the simplest possible case of what I shall call a Motte and Bailey Doctrine (since a doctrine can be a single belief or an entire body of beliefs).&lt;br /&gt;
&lt;br /&gt;
A Motte and Bailey castle is a medieval system of defence in which a stone tower on a mound (the Motte) is surrounded by an area of land (the Bailey) which in turn is encompassed by some sort of a barrier such as a ditch.  Being dark and dank, the Motte is not a habitation of choice.  The only reason for its existence is the desirability of the Bailey, which the combination of the Motte and ditch makes relatively easy to retain despite attack by marauders.  When only lightly pressed, the ditch makes small numbers of attackers easy to defeat as they struggle across it: when heavily pressed the ditch is not defensible and so neither is the Bailey.  Rather one retreats to the insalubrious but defensible, perhaps impregnable, Motte.  Eventually the marauders give up, when one is well placed to reoccupy desirable land.&lt;br /&gt;
&lt;br /&gt;
For my purposes the desirable but only lightly defensible territory of the Motte and Bailey castle, that is to say, the Bailey, represents a philosophical doctrine or position with similar properties: desirable to its proponent but only lightly defensible.  The Motte is the defensible but undesired position to which one retreats when hard pressed.  I think it is evident that Troll’s Truisms have the Motte and Bailey property, since the exciting falsehoods constitute the desired but indefensible region within the ditch whilst the trivial truth constitutes the defensible but dank Motte to which one may retreat when pressed.&amp;quot;&lt;br /&gt;
&amp;lt;/em&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In our case, the &#039;&#039;Motte&#039;&#039; is an easily defensible statement like: &#039;&#039;&amp;quot;You don&#039;t consider transwomen literally women, therefore you are trans-exclusionary, which makes you a TERF.&amp;quot;&#039;&#039;  Whereas the &#039;&#039;Bailey&#039;&#039; is: &#039;&#039;&amp;quot;You want to exclude trans people from housing and employment, therefore I&#039;m justified in hating you with a passion!&amp;quot;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It could also be called a &amp;quot;bait-and-switch&amp;quot; argument, where one is &amp;quot;baited&amp;quot; into agreeing with the claim that someone is a &amp;quot;TERF&amp;quot; by using a mundane definition of &amp;quot;trans exclusion,&amp;quot; and then the definition is switched into something bad, to justify expressions of hatred.&lt;br /&gt;
&lt;br /&gt;
=== Inspection of the claims on &#039;&#039;The TERFs&#039;&#039; ===&lt;br /&gt;
&lt;br /&gt;
[[File:Theterfs-logo.png|thumb|right|300px|Actual logo of TheTERFs.com: Evil black scribbles]]&lt;br /&gt;
&lt;br /&gt;
It should be noted that &#039;&#039;The TERFs&#039;&#039; offers little more than out-of-context quotes from several decades ago as &amp;quot;evidence&amp;quot; for its hyperbolic claims regarding so-called &amp;quot;TERF&amp;quot; ideology.  It also showcases a small number of cherry-picked tweets, half of which are from right-wing sources that also happen to oppose the transgender movement, which trans activists claim proves that feminists are secretly allied with them in a big conspiracy.  (This line of thinking is often ridiculed as: &amp;quot;Hitler was a vegetarian, therefore vegetarians are Nazis.&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Regarding supposed evidence of &amp;quot;real-life violence motivated by TERF ideology,&amp;quot; the website lists six examples, of which three don&#039;t actually present any violence.  Those which do, relate to incidences from several decades ago, in which women tried to evict transwomen from female-only groups or spaces, using physical force or face-to-face threats.  Since women are expected to be always nice and passive towards males, even when trying to form radical feminist groups and keep males out of them, this is of course seen as unacceptable.  Two examples are about verbal threats, which is a run-of-the-mill experience for feminists opposing transgender activists, and the last one is about the deaths of trans people that are &#039;&#039;assumed&#039;&#039; to be related to lack of access to health care, which to be very blunt has fuck-all to do with feminist ideologies.&lt;br /&gt;
&lt;br /&gt;
To summarize: there is not a single documented instance of a feminist group going up to a transgender group to assault or threaten them.  Any claims of &amp;quot;violence by TERFs&amp;quot; refer either to women trying to evict transwomen from female-only spaces, extremely rare verbal threats, and lots and lots of fabrication.  In comparison, transgender activists have gone to women&#039;s libraries to vandalize them,&amp;lt;ref name=vwl/&amp;gt; went to feminist meetings to assault women,&amp;lt;ref name=fc1/&amp;gt;&amp;lt;ref name=fc2/&amp;gt; appeared with face masks at feminist conferences to intimidate women,&amp;lt;ref name=jamjar/&amp;gt; and the ubiquitous verbal abuse they send in the direction of women fills up [https://terfisaslur.com/ a whole website] set up solely to archive it.&lt;br /&gt;
&lt;br /&gt;
== &#039;SWERF&#039; ==&lt;br /&gt;
&lt;br /&gt;
The word &#039;&#039;SWERF&#039;&#039; is a close relative to &#039;&#039;TERF&#039;&#039; and is applied in a similarly dishonest, misrepresenting way.  Women (and men who care about women&#039;s rights) who are critical of the sex industry for its exploitative nature are accused of being &amp;quot;sex-worker exclusionary&amp;quot; in an attempt to make them seem hateful towards an oppressed group.&lt;br /&gt;
&lt;br /&gt;
In fact, the people slurred as &amp;quot;SWERF&amp;quot; tend to be supporters of the [[Nordic Model]] against prostitution, which sees a high-quality welfare system as a necessary component in tackling prostitution, and in alleviating problems faced by women who would otherwise choose to do prostitution out of economic desperation.  Further, many of those slurred &amp;quot;SWERF&amp;quot; tend to be women who worked in prostitution themselves.&lt;br /&gt;
&lt;br /&gt;
Notably, one of the biggest anti-prostitution and anti-pornography feminists [[Andrea Dworkin]] was an ex-prostitute herself, and not ashamed of admitting so.  Another notable example is [[Rachel Moran]], who was in prostitution between the ages of 15 and 22, only to become one of the most notable anti-prostitution, pro-Nordic Model activists in recent years.&lt;br /&gt;
&lt;br /&gt;
== Gallery ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Some examples of tweets using &#039;terf&#039;&amp;quot; widths=300px heights=150px&amp;gt;&lt;br /&gt;
File:Terf-gallery-1.png | &amp;quot;terf isn&#039;t a slur ... terfs don&#039;t deserve rights&amp;quot;&lt;br /&gt;
File:Terf-gallery-2.jpg | &amp;quot;All terfs will be arrested on sight&amp;quot;&lt;br /&gt;
File:Terf-gallery-3.jpg | &amp;quot;It&#039;s [[Wikipedia:Pride Month|Pride]] punch a terf&amp;quot;&lt;br /&gt;
File:Terf-gallery-4.png | Putting &amp;quot;terf&amp;quot; right aside &amp;quot;nazi&amp;quot;&lt;br /&gt;
File:Terf-gallery-5.png | [[Wikipedia:Arthur Chu|Arthur Chu]] supporting SonicFox&#039;s hate speech&lt;br /&gt;
File:Terf-gallery-6.png | &amp;quot;Being a TERF is a choice.  Like being a Nazi.&amp;quot;&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Transgender ideology]]&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.feministcurrent.com/2017/09/21/terf-isnt-slur-hate-speech/ TERF isn&#039;t just a slur, it&#039;s hate speech | Feminist Current]&lt;br /&gt;
* [https://www.feministcurrent.com/tag/terf/ TERF Archives | Feminist Current]&lt;br /&gt;
* [https://speakupforwomen.nz/dont-call-women-terfs/ Don&#039;t Call Women &#039;Terfs&#039; | Speak Up for Women NZ]&lt;br /&gt;
* [https://terfisaslur.com/ terfisaslur.com - Documenting the abuse, harassment and misogyny of transgender identity politics]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=terf-origin&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://hoydenabouttown.com/2008/08/17/carnivalia-transgenderism-and-the-gender-binary/&lt;br /&gt;
|title=Carnivalia, transgenderism and the gender binary&lt;br /&gt;
|author=Viv Smythe (aka tigtog)&lt;br /&gt;
|date=August 17, 2008&lt;br /&gt;
|website=Hoyden About Town&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=guardian-smythe&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.theguardian.com/commentisfree/2018/nov/29/im-credited-with-having-coined-the-acronym-terf-heres-how-it-happened&lt;br /&gt;
|title=I&#039;m credited with having coined the word &#039;Terf&#039;. Here&#039;s how it happened&lt;br /&gt;
|author=Viv Smythe (aka tigtog)&lt;br /&gt;
|date=November 28, 2018&lt;br /&gt;
|website=The Guardian&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=fc-egbert&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.feministcurrent.com/2014/07/16/defending-the-terf-gender-as-political/&lt;br /&gt;
|title=Defending the ‘TERF’: Gender as political&lt;br /&gt;
|author=C.K. Egbert&lt;br /&gt;
|date=July 16, 2014&lt;br /&gt;
|website=Feminist Current&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=fc-ditum&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.feministcurrent.com/2014/07/29/how-terf-works/&lt;br /&gt;
|title=How ‘TERF’ works&lt;br /&gt;
|author=Sarah Ditum&lt;br /&gt;
|date=July 29, 2014&lt;br /&gt;
|website=Feminist Current&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=vice-robbins&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.vice.com/en_uk/article/7bap7y/whats-the-block-blot-martin-robbins-757&lt;br /&gt;
|title=I Am Now Officially a Transphobic Twitter Troll&lt;br /&gt;
|author=Martin Robbins&lt;br /&gt;
|date=August 8, 2014&lt;br /&gt;
|website=Vice&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=fc-white&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.feministcurrent.com/2015/11/10/why-i-no-longer-hate-terfs/&lt;br /&gt;
|title=Why I no longer hate ‘TERFs’&lt;br /&gt;
|author=Penny White&lt;br /&gt;
|date=November 10, 2015&lt;br /&gt;
|website=Feminist Current&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=fc-tra-violence&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.feministcurrent.com/2018/05/01/trans-activism-become-centered-justifying-violence-women-time-allies-speak/&lt;br /&gt;
|title=Trans activism is excusing &amp;amp; advocating violence against women, and it’s time to speak up&lt;br /&gt;
|author=Meghan Murphy&lt;br /&gt;
|date=May 1, 2018&lt;br /&gt;
|website=Feminist Current&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=sonicfox&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.newstatesman.com/politics/feminism/2019/05/welcome-age-ironic-bigotry-where-old-hatreds-are-cloaked-woke-new-language&lt;br /&gt;
|title=Welcome to the age of ironic bigotry, where old hatreds are cloaked in woke new language&lt;br /&gt;
|author=Helen Lewis&lt;br /&gt;
|date=May 1, 2019&lt;br /&gt;
|website=The New Statesman&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=rousey-fox&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://bleacherreport.com/articles/1651451-ronda-rousey-vs-fallon-fox-head-to-toe-breakdown&lt;br /&gt;
|title=Ronda Rousey vs. Fallon Fox Head-to-Toe Breakdown&lt;br /&gt;
|author=Jordy McElroy&lt;br /&gt;
|date=May 25, 2013&lt;br /&gt;
|website=Bleacher Report&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=rousey-marysue&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.themarysue.com/ronda-rousey-and-transmisogyny/&lt;br /&gt;
|title=When Role Models Become Problematic: Ronda Rousey and Transmisogyny&lt;br /&gt;
|author=Teresa Jusino&lt;br /&gt;
|date=August 3, 2015&lt;br /&gt;
|website=The Mary Sue&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=fallon-fox&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://archive.is/yZfcs&lt;br /&gt;
|title=After Being TKO’d by Fallon Fox, Tamikka Brents Says Transgender Fighters in MMA ‘Just Isn’t Fair’&lt;br /&gt;
|website=Cage Potato&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=rousey-reddit&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.reddit.com/r/GamerGhazi/comments/ah4120/celebrity_terf_ronda_rousey_to_play_sonya_blade/&lt;br /&gt;
|title=Celebrity TERF Ronda Rousey to play Sonya Blade in Mortal Kombat 11&lt;br /&gt;
|website=reddit&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=pov-terf&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://web.archive.org/web/20191019184351/https://radfemrebecca.wordpress.com/2019/10/06/terfinmymentions/amp/&lt;br /&gt;
|title=“This is what I want to do to you” – Dissecting the ‘POV ur a TERF in my mentions’ trend.&lt;br /&gt;
|author=Rebecca&lt;br /&gt;
|date=October 6, 2019&lt;br /&gt;
|website=radfemrebecca.wordpress.com&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=medium-izaguirre&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://web.archive.org/web/20200527135844/https://medium.com/@laura.izaguirre/resisting-terfs-and-transforming-their-organizations-95cd21714fc8&lt;br /&gt;
|title=Resisting TERF&#039;s and Transforming Their Organizations (Archived from Medium.com)&lt;br /&gt;
|author=Laura Izaguirre&lt;br /&gt;
|date=May 26, 2020&lt;br /&gt;
|website=Medium.com&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=elcomun-calvo&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://elcomun.es/2021/02/20/violencia-machista-ahorcan-a-una-muneca-con-la-cara-de-carmen-calvo-en-santiago/&lt;br /&gt;
|title=Violencia machista: Ahorcan a una muñeca con la cara de Carmen Calvo en Santiago (English: &amp;quot;Sexist violence: They hang a doll with the face of Carmen Calvo in Santiago&amp;quot;)&lt;br /&gt;
|date=February 20, 2021&lt;br /&gt;
|website=El Común&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
English translation by Google: https://2lovojqocmwrvggaapshhrg6yi-adwhj77lcyoafdy-elcomun-es.translate.goog/2021/02/20/violencia-machista-ahorcan-a-una-muneca-con-la-cara-de-carmen-calvo-en-santiago/&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=wp-izaguirre&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://web.archive.org/web/20200528035805/https://queeratxlaura.wordpress.com/2020/05/27/resisting-terfs-and-transforming-their-organizations/&lt;br /&gt;
|title=Resisting TERF&#039;s and Transforming Their Organizations (Archived from WordPress.com)&lt;br /&gt;
|author=Laura Izaguirre&lt;br /&gt;
|date=May 28, 2020&lt;br /&gt;
|website=WordPress&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=vwl&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.feministcurrent.com/2017/02/07/vancouver-womens-library-opens-amid-anti-feminist-backlash/&lt;br /&gt;
|title=Vancouver Women’s Library opens amid anti-feminist backlash&lt;br /&gt;
|author=Meghan Murphy&lt;br /&gt;
|date=February 7, 2017&lt;br /&gt;
|website=Feminist Current&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=guardian&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.theguardian.com/uk-news/2017/oct/26/woman-punched-in-brawl-between-transgender-activists-and-radical-feminists&lt;br /&gt;
|title=Suspects sought after brawl between transgender activists and radical feminists&lt;br /&gt;
|author=Press Association&lt;br /&gt;
|date=October 26, 2017&lt;br /&gt;
|website=The Guardian&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=statesman1&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.newstatesman.com/politics/feminism/2018/04/madness-our-gender-debate-where-feminists-defend-slapping-60-year-old&lt;br /&gt;
|title=The madness of our gender debate, where feminists defend slapping a 60-year-old woman&lt;br /&gt;
|author=Helen Lewis&lt;br /&gt;
|date=April 20, 2018&lt;br /&gt;
|website=NewStatesman&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=statesman2&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.newstatesman.com/politics/feminism/2017/09/trans-rights-terfs-and-bruised-60-year-old-what-happened-speakers-corner&lt;br /&gt;
|title=Trans rights, TERFs, and a bruised 60-year-old: what happened at Speakers’ Corner?&lt;br /&gt;
|author=Anoosh Chakelian&lt;br /&gt;
|date=September 14, 2017&lt;br /&gt;
|website=NewStatesman&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=telegraph&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.telegraph.co.uk/news/2018/04/12/radical-feminist-warned-refer-transgender-defendant-assault/&lt;br /&gt;
|title=Radical feminist warned to refer to transgender defendant as a &#039;she&#039; during assault case&lt;br /&gt;
|author=Victoria Ward&lt;br /&gt;
|date=April 12, 2018&lt;br /&gt;
|website=The Telegraph&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=times1&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.thetimes.co.uk/article/transgender-activist-denies-thumping-radical-feminist-wvzgq6fx7&lt;br /&gt;
|title=Transgender activist Tara Wolf denies thumping radical feminist&lt;br /&gt;
|author=Lucy Bannerman&lt;br /&gt;
|date=April 12, 2018&lt;br /&gt;
|website=The Times&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=times2&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.thetimes.co.uk/article/trans-attacker-tara-wolf-is-a-thug-says-feminist-maria-maclachlan-pq0bwvthv&lt;br /&gt;
|title=Trans attacker is a thug, says feminist&lt;br /&gt;
|author=Lucy Bannerman&lt;br /&gt;
|date=April 14, 2018&lt;br /&gt;
|website=The Times&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=standard&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.standard.co.uk/news/crime/transgender-activist-tara-wolf-fined-150-for-assaulting-exclusionary-radical-feminist-in-hyde-park-a3813856.html&lt;br /&gt;
|title=Transgender activist Tara Wolf fined £150 for assaulting &#039;exclusionary&#039; radical feminist in Hyde Park&lt;br /&gt;
|author=Martin Coulter&lt;br /&gt;
|date=April 13, 2018&lt;br /&gt;
|website=EveningStandard&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=dailymail&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.dailymail.co.uk/news/article-5613057/Model-punched-feminist-smashed-120-camera-violent-brawl-walks-free-court.html&lt;br /&gt;
|title=Transgender model who punched feminist and smashed her £120 camera in violent brawl at Hyde Park Speakers&#039; Corner protest walks free from court&lt;br /&gt;
|author=Bridie Pearson-jones&lt;br /&gt;
|date=April 13, 2018&lt;br /&gt;
|website=MailOnline&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=fc1&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.feministcurrent.com/2017/09/15/historic-speakers-corner-becomes-site-anti-feminist-silencing-violence/&lt;br /&gt;
|title=Historic Speaker’s Corner becomes site of anti-feminist silencing and violence&lt;br /&gt;
|author=Meghan Murphy&lt;br /&gt;
|date=September 15, 2017&lt;br /&gt;
|website=Feminist Current&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=fc2&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.feministcurrent.com/2018/04/27/trans-identified-male-tara-wolf-charged-assault-hyde-park-attack/&lt;br /&gt;
|title=Trans-identified male, Tara Wolf, convicted of assault after Hyde Park attack&lt;br /&gt;
|author=Jen Izaakson&lt;br /&gt;
|date=April 27, 2018&lt;br /&gt;
|website=Feminist Current&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=rivers&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://sanfrancisco.cbslocal.com/2018/03/07/transgender-activist-trial-oakland-triple-murder/&lt;br /&gt;
|title=Transgender Activist Ordered To Stand Trial For Oakland Triple Murder&lt;br /&gt;
|date=March 7, 2018&lt;br /&gt;
|website=CBS SF BayArea&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=camptrans&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=http://eminism.org/michigan/20000812-camptrans.txt&lt;br /&gt;
|title=&#039;MICHIGAN EIGHT&#039; EVICTED OVER FESTIVAL&#039;S NEW &#039;DON&#039;T ASK DON&#039;T TELL&#039; GENDER POLICY&lt;br /&gt;
|date=August 12, 2000&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=autostraddle&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.autostraddle.com/more-bad-news-oakland-lesbian-couple-and-their-son-brutally-murdered-by-former-lgbt-activist-359026/&lt;br /&gt;
|title=Oakland Lesbian Couple and Their Son Murdered By Former LGBT Activist&lt;br /&gt;
|author=Riese&lt;br /&gt;
|date=November 16, 2016&lt;br /&gt;
|website=Autostraddle&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=edinburgh&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.scotsman.com/news/crime/feminist-speaker-julie-bindel-attacked-by-transgender-person-at-edinburgh-university-after-talk-1-4942260&lt;br /&gt;
|title=Feminist speaker Julie Bindel &#039;attacked by transgender person&#039; at Edinburgh University after talk&lt;br /&gt;
|author=Gina Davidson&lt;br /&gt;
|date=June 6, 2019&lt;br /&gt;
|website=The Scotsman&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=planettrans&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://planettransgender.com/when-terf-attack-at-hyde-park/&lt;br /&gt;
|title=Trans Activists Vilified For Defense against TERF Attack at Hyde Park&lt;br /&gt;
|author=Kelli Busey&lt;br /&gt;
|date=September 18, 2017&lt;br /&gt;
|website=Planet Transgender&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=queerness&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://thequeerness.com/2017/09/29/trial-by-media-over-speakers-corner-fracas/&lt;br /&gt;
|title=Trial by media over Speakers’ Corner fracas&lt;br /&gt;
|author=Sam Hope&lt;br /&gt;
|date=September 29, 2017&lt;br /&gt;
|website=The Queerness&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=jamjar&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://twitter.com/magdalenberns/status/988003582250291201&lt;br /&gt;
|title=Masked transactivists surround woman on stairwell&lt;br /&gt;
|author=Magdalen Berns&lt;br /&gt;
|date=April 22, 2018&lt;br /&gt;
|website=Twitter&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=dhejne&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://fairplayforwomen.com/criminality/&lt;br /&gt;
|title=Study suggests that transwomen exhibit a male pattern of criminality&lt;br /&gt;
|date=September 8, 2018&lt;br /&gt;
|website=Fair Play For Women&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=wpcrime&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://en.wikipedia.org/wiki/Sex_differences_in_crime#Statistics&lt;br /&gt;
|title=Sex differences in crime&lt;br /&gt;
|website=Wikipedia&lt;br /&gt;
|access-date=May 31, 2019&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=freedman&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.bbc.com/news/uk-england-berkshire-46454454&lt;br /&gt;
|title=Rosa Freedman: Professor&#039;s door &#039;covered in urine&#039; after gender law debate&lt;br /&gt;
|date=December 5, 2018&lt;br /&gt;
|website=BBC News&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=vrr-fb&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.facebook.com/VancouverRapeRelief/posts/710603379412445&lt;br /&gt;
|title=Vancouver Rape Relief &amp;amp; Women&#039;s Shelter - Facebook&lt;br /&gt;
|date=August 16, 2019&lt;br /&gt;
|website=Facebook&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=vrr-twitter&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://twitter.com/VanRapeRelief/status/1166426534321647616&lt;br /&gt;
|title=VancouverRapeRelief on Twitter&lt;br /&gt;
|date=August 26, 2019&lt;br /&gt;
|website=Twitter&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=vrr-vancouverisawesome&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.vancouverisawesome.com/2019/08/28/vancouver-rape-relief-centre-targeted-vandalism-threats-transgender-controversy/&lt;br /&gt;
|title=Vancouver Rape Relief centre targeted with vandalism, threats over transgender controversy&lt;br /&gt;
|author=Jessica Kerr&lt;br /&gt;
|date=August 28, 2019&lt;br /&gt;
|website=Vancouver is Awesome&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=vrr-nationalreview&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.nationalreview.com/2019/08/women-only-rape-relief-shelter-defunded-then-vandalized/&lt;br /&gt;
|title=Women-Only Rape-Relief Shelter Defunded, Then Vandalized&lt;br /&gt;
|author=Madeleine Kearns&lt;br /&gt;
|date=August 28, 2019&lt;br /&gt;
|website=National Review&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=vrr-citynews&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.citynews1130.com/2019/08/27/vancouver-rape-relief-centre-vandalized-likely-over-restrictions-for-transgender-people/&lt;br /&gt;
|title=Vancouver Rape Relief centre vandalized, likely over restrictions for transgender people&lt;br /&gt;
|author=Jonathan Szekeres and Lauren Boothby&lt;br /&gt;
|date=Aug 27, 2019&lt;br /&gt;
|website=City News&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Language links: --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[pt:TERF]]&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Sandbox&amp;diff=1201</id>
		<title>FeministWiki:Sandbox</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Sandbox&amp;diff=1201"/>
		<updated>2022-01-18T02:19:10Z</updated>

		<summary type="html">&lt;p&gt;Technician : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Test&lt;br /&gt;
&lt;br /&gt;
Test 2&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=Mod%C3%A8le:Reply_to&amp;diff=1200</id>
		<title>Modèle:Reply to</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=Mod%C3%A8le:Reply_to&amp;diff=1200"/>
		<updated>2022-01-02T20:22:40Z</updated>

		<summary type="html">&lt;p&gt;Technician : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{#if:{{{1|&amp;lt;noinclude&amp;gt;$&amp;lt;/noinclude&amp;gt;}}}&lt;br /&gt;
 |@[[User:{{{1|Example}}}|{{{1|Example}}}]]{{#if:{{{2|}}}&lt;br /&gt;
  |, [[User:{{{2}}}|{{{2}}}]]{{#if:{{{3|}}}&lt;br /&gt;
   |, [[User:{{{3}}}|{{{3}}}]]{{#if:{{{4|}}}&lt;br /&gt;
    |, [[User:{{{4}}}|{{{4}}}]]{{#if:{{{5|}}}&lt;br /&gt;
     |, [[User:{{{5}}}|{{{5}}}]]&lt;br /&gt;
    }}&lt;br /&gt;
   }}&lt;br /&gt;
  }}&lt;br /&gt;
 }}{{{p|:}}}&lt;br /&gt;
 |{{error|Error in replyto template: Username not given. See [[Template:Reply to]] for usage.}}&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
Example use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;{{C|&amp;lt;nowiki&amp;gt;{{reply to|user1}}&amp;lt;/nowiki&amp;gt; Hey mate!}}&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;{{reply to|user1}} Hey mate!&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example replying to multiple people:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;{{C|&amp;lt;nowiki&amp;gt;{{reply to|user1|user2|user3}}&amp;lt;/nowiki&amp;gt; Hey mates!}}&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;{{reply to|user1|user2|user3}} Hey mates!&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=Mod%C3%A8le:PageSeo&amp;diff=1199</id>
		<title>Modèle:PageSeo</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=Mod%C3%A8le:PageSeo&amp;diff=1199"/>
		<updated>2021-12-30T23:26:52Z</updated>

		<summary type="html">&lt;p&gt;Technician : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{#seo:&lt;br /&gt;
|title = {{{fulltitle|{{{title|{{PAGENAME}}}}} - {{SITENAME}}}}}&lt;br /&gt;
|keywords = {{{fullkeywords|{{{keywords|{{PAGENAME}}}}}, {{SITENAME}}, feminism, wiki, feminist wiki, radical feminism, radfem, gender critical}}}&lt;br /&gt;
|description = {{{description}}}&lt;br /&gt;
|image = {{{image|FeministWiki_banner.png}}}&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
Use this template to optimize a page for SEO.  It uses the &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#seo:}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; tag underneath, which is added by the WikiSEO plugin.&lt;br /&gt;
&lt;br /&gt;
Example usage:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{PageSeo&lt;br /&gt;
|title = An alternative title&lt;br /&gt;
|keywords = blah, blub, blip&lt;br /&gt;
|description = A summary of what this wiki page is about&lt;br /&gt;
|image = Some_image.jpg&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Default values:&lt;br /&gt;
&lt;br /&gt;
* {{c|title}}: &amp;lt;nowiki&amp;gt;{{PAGENAME}}&amp;lt;/nowiki&amp;gt; - {{SITENAME}}&lt;br /&gt;
* {{c|keywords}}: &amp;lt;nowiki&amp;gt;{{PAGENAME}}&amp;lt;/nowiki&amp;gt;, {{SITENAME}}, feminism, wiki, feminist wiki, radical feminism, radfem, gender critical&lt;br /&gt;
&lt;br /&gt;
If you provide the {{c|title}} parameter, it will automatically have {{c| - {{SITENAME}}}} appended to it.&lt;br /&gt;
&lt;br /&gt;
If you provide the {{c|keywords}} parameter, it will automatically have {{c|, {{SITENAME}}, feminism, wiki, feminist wiki, radical feminism, radfem, gender critical}} appended to it.&lt;br /&gt;
&lt;br /&gt;
If you would like to control the full title or keywords tag contents, you can use {{c|fulltitle}} and {{c|fullkeywords}} instead.&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=Accueil&amp;diff=1198</id>
		<title>Accueil</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=Accueil&amp;diff=1198"/>
		<updated>2021-12-24T23:42:23Z</updated>

		<summary type="html">&lt;p&gt;Technician : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageSeo&lt;br /&gt;
|description = Welcome to the FeministWiki, a digital platform for feminism consisting of a wiki, forum, chat, blog hosting, and more.&lt;br /&gt;
}}&lt;br /&gt;
&#039;&#039;Services: [https://blogs.feministwiki.org FeministBlog] - [https://files.feministwiki.org/ FeministFiles] - [https://mail.feministwiki.org/ FeministMail] - [https://forum.feministwiki.org/ FeministForum] - [https://chat.feministwiki.org/ FeministChat] - [[Help:IRC|FeministIRC]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Welcome to &#039;&#039;&#039;FeministWiki&#039;&#039;&#039;, a wiki and integrated digital platform for feminism.&lt;br /&gt;
&lt;br /&gt;
A wiki is a knowledge-base like an encyclopedia, but managed by the public.  The FeministWiki specializes on feminism, and is managed by feminists and their supporters.  It aims to archive and present information relevant to feminism, and explain feminist perspectives to the reader.&lt;br /&gt;
&lt;br /&gt;
Further, the FeministWiki aims to offer a complete integrated digital platform for feminists, with components such as a blogging platform, a discussion forum, a messaging/chat system, private and shared online storage for large files, and more.  You don&#039;t need to provide any personally identifying information to become a member, nor do you need to pay; the modest number of users makes the platform cheap to run.&lt;br /&gt;
&lt;br /&gt;
There are a few ways to become a member:&lt;br /&gt;
* Use the [https://account.feministwiki.org/register.html Registration Request] form to ask for an account.&lt;br /&gt;
* Contact an existing member and have them create an account for you by using the [https://account.feministwiki.org/add-member.html Add Member] form.&lt;br /&gt;
* Ask for an account by manually contacting technician@feministwiki.org or by messaging an official social media account of the FeministWiki.&lt;br /&gt;
&lt;br /&gt;
Spinster: [https://spinster.xyz/@FeministWiki @FeministWiki] (preferred) &amp;lt;br/&amp;gt;&lt;br /&gt;
Twitter: [https://twitter.com/@FeministWiki @FeministWiki] &amp;lt;br/&amp;gt;&lt;br /&gt;
Facebook: [https://www.facebook.com/FeministWiki/ FeministWiki]&lt;br /&gt;
&lt;br /&gt;
Once you are a member, you will be given a username and password with which you can log in to all FeministWiki services.  For example, to log in to the wiki itself (which you are reading right now), use the small &amp;quot;Log in&amp;quot; link at the top right of the page.&lt;br /&gt;
&lt;br /&gt;
See the &#039;&#039;&#039;[[FW:Welcome|Welcome page]]&#039;&#039;&#039; for further information on the FeministWiki, written with new members in mind.&lt;br /&gt;
&lt;br /&gt;
Heads up: &#039;&#039;&#039;the FeministWiki needs you&#039;&#039;&#039;.  All of the technical infrastructure of the FeministWiki is only useful if there&#039;s a community making use of it, and content on the wiki doesn&#039;t write itself!  Be bold, don&#039;t shy off of asking for membership, and let the community and the world benefit from your added knowledge.  You can become a member even if you have no intention to contribute to the actual wiki; feel free to chat away with other members, discuss matters important to you on the forum, or use the file storage to have a central place to store your favorite information-material on feminism.&lt;br /&gt;
&lt;br /&gt;
== Check out some articles ==&lt;br /&gt;
&lt;br /&gt;
=== Notable feminists ===&lt;br /&gt;
&lt;br /&gt;
* [[Magdalen Berns]]&lt;br /&gt;
&lt;br /&gt;
=== Sex, gender, and trans activism ===&lt;br /&gt;
&lt;br /&gt;
* [[Gender]]&lt;br /&gt;
* [[Transgender ideology]]&lt;br /&gt;
* [[Cisgender]]&lt;br /&gt;
* [[Autogynephilia]]&lt;br /&gt;
* [[TERF]]&lt;br /&gt;
* [[Transwomen in women&#039;s sports]]&lt;br /&gt;
&lt;br /&gt;
=== Sex industry ===&lt;br /&gt;
&lt;br /&gt;
* [[Nordic Model]]&lt;br /&gt;
&lt;br /&gt;
=== Black feminism ===&lt;br /&gt;
&lt;br /&gt;
* [[Black feminism]]&lt;br /&gt;
&lt;br /&gt;
== What is feminism? ==&lt;br /&gt;
&lt;br /&gt;
There are a variety of ideological groupings which call themselves feminism, and some of them are in contradiction with each other.  As such, one cannot support all types of feminism at the same time.  The FeministWiki is for people who adhere to a relatively straightforward and classical interpretation of feminism: the liberation of female people from male supremacism.  This is sometimes called &#039;&#039;radical feminism&#039;&#039; because male supremacism is a radical notion for many people, and its elimination requires radical changes to society.&lt;br /&gt;
&lt;br /&gt;
Male supremacism refers to social and political systems that use stereotypes, myths, discrimination, belittlement, violence, and other means to keep men in power and women oppressed.  Women are then exploited for reproductive and domestic labor, men&#039;s sexual gratification, and more.  Male supremacism also causes collateral damage to some men and boys.  For instance, effeminate boys and gay men are often targeted with punishment for failing to uphold the myth that men are inherently masculine.&lt;br /&gt;
&lt;br /&gt;
The FeministWiki promotes second-wave feminist literature:&lt;br /&gt;
&lt;br /&gt;
* [https://radfem.org/ Radical Feminist Archives]&lt;br /&gt;
&lt;br /&gt;
The FeministWiki is in full support of the Women&#039;s Human Rights Campaign:&lt;br /&gt;
&lt;br /&gt;
* [https://www.womensdeclaration.com/ Declaration on Women&#039;s Sex-Based Rights]&lt;br /&gt;
&lt;br /&gt;
The FeministWiki recommends Spinster as a feminism-friendly social media platform:&lt;br /&gt;
&lt;br /&gt;
* [https://spinster.xyz Spinster.xyz]&lt;br /&gt;
&lt;br /&gt;
Further, the FeministWiki promotes and stands in solidarity with the following groups and organizations:&lt;br /&gt;
&lt;br /&gt;
* [http://lgballiance.org.uk LGB Alliance]: The LGB Alliance&lt;br /&gt;
* [http://womensliberationfront.org/ WoLF]: The Women&#039;s Liberation Front&lt;br /&gt;
* [https://feministcurrent.com/ Feminist Current]: Canadian feminist news, commentary, and podcasts&lt;br /&gt;
* [https://www.rapereliefshelter.bc.ca/ Vancouver Rape Relief]: Female-only rape-relief and women&#039;s shelter&lt;br /&gt;
* [https://nordicmodelnow.org/ Nordic Model Now]: Educational movement for the abolition of prostitution&lt;br /&gt;
* [http://www.spaceintl.org/ SPACE International]: Survivors of Prostitution Abuse Calling for Enlightenment&lt;br /&gt;
* [https://womansplaceuk.org/ Woman&#039;s Place UK]: Women&#039;s campaigning group scrutinizing gender self-identification&lt;br /&gt;
* [https://speakupforwomen.nz/ Speak Up for Women]: New Zealand group opposing gender self-identification&lt;br /&gt;
* [https://feministstruggle.org/ Feminists in Struggle - FIST]: US-based female-only radical feminist network&lt;br /&gt;
* [https://pussychurchofmodernwitchcraft.com/ The Pussy Church of Modern Witchcraft]: Lesbian-led Church for Women and Girls&lt;br /&gt;
&lt;br /&gt;
== Who&#039;s behind the project? ==&lt;br /&gt;
&lt;br /&gt;
The FeministWiki platform is offered to the public by the German non-profit organization &#039;&#039;&#039;FeministWiki gemeinnützige UG (haftungsbeschränkt)&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The FeministWiki g. UG is bound by German law to abide by the following mission statement (translated from German):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
1. The company exclusively and directly pursues charitable purposes within the meaning of the section &amp;quot;tax-privileged purposes&amp;quot; of the tax code (AO). The purpose of the company is to promote equality between women and men.&lt;br /&gt;
&lt;br /&gt;
2. The purpose of the statutes is achieved by operating an online platform called feministwiki.org. The platform serves as an information center on the subject of feminism, as well as a communication platform for people who want to stand up for the rights of women. &lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The technical infrastructure is managed by [[FW:Technician|the technician]], who also offers user support.  For support, please contact technician@feministwiki.org.&lt;br /&gt;
&lt;br /&gt;
For legal inquiries please contact info@feministwiki.org or feministwiki@gmail.com.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Language links --&amp;gt;&lt;br /&gt;
[[de:Hauptseite]] [[pt:Página_principal]]&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1195</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1195"/>
		<updated>2021-08-31T19:44:01Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Put config files in place */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Configure reverse DNS ===&lt;br /&gt;
&lt;br /&gt;
In the settings of the VPS host (e.g. Strato AG), you can configure reverse-DNS for the IP address of the server.  Set the FQDN for the IP address to {{C|feministwiki.org}}.  It&#039;s good to do this early since it can take some time to propagate.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the {{C|A}} entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup \&lt;br /&gt;
                 certbot \&lt;br /&gt;
                 dnsutils \&lt;br /&gt;
                 emacs \&lt;br /&gt;
                 git \&lt;br /&gt;
                 mg \&lt;br /&gt;
                 moreutils \&lt;br /&gt;
                 net-tools \&lt;br /&gt;
                 nmap \&lt;br /&gt;
                 rsync \&lt;br /&gt;
                 software-properties-common \&lt;br /&gt;
                 tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the {{C|.ssh/id_rsa}} from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in {{C|/root/pwd/meta}} on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 apt-get install apache2 \&lt;br /&gt;
                 dovecot-core \&lt;br /&gt;
                 dovecot-imapd \&lt;br /&gt;
                 dovecot-ldap \&lt;br /&gt;
                 dovecot-pop3d \&lt;br /&gt;
                 ejabberd \&lt;br /&gt;
                 fail2ban \&lt;br /&gt;
                 inspircd \&lt;br /&gt;
                 mailman \&lt;br /&gt;
                 mariadb-server \&lt;br /&gt;
                 opendkim \&lt;br /&gt;
                 postfix \&lt;br /&gt;
                 postfix-ldap \&lt;br /&gt;
                 slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in {{C|/root/pwd}}.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Install PHP and modules ===&lt;br /&gt;
&lt;br /&gt;
This should really be part of the last section, but due to the sheer number of PHP modules we want to install, it&#039;s in its own section:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install php${php_version} \&lt;br /&gt;
                 php${php_version}-apcu \&lt;br /&gt;
                 php${php_version}-bcmath \&lt;br /&gt;
                 php${php_version}-cli \&lt;br /&gt;
                 php${php_version}-ctype \&lt;br /&gt;
                 php${php_version}-curl \&lt;br /&gt;
                 php${php_version}-gd \&lt;br /&gt;
                 php${php_version}-gmp \&lt;br /&gt;
                 php${php_version}-iconv \&lt;br /&gt;
                 php${php_version}-imagick \&lt;br /&gt;
                 php${php_version}-intl \&lt;br /&gt;
                 php${php_version}-json \&lt;br /&gt;
                 php${php_version}-ldap \&lt;br /&gt;
                 php${php_version}-mbstring \&lt;br /&gt;
                 php${php_version}-mysql \&lt;br /&gt;
                 php${php_version}-opcache \&lt;br /&gt;
                 php${php_version}-readline \&lt;br /&gt;
                 php${php_version}-xml \&lt;br /&gt;
                 php${php_version}-zip&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
* Likewise, don&#039;t forget {{C|chmod +x}} for &amp;lt;code&amp;gt;/etc/cron.{hourly,daily,weekly,monthly}&amp;lt;/code&amp;gt; and {{C|/etc/boot.d}}&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules, config, and sites ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
 &lt;br /&gt;
 a2enconf 99-feministwiki&lt;br /&gt;
 &lt;br /&gt;
 a2ensite 000-wiki&lt;br /&gt;
 a2ensite account&lt;br /&gt;
 a2ensite blogs&lt;br /&gt;
 a2ensite chat&lt;br /&gt;
 a2ensite files&lt;br /&gt;
 a2ensite forum&lt;br /&gt;
 a2ensite mail&lt;br /&gt;
 a2ensite xmpp&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our {{C|letsencrypt-refresh}} script makes sure that the cert files are found in {{C|/etc/fw-certs}} and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes.  Note that although some of the steps described in this section take a long time to finish, they can be done in parallel.&lt;br /&gt;
&lt;br /&gt;
=== LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
==== Breaking changes in OpenLDAP ====&lt;br /&gt;
&lt;br /&gt;
There might be incompatible changes between OpenLDAP (aka {{C|slapd}}) versions which require manual editing of the {{C|slapcat}} output before it&#039;s read in on the new server with {{C|slapadd}}.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open {{C|/etc/ldap/schema/ppolicy.ldif}} and search for {{C|pwdMaxRecordedFailure}}.  You will note that there is a {{C|olcAttributeTypes: ...}} entry that defines it, and also it&#039;s listed in the {{C|MAY}} attributes block of the {{C|olcObjectClasses: ...}} entry that defines the {{C|pwdPolicy}} object class.&lt;br /&gt;
# On the old server, save the output of {{C|slapcat -n 0}} to a file, open the file, and search for the block where the {{C|ppolicy}} schema is defined.  It should start with the line {{C|dn: cn={4}ppolicy,cn=schema,cn=config}} (the {{C|{4}}} part might contain a different integer, that&#039;s OK).  There, note that the {{C|olcAttributeTypes: ...}} entry for {{C|pwdMaxRecordedFailure}} is missing, and also it&#039;s not listed in the {{C|MAY}} list of the {{C|pwdPolicy}} object class definition.  Copy over the attribute type definition from the {{C|ppolicy.ldif}} file on the new server, and amend the {{C|MAY}} list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Contents of /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -az --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/var/www/}} is important; if not provided, it will copy the directory to {{C|/var/www/www}} on the new server.&lt;br /&gt;
&lt;br /&gt;
=== SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | gzip | ssh root@feministwiki.dev &#039;gunzip | /root/bin/sql&#039;&lt;br /&gt;
&lt;br /&gt;
You can use the {{C|show databases;}} command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the {{C|--all-databases}} option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
=== Emails ===&lt;br /&gt;
&lt;br /&gt;
This is a simple one.  Run this command from the old server:&lt;br /&gt;
&lt;br /&gt;
 rsync -az --delete /home/vmail/ root@feministwiki.dev:/home/vmail&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/home/vmail/}} is important.&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 rsync -az --delete archives data lists root@feministwiki.dev:/var/lib/mailman&lt;br /&gt;
&lt;br /&gt;
And then this on the new server:&lt;br /&gt;
&lt;br /&gt;
 check_perms -f&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing file ownership and permissions.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch.  To do so, run this on the new server:&lt;br /&gt;
&lt;br /&gt;
 /root/bin/sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_de.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_es.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_it.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_pt.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
=== Deactivate again ===&lt;br /&gt;
&lt;br /&gt;
After we&#039;re done testing, we can &amp;quot;deactivate&amp;quot; the new server again to prepare it for the final switch-over:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
 &lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Simply repeat the whole section &#039;&#039;Copying over live data&#039;&#039;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;Copying over live data&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  For instance, the {{C|--delete}} argument to the {{C|rsync}} command and the {{C|--add-drop-database}} argument to the {{C|mysqldump}} command help to make sure of this.&lt;br /&gt;
&lt;br /&gt;
So just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Reboot the new server ===&lt;br /&gt;
&lt;br /&gt;
At this point we can reboot the new server again, to make sure all services are properly restarted.&lt;br /&gt;
&lt;br /&gt;
=== Open ports on the new server ===&lt;br /&gt;
&lt;br /&gt;
Now we can open the ports again on the new server:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main {{C|A}} entry for {{C|@}} (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The {{C|A}} entry for {{C|smtp}} since this is not allowed to be a CNAME&lt;br /&gt;
* The {{C|A}} entry for {{C|xmpp}} since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main {{C|A}} entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the {{C|letsencrypt-refresh}} script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1194</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1194"/>
		<updated>2021-08-31T19:38:06Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Put config files in place */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Configure reverse DNS ===&lt;br /&gt;
&lt;br /&gt;
In the settings of the VPS host (e.g. Strato AG), you can configure reverse-DNS for the IP address of the server.  Set the FQDN for the IP address to {{C|feministwiki.org}}.  It&#039;s good to do this early since it can take some time to propagate.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the {{C|A}} entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup \&lt;br /&gt;
                 certbot \&lt;br /&gt;
                 dnsutils \&lt;br /&gt;
                 emacs \&lt;br /&gt;
                 git \&lt;br /&gt;
                 mg \&lt;br /&gt;
                 moreutils \&lt;br /&gt;
                 net-tools \&lt;br /&gt;
                 nmap \&lt;br /&gt;
                 rsync \&lt;br /&gt;
                 software-properties-common \&lt;br /&gt;
                 tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the {{C|.ssh/id_rsa}} from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in {{C|/root/pwd/meta}} on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 apt-get install apache2 \&lt;br /&gt;
                 dovecot-core \&lt;br /&gt;
                 dovecot-imapd \&lt;br /&gt;
                 dovecot-ldap \&lt;br /&gt;
                 dovecot-pop3d \&lt;br /&gt;
                 ejabberd \&lt;br /&gt;
                 fail2ban \&lt;br /&gt;
                 inspircd \&lt;br /&gt;
                 mailman \&lt;br /&gt;
                 mariadb-server \&lt;br /&gt;
                 opendkim \&lt;br /&gt;
                 postfix \&lt;br /&gt;
                 postfix-ldap \&lt;br /&gt;
                 slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in {{C|/root/pwd}}.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Install PHP and modules ===&lt;br /&gt;
&lt;br /&gt;
This should really be part of the last section, but due to the sheer number of PHP modules we want to install, it&#039;s in its own section:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install php${php_version} \&lt;br /&gt;
                 php${php_version}-apcu \&lt;br /&gt;
                 php${php_version}-bcmath \&lt;br /&gt;
                 php${php_version}-cli \&lt;br /&gt;
                 php${php_version}-ctype \&lt;br /&gt;
                 php${php_version}-curl \&lt;br /&gt;
                 php${php_version}-gd \&lt;br /&gt;
                 php${php_version}-gmp \&lt;br /&gt;
                 php${php_version}-iconv \&lt;br /&gt;
                 php${php_version}-imagick \&lt;br /&gt;
                 php${php_version}-intl \&lt;br /&gt;
                 php${php_version}-json \&lt;br /&gt;
                 php${php_version}-ldap \&lt;br /&gt;
                 php${php_version}-mbstring \&lt;br /&gt;
                 php${php_version}-mysql \&lt;br /&gt;
                 php${php_version}-opcache \&lt;br /&gt;
                 php${php_version}-readline \&lt;br /&gt;
                 php${php_version}-xml \&lt;br /&gt;
                 php${php_version}-zip&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
* Likewise, don&#039;t forget {{C|chmod +x}} for {{C|/etc/cron.*}} and {{C|/etc/boot.d}}&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules, config, and sites ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
 &lt;br /&gt;
 a2enconf 99-feministwiki&lt;br /&gt;
 &lt;br /&gt;
 a2ensite 000-wiki&lt;br /&gt;
 a2ensite account&lt;br /&gt;
 a2ensite blogs&lt;br /&gt;
 a2ensite chat&lt;br /&gt;
 a2ensite files&lt;br /&gt;
 a2ensite forum&lt;br /&gt;
 a2ensite mail&lt;br /&gt;
 a2ensite xmpp&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our {{C|letsencrypt-refresh}} script makes sure that the cert files are found in {{C|/etc/fw-certs}} and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes.  Note that although some of the steps described in this section take a long time to finish, they can be done in parallel.&lt;br /&gt;
&lt;br /&gt;
=== LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
==== Breaking changes in OpenLDAP ====&lt;br /&gt;
&lt;br /&gt;
There might be incompatible changes between OpenLDAP (aka {{C|slapd}}) versions which require manual editing of the {{C|slapcat}} output before it&#039;s read in on the new server with {{C|slapadd}}.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open {{C|/etc/ldap/schema/ppolicy.ldif}} and search for {{C|pwdMaxRecordedFailure}}.  You will note that there is a {{C|olcAttributeTypes: ...}} entry that defines it, and also it&#039;s listed in the {{C|MAY}} attributes block of the {{C|olcObjectClasses: ...}} entry that defines the {{C|pwdPolicy}} object class.&lt;br /&gt;
# On the old server, save the output of {{C|slapcat -n 0}} to a file, open the file, and search for the block where the {{C|ppolicy}} schema is defined.  It should start with the line {{C|dn: cn={4}ppolicy,cn=schema,cn=config}} (the {{C|{4}}} part might contain a different integer, that&#039;s OK).  There, note that the {{C|olcAttributeTypes: ...}} entry for {{C|pwdMaxRecordedFailure}} is missing, and also it&#039;s not listed in the {{C|MAY}} list of the {{C|pwdPolicy}} object class definition.  Copy over the attribute type definition from the {{C|ppolicy.ldif}} file on the new server, and amend the {{C|MAY}} list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Contents of /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -az --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/var/www/}} is important; if not provided, it will copy the directory to {{C|/var/www/www}} on the new server.&lt;br /&gt;
&lt;br /&gt;
=== SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | gzip | ssh root@feministwiki.dev &#039;gunzip | /root/bin/sql&#039;&lt;br /&gt;
&lt;br /&gt;
You can use the {{C|show databases;}} command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the {{C|--all-databases}} option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
=== Emails ===&lt;br /&gt;
&lt;br /&gt;
This is a simple one.  Run this command from the old server:&lt;br /&gt;
&lt;br /&gt;
 rsync -az --delete /home/vmail/ root@feministwiki.dev:/home/vmail&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/home/vmail/}} is important.&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 rsync -az --delete archives data lists root@feministwiki.dev:/var/lib/mailman&lt;br /&gt;
&lt;br /&gt;
And then this on the new server:&lt;br /&gt;
&lt;br /&gt;
 check_perms -f&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing file ownership and permissions.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch.  To do so, run this on the new server:&lt;br /&gt;
&lt;br /&gt;
 /root/bin/sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_de.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_es.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_it.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_pt.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
=== Deactivate again ===&lt;br /&gt;
&lt;br /&gt;
After we&#039;re done testing, we can &amp;quot;deactivate&amp;quot; the new server again to prepare it for the final switch-over:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
 &lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Simply repeat the whole section &#039;&#039;Copying over live data&#039;&#039;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;Copying over live data&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  For instance, the {{C|--delete}} argument to the {{C|rsync}} command and the {{C|--add-drop-database}} argument to the {{C|mysqldump}} command help to make sure of this.&lt;br /&gt;
&lt;br /&gt;
So just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Reboot the new server ===&lt;br /&gt;
&lt;br /&gt;
At this point we can reboot the new server again, to make sure all services are properly restarted.&lt;br /&gt;
&lt;br /&gt;
=== Open ports on the new server ===&lt;br /&gt;
&lt;br /&gt;
Now we can open the ports again on the new server:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main {{C|A}} entry for {{C|@}} (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The {{C|A}} entry for {{C|smtp}} since this is not allowed to be a CNAME&lt;br /&gt;
* The {{C|A}} entry for {{C|xmpp}} since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main {{C|A}} entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the {{C|letsencrypt-refresh}} script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=TERF&amp;diff=1193</id>
		<title>TERF</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=TERF&amp;diff=1193"/>
		<updated>2021-08-31T16:01:11Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Not even pretending that this isn&amp;#039;t a witch hunt? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageSeo&lt;br /&gt;
|description = TERF is a slur used by transgender activists to debase anyone who criticizes their movement on the basis of feminist concerns.&lt;br /&gt;
|image = Sonicfox.png&lt;br /&gt;
}}&lt;br /&gt;
[[File:Terf-slur-02.png|thumb|300px|A typical tweet containing &amp;quot;terf&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
The word &#039;&#039;TERF&#039;&#039; (or &#039;&#039;terf&#039;&#039;; pl &#039;&#039;terfs&#039;&#039; or &#039;&#039;terves&#039;&#039;) is a slur that is used predominantly by transgender activists and their allies against people who criticize the transgender movement on the basis of feminist concerns.  Since the slur is used for people with feminist concerns, the main target tend to be women.  As such, it&#039;s usually understood to be an anti-feminist, sexist and misogynist slur.&lt;br /&gt;
&lt;br /&gt;
The word was invented as an acronym for &#039;&#039;Trans-Exclusionary Radical Feminist&#039;&#039;, where the &amp;quot;trans-exclusionary&amp;quot; part referred to those holding roughly the position that transwomen should not be included under a feminist definition of womanhood, and the &amp;quot;radical feminist&amp;quot; part was meant neutrally, i.e. for people who would indeed describe themselves as [[Radical feminism|radical feminists]] in the true sense.&lt;br /&gt;
&lt;br /&gt;
Over time, the acronym pretty much became a [[Wikipedia:Four-letter word|four-letter word]].  Nowadays the capitalization is frequently omitted, and the already ambiguous original meaning ignored entirely.  Still, users of the term tend to claim that it&#039;s a neutral description.  The &amp;quot;trans-exclusionary&amp;quot; part may now refer to anyone who thinks transwomen should not have unfettered access to all female-only spaces (e.g. changing rooms), should not partake in women&#039;s sports where they have [[Transwomen in women&#039;s sports|unfair advantages]], should not be considered a natural part of the lesbian dating pool, etc.  Although most members of the public would see these as rather sensible positions (especially when considering that a &amp;quot;transwoman&amp;quot; may have intact male anatomy), transgender activists nevertheless see all of these types of &amp;quot;exclusion&amp;quot; as unacceptable.&lt;br /&gt;
&lt;br /&gt;
A closely associated term is &#039;&#039;SWERF&#039;&#039;, which is supposed to stand for &#039;&#039;Sex-Worker-Exclusionary Radical Feminist&#039;&#039; and is used for those who see the sex industry (prostitution, pornography, etc.) as highly exploitative and sexist.  Like &#039;&#039;TERF&#039;&#039;, the term is almost always applied as a slur, and to misrepresent the political position of the person it&#039;s used against.  Ironically, some of those who have to face the term most commonly are women who worked in prostitution and became anti-prostitution activists as a result of their own experiences as so-called sex workers.&lt;br /&gt;
&lt;br /&gt;
== History and evolution towards hate speech ==&lt;br /&gt;
&lt;br /&gt;
=== Origin ===&lt;br /&gt;
&lt;br /&gt;
The oldest known use of the term is by Viv Smythe aka &amp;quot;tigtog&amp;quot; in a blog post from 2008.&amp;lt;ref name=terf-origin/&amp;gt;  She defended the term as late as 2018, in an article for The Guardian.&amp;lt;ref name=guardian-smythe/&amp;gt;  Transgender activists frequently try to defend the term on the grounds that Viv Smythe is a woman who herself claims to be a radical feminist, and seems to have first used the term in a way that is not derogatory.  Of course, the benign origins of a term does not mean that it cannot evolve into a slur.&lt;br /&gt;
&lt;br /&gt;
=== Early years and first principled critique ===&lt;br /&gt;
&lt;br /&gt;
The evolution of the term from 2008 into the early to mid 2010s is not well documented.  Mostly, feminists had to face the term on social media, where it began to be used regularly to debase their position.  In July 2014, [https://www.feministcurrent.com/ Feminist Current] published two articles referencing the term.  The first, written by C. K. Egbert and titled &#039;&#039;Defending the &#039;TERF&#039;: Gender as political&#039;&#039;, explains and defends in length the political theory underlining the ideas supported by feminists who are slurred as &amp;quot;terf.&amp;quot;&amp;lt;ref name=fc-egbert/&amp;gt;  The second, written by [[Sarah Ditum]] and titled &#039;&#039;How &#039;TERF&#039; works&#039;&#039;, shortly analyses a situation in which a woman is pressured to retract a statement opposing violence against women, on the grounds that the statement originally stems from a feminist who is considered a &amp;quot;terf&amp;quot;.&amp;lt;ref name=fc-ditum/&amp;gt;  Since Feminist Current is highly acclaimed among radical-leaning feminists, its decision to support the women slurred with &amp;quot;terf&amp;quot; could be seen as a turning point.&lt;br /&gt;
&lt;br /&gt;
In August 2014, Vice published an article titled &#039;&#039;I Am Now Officially a Transphobic Twitter Troll&#039;&#039; (subtitle: &#039;&#039;At least according to the &#039;Block Bot&#039; I am&#039;&#039;) by author Martin Robbins.&amp;lt;ref name=vice-robbins/&amp;gt;  In the article, Robbins talks about how the &amp;quot;Block Bot&amp;quot; project on Twitter, which is supposed to help people avoid abusive trolls, has included feminist authors and journalists such as [[Caroline Criado-Perez]] and [[Helen Lewis]] among the people who should be blocked.  Ironically, Lewis seems to have made it to the list for complaining about abusive trolls, as the &amp;quot;evidence&amp;quot; for the reason to ban her includes objections to tweets such as &amp;quot;kill TERFS&amp;quot;, &amp;quot;burn TERFS&amp;quot;, or hateful jokes such as &amp;quot;what&#039;s better than 1 dead terf? 2 dead terfs.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Another Feminist Current article defending those targeted with the slur was published in November 2015, written by [[Penny White]] and titled &#039;&#039;Why I no longer hate ‘TERFs’&#039;&#039;.&amp;lt;ref name=fc-white/&amp;gt;  In the article, White explains how she herself used to be convinced that so-called &amp;quot;TERFs&amp;quot; are worthy of contempt, but changed her mind after starting to look closer into the issue.  This experience seems to resonate with many women and some socially liberal men to this day, who start out being supportive of the transgender movement, only to start becoming skeptical after negative experiences and observations, ultimately leading them to be also labeled &amp;quot;terf&amp;quot; and shunned by transgender activists and their allies.  After that, Feminist Current started publishing articles critical of the transgender movement with some frequency, much to the enragement of transgender activists.&lt;br /&gt;
&lt;br /&gt;
=== The mainstreaming of hatred ===&lt;br /&gt;
&lt;br /&gt;
[[File:Mya-byrne-punches-terfs.jpg|thumb|left|150px|Totally not a slur!]]&lt;br /&gt;
&lt;br /&gt;
In June 2017, transgender activist [[Wikipedia:Mya Byrne|Mya Byrne]] came to the San Francisco Pride Parade with a t-shirt reading &amp;quot;I PUNCH TERFS&amp;quot;, decorated with a large fake blood-stain.  Byrne uploaded a selfie of him wearing the t-shirt at the parade, captioned &amp;quot;This is what gay liberation looks like #pride #yesallterfs&amp;quot; which sparked many negative reactions.&amp;lt;ref name=fc-tra-violence/&amp;gt;  The t-shirt would later be displayed at an &amp;quot;art exhibit&amp;quot; at the San Francisco Public Library, set up by the trans activist group &#039;&#039;The Degenderettes&#039;&#039;.  After complaints, the library removed the t-shirt from the exhibition, though similar items showcasing a violent mentality remained, such as baseball bats wrapped in barbed wire and painted in the colors of the transgender pride flag.&amp;lt;ref name=fc-tra-violence/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Sonicfox.png|thumb|right|250px|Dominique McLean&#039;s tweet glorifying violence against women.]]&lt;br /&gt;
&lt;br /&gt;
In April 2019, professional video gamer [[Wikipedia:SonicFox|Dominique McLean]] aka &amp;quot;SonicFox&amp;quot; uploaded a video on Twitter, captioned &amp;quot;what I do to terfs,&amp;quot; in which a male video game character strikes a female character&#039;s neck so hard that her skin comes off, while the camera shows her agony-filled face.  McLean can be heard yelling &amp;quot;terf!&amp;quot; into his microphone with each blow dealt to the female character, reminiscent of a lynching.&amp;lt;ref name=sonicfox/&amp;gt;  The tweet garnered hundreds of thousands of views, and many thousands of retweets and likes.&lt;br /&gt;
&lt;br /&gt;
McLean&#039;s tweet is made even worse by the fact that the hatred is not just directed at an imagined &amp;quot;terf&amp;quot; character, but at the voice actress behind the character, [[Wikipedia:Ronda Rousey|Ronda Rousey]].  Rousey, who is an MMA (mixed martial arts) fighter, is deemed a &amp;quot;TERF&amp;quot; for having stated, with blunt wording, that it&#039;s unfair for male MMA fighter [[Transwomen in women&#039;s sports#Fallon_Fox|Fallon Fox]] to compete against women.&amp;lt;ref name=rousey-fox/&amp;gt;&amp;lt;ref name=rousey-marysue/&amp;gt;&amp;lt;ref name=rousey-reddit/&amp;gt;  A year after Rousey&#039;s remarks, female MMA fighter Tamikka Brents had suffered a concussion and an orbital bone fracture during a fight with Fallon Fox,&amp;lt;ref name=fallon-fox/&amp;gt; but this does not seem to have changed the opinion of trans activists.&lt;br /&gt;
&lt;br /&gt;
After McLean&#039;s tweet was reported for hate speech, Twitter initially decided that it [[:File:Sonicfox2.png|did not break their rules]].  Only after continued protest and many more reports did Twitter react, by removing the tweet and issuing SonicFox a mere 24-hour ban.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Aftermath of McLean&#039;s tweet&amp;quot; widths=300px heights=150px&amp;gt;&lt;br /&gt;
File:Sonicfox3.jpg | McLean defending his tweet on the grounds that Ronda Rousey is a &amp;quot;TERF&amp;quot; and as such deserving of the violent contempt&lt;br /&gt;
File:Sonicfox-copycat1.png | A copycat tweet showing another video game character dying brutally, with the caption &amp;quot;FUCK TERFS&amp;quot;&lt;br /&gt;
File:Sonicfox-copycat2.png | Another copycat tweet.  The GIF is of [[Wikipedia:Mortal Kombat 11|Mortal Kombat 11]] character [[Wikipedia:Scorpion (Mortal Kombat)|Scorpion]] burning his opponent alive.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== New trend: Threaten women with your face attached ===&lt;br /&gt;
&lt;br /&gt;
In late 2019, a social media trend dubbed &amp;quot;POV you&#039;re a TERF in my mentions&amp;quot; started, in which trans activists would pose with a weapon (baseball bat, sword, machete, or the like), sometimes preparing to strike or showing them mid-strike, taken as a [[Wikipedia:Point-of-view shot|point-of-view (POV) shot]] and captioned with the phrase &amp;quot;POV you&#039;re a TERF in my mentions&amp;quot; or variations thereof.&amp;lt;ref name=pov-terf/&amp;gt;  The pictures are supposed to represent the point-of-view (POV) of a &amp;quot;TERF&amp;quot; being assaulted by the depicted person.  In other words, women called &amp;quot;TERF&amp;quot; who look at the pictures are supposed to imagine themselves being violently assaulted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Some examples of the trend&amp;quot; widths=300px heights=150px&amp;gt;&lt;br /&gt;
File:Pov-terf-1.webp&lt;br /&gt;
File:Pov-terf-2.webp&lt;br /&gt;
File:Pov-terf-3.webp&lt;br /&gt;
File:Pov-terf-4.webp&lt;br /&gt;
File:Pov-terf-5.webp&lt;br /&gt;
File:Pov-terf-6.webp&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Political justification of physical violence ===&lt;br /&gt;
&lt;br /&gt;
In May 2020, a blog post was published on Medium.com equating so-called TERFs with Nazis in a credible-sounding tone and explaining how various methods such as infiltration, censorship, property damage, and physical violence should be used against them.&amp;lt;ref name=medium-izaguirre/&amp;gt;  The account posting the article was suspended from Medium.com on the same day and the content re-uploaded on WordPress.com soon after.&amp;lt;ref name=wp-izaguirre/&amp;gt;  (Still online as of February 20th, 2021)&lt;br /&gt;
&lt;br /&gt;
=== Not even pretending that this isn&#039;t a witch hunt? ===&lt;br /&gt;
&lt;br /&gt;
[[File:Spain-witch-puppet.jpg|thumb|right|150px|Effigy of [[Wikipedia:Carmen Calvo|Carmen Calvo]] hanging from a tree.]]&lt;br /&gt;
&lt;br /&gt;
In February 2021, Spanish news reported about the appearance of a puppet hanging from a tree, with its face made to resemble female politician, author, and vice president [[Wikipedia:Carmen Calvo|Carmen Calvo]] of the Socialist Workers&#039; Party.&amp;lt;ref name=elcomun-calvo/&amp;gt;  Calvo had come under fire from trans activists for her opposition to a proposed [[gender self-identification]] law.  The puppet was hanging from a tree in Plaza 8 de Marzo in Santiago de Compostela, with a sign hanging from its neck saying &amp;quot;Me he perdido…por dónde queda el patriarcado&amp;quot; which could be translated as &amp;quot;I&#039;m lost... where&#039;s the patriarchy again?&amp;quot; referring clearly to trans activist claim that it&#039;s not them who uphold patriarchal norms, but rather the feminists who oppose them.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Real-life assault, vandalism, and harassment ==&lt;br /&gt;
&lt;br /&gt;
This section lists known incidents of real-life (offline) assault, vandalism, verbal abuse and other harassment against feminist organizations or women, by trans activists who are radicalized by the notion that so-called &amp;quot;TERFs&amp;quot; are after their human rights.  (The only case in which the motivation is not entirely clear is the triple homicide of a lesbian couple and their son, committed by formerly prominent trans activist Dana Rivers.)&lt;br /&gt;
&lt;br /&gt;
=== Vandalism of Vancouver Women&#039;s Library ===&lt;br /&gt;
&lt;br /&gt;
In February 2017, the newly opened Vancouver Women&#039;s Library was met with a small group of vandals, including a very obviously male person who claimed to be a female sex worker.  They ripped off a poster, poured wine on a book, and harassed those trying to partake in the opening celebration.  Their stated reason was that the library included books which they deemed to support so-called &amp;quot;TERF&amp;quot; and &amp;quot;SWERF&amp;quot; ideology.&amp;lt;ref name=vwl/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Images of the vandalism&amp;quot; widths=210px heights=175px&amp;gt;&lt;br /&gt;
File:VWL-Vandalized-1.jpg | Crude graffiti sprayed at the entrance&lt;br /&gt;
File:VWL-Vandalized-2.jpg | Close-up of some of the sprayed text&lt;br /&gt;
File:VWL-Vandalized-3.jpg | Wine poured on one of the books&lt;br /&gt;
File:VWL-Defamation.jpg | The supposed reason for the vandalism&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Physical assault at Speakers&#039; Corner, London ===&lt;br /&gt;
&lt;br /&gt;
In September 2017, Maria MacLachlan was physically assaulted by a transgender activist.&lt;br /&gt;
&lt;br /&gt;
Initially, a group of feminists wanted to hold a meeting to discuss proposed changes to the [https://www.feministcurrent.com/2018/09/14/never-mind-reforming-gender-recognition-act-theres-no-need-gender-recognition-certificates/ Gender Recognition Act] (GRA) in the [https://newxlearning.org/ New Cross Learning] community Library in London.  The library had to cancel the event after harassment by transgender activists.  The organizers of the meeting then decided to meet at Speakers&#039; Corner, before going to the newly chosen meeting place, which was not announced to protect it from harassment.&lt;br /&gt;
&lt;br /&gt;
[[File:Tara-Flik-Wood-threat.webp|thumb|right|300px|Wolf going by the name &amp;quot;Tara Flik Wood&amp;quot; on social media, posting intent to assault prior to the event]]&lt;br /&gt;
&lt;br /&gt;
At Speakers&#039; Corner, the women were met with a group of transgender activists shouting slogans, notably &amp;quot;when TERFs attack, we fight back.&amp;quot;  Maria MacLachlan, who was filming the protesters with her digital camera, was attacked by someone running out of the trans activist group, who then tried to grab her camera.  As the unsuccessful attacker ran back behind his friends, MacLachlan tried to get closer to the group to get his face on camera.  Several of the activists started assaulting her in that moment.  The whole sequence of events was [https://www.youtube.com/watch?v=9_d3ozhSE-U caught on camera] thanks others at the place also filming what was going on.  MacLachlan&#039;s camera was broken and the memory card stolen.&lt;br /&gt;
&lt;br /&gt;
One of the attackers, later revealed to be Tara Wolf, was ultimately charged with assault by beating.  Prior to the event, he had posted that he wants to &amp;quot;f*ck up some terfs&amp;quot; on social media.&lt;br /&gt;
&lt;br /&gt;
The event could be considered a cornerstone in the escalating hatred transgender activists show against feminists, as no such clearly documented assault in relation to the slur &amp;quot;TERF&amp;quot; existed before, and the event gained widespread attention in the news, being covered by The Guardian,&amp;lt;ref name=guardian/&amp;gt; The New Statesman,&amp;lt;ref name=statesman1/&amp;gt;&amp;lt;ref name=statesman2/&amp;gt; The Telegraph,&amp;lt;ref name=telegraph/&amp;gt; The Times,&amp;lt;ref name=times1/&amp;gt;&amp;lt;ref name=times2/&amp;gt; The Evening Standard,&amp;lt;ref name=standard/&amp;gt; and The Daily Mail.&amp;lt;ref name=dailymail/&amp;gt;  Of course, it was also covered by Feminist Current.&amp;lt;ref name=fc1/&amp;gt;&amp;lt;ref name=fc2/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the aftermath of the event, many transgender activists online defended or even celebrated the assault, leading Meghan Murphy to publish the piece [https://www.feministcurrent.com/2017/09/21/terf-isnt-slur-hate-speech/ &#039;&#039; &#039;TERF&#039; isn&#039;t just a slur, it&#039;s hate speech&#039;&#039;].  Some publications in support of transgender activists have tried to claim that the assailant was really acting in self-defense, and tried to prove this claim by uploading carefully edited cuts of the recording showing the assault,&amp;lt;ref name=planettrans/&amp;gt; or by framing the assault as &amp;quot;standing up to bullies&amp;quot; who &amp;quot;provoke&amp;quot; transgender activists (by having opinions they don&#039;t like, we have to presume).&amp;lt;ref name=queerness/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Images&amp;quot; widths=300px heights=175px&amp;gt;&lt;br /&gt;
File:Tara-Flik-Wood-attack.png | A frame from the video documenting the assault&lt;br /&gt;
File:Tara-Flik-Wood-supporters.jpg | Some of Wolf&#039;s supporters outside court&lt;br /&gt;
File:MacLachlan-supporters.jpg | For contrast, MacLachlan&#039;s supporters&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Verbal abuse and other harassment against Prof. Rosa Freedman ===&lt;br /&gt;
&lt;br /&gt;
In December 2018, human rights lawyer Prof. [[Rosa Freedman]] found her office door covered in urine after attending debates surrounding proposed changes to the UK&#039;s Gender Recognition Act.  She also reported being called a &amp;quot;Nazi&amp;quot; (she is Jewish) who &amp;quot;should be raped&amp;quot; (she is a survivor of sexual violence) and receiving abusive anonymous phone calls.&amp;lt;ref name=freedman/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Trans activist Dana Rivers commits triple homicide ===&lt;br /&gt;
&lt;br /&gt;
In 2018, transgender activist Dana Rivers was on trial for triple murder.&amp;lt;ref name=rivers/&amp;gt;  The victims were a lesbian couple and their adoptive son.  Rivers stabbed and shot the victims, before trying to set their house on fire, in November 2016.  It remains unclear whether Rivers was motivated by the hatred against feminists and lesbians promulgated by transgender activists.  Rivers was, however, a member of the group [[Wikipedia:Camp Trans|Camp Trans]], which was created to protest the women-only rule of the Michigan Womyn&#039;s Music Festival (aka MichFest).&amp;lt;ref name=camptrans/&amp;gt;  Autostraddle described Rivers as a &amp;quot;very well-known transgender activist.&amp;quot;&amp;lt;ref name=autostraddle/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Trans activist lashes at Julie Bindel after speech ===&lt;br /&gt;
&lt;br /&gt;
[[File:Joe-brennan-twitter.jpg|thumb|right|200px|&amp;quot;Cathy Brennan&amp;quot; encouraging physical violence against women]]&lt;br /&gt;
&lt;br /&gt;
In June 2019, [[Julie Bindel]] was physically attacked by a trans-identifying male person after holding a keynote speech about male violence against women at the Edinburgh University, together with Prof. Rosa Freedman.&amp;lt;ref name=edinburgh/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bindel recounted the incidence the following way: &amp;quot;He was shouting and ranting and raving, &#039;you&#039;re a f***** c***, you&#039;re a f****** bitch, a f****** Terf&amp;quot; and the rest of it.  We were trying to walk to the cab to take us to the airport, and then he just lunged at me and almost punched me in the face, but a security guard pulled him away.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The male person, who calls himself &amp;quot;[[Cathy Brennan]]&amp;quot; (not to be confused with the lesbian and radical feminist lawyer who was born with that name) had previously stood out on social media for encouraging physical violence against feminists at Gay Pride events.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
=== Harassment and vandalism against Vancouver Rape Relief ===&lt;br /&gt;
&lt;br /&gt;
In August 16, 2019, the Facebook account of [[Vancouver Rape Relief and Women&#039;s Shelter]] reported that a dead rat had been nailed to their door frame.&amp;lt;ref name=vrr-fb/&amp;gt;  On August 26, their Twitter account followed up by reporting their door and windows were vandalized with phrases such as &amp;quot;FUCK TERFS&amp;quot; and &amp;quot;KILL TERFS&amp;quot; as well as &amp;quot;TRANS POWER&amp;quot;.&amp;lt;ref name=vrr-twitter/&amp;gt;  The repeated harassment and vandalism garnered attention in local and national news.&amp;lt;ref name=vrr-vancouverisawesome/&amp;gt;&amp;lt;ref name=vrr-nationalreview/&amp;gt;&amp;lt;ref name=vrr-citynews/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Images of the vandalism&amp;quot; widths=300px heights=175px&amp;gt;&lt;br /&gt;
File:Vrr-vandalism1.jpg | A dead rat nailed to the door frame of VRR&lt;br /&gt;
File:Vrr-vandalism2.jpg | The text &amp;quot;KILL TERFS ... TRANS POWER&amp;quot; written on the window&lt;br /&gt;
File:Vrr-vandalism3.jpg | The phrases &amp;quot;FUCK TERFS&amp;quot; and &amp;quot;TRANS WOMEN ARE WOMEN&amp;quot; written on the door and window&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Analysis of the term ==&lt;br /&gt;
&lt;br /&gt;
[[File:Theterfs-delusion.png|thumb|right|500px|Some of the extreme hyperbole used to justify hatred against radical feminists]]&lt;br /&gt;
&lt;br /&gt;
The original acronym could be split in two halves: &amp;quot;trans-exclusionary&amp;quot; and &amp;quot;radical feminist.&amp;quot;  Though many people targeted with the word do not see themselves as radical feminists, their ideals most often tend to align with [[radical feminism]] anyway, making that part somewhat accurate.  The &amp;quot;trans-exclusionary&amp;quot; part however is rather ambiguous, and its meaning seems to change at the whim of the person using the term.&lt;br /&gt;
&lt;br /&gt;
When those using the term want to justify it as an objective and accurate description, they will use rather mundane and basic definitions of &amp;quot;exclusion&amp;quot; that applies easily to most people the term is used against.  Examples of this might include:&lt;br /&gt;
&lt;br /&gt;
* Wanting transwomen with unfair anatomic advantages to be excluded from women&#039;s sports&lt;br /&gt;
* Wanting transwomen with an obvious male anatomy (such as intact male genitals) to be excluded from sex segregated spaces of privacy, such as changing rooms&lt;br /&gt;
* Not considering transwomen to be &#039;&#039;literally&#039;&#039; women, by pointing at the dictionary definition that is &amp;quot;adult human female&amp;quot;&lt;br /&gt;
* Wanting to exclude transwomen from some political groups that want to focus on struggles unique to people born with female anatomy&lt;br /&gt;
* Wanting to exclude crimes committed by transwomen from being recorded as female criminality, especially since the crime patterns of transwomen seem more in line with crime patterns of men,&amp;lt;ref name=dhejne/&amp;gt; who commit the vast majority of violent crimes, specifically sexual violence&amp;lt;ref name=wpcrime/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, once the term &amp;quot;TERF&amp;quot; is applied to someone on the basis of them holding these opinions (which many people including non-feminists would agree are sensible), the definition of &amp;quot;exclusion&amp;quot; is quickly sharpened to justify expressions of hatred.  Sometimes, the &amp;quot;trans-exclusionary&amp;quot; is even hyperbolically turned into &amp;quot;trans-exterminatory&amp;quot; to increase its panic-inducing effect.  The website (or should we say whacksite) [http://theterfs.com/ &#039;&#039;The TERFs&#039;&#039;] goes as far as claiming that the people labeled &amp;quot;TERF&amp;quot; want to:&lt;br /&gt;
&lt;br /&gt;
* Exclude trans people from housing (make them homeless)&lt;br /&gt;
* Exclude trans people from employment (make them unemployed)&lt;br /&gt;
* Exclude them from education (keep them uneducated)&lt;br /&gt;
* Exclude them from accommodation equality&lt;br /&gt;
* Exclude them from local, state, national and United Nations protections(!)&lt;br /&gt;
&lt;br /&gt;
As such, the women labeled &amp;quot;TERF&amp;quot; are represented less as women who simply want to uphold women&#039;s sex-based rights, and more like fascist monsters.  This is then used to incite hatred and violence against them.  It&#039;s also noteworthy how exclusion of transwomen (from female-only spaces etc.) turns here into supposed exclusion of all trans people (from whatever).  In fact, women targeted as &amp;quot;TERFs&amp;quot; will frequently say explicitly that they welcome transmen in their groups, since transmen also face the sex-based oppression all women face from birth.&lt;br /&gt;
&lt;br /&gt;
The strategy of transgender activists of using simple definitions of &amp;quot;TERF&amp;quot; to make the term look accurate, but then twist the definition to justify hatred, is quite similar to a &amp;quot;troll&amp;quot; strategy that has been noted by philosopher Nicholas Shackel, and dubbed the &#039;&#039;Motte and Bailey Doctrine&#039;&#039; in a paper titled [https://philpapers.org/archive/SHATVO-2.pdf &#039;&#039;The Vacuity of Postmodernist Methodology&#039;&#039;]:&lt;br /&gt;
&lt;br /&gt;
[[File:Motte-Bailey.png|thumb|right|500px|An illustration of the &amp;quot;motte and bailey&amp;quot; style of fallacious argumentation.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;em&amp;gt;&lt;br /&gt;
&amp;quot;Troll’s Truisms are used to insinuate an exciting falsehood, which is a desired doctrine, yet permit retreat to the trivial truth when pressed by an opponent.  In so doing they exhibit a property which makes them the simplest possible case of what I shall call a Motte and Bailey Doctrine (since a doctrine can be a single belief or an entire body of beliefs).&lt;br /&gt;
&lt;br /&gt;
A Motte and Bailey castle is a medieval system of defence in which a stone tower on a mound (the Motte) is surrounded by an area of land (the Bailey) which in turn is encompassed by some sort of a barrier such as a ditch.  Being dark and dank, the Motte is not a habitation of choice.  The only reason for its existence is the desirability of the Bailey, which the combination of the Motte and ditch makes relatively easy to retain despite attack by marauders.  When only lightly pressed, the ditch makes small numbers of attackers easy to defeat as they struggle across it: when heavily pressed the ditch is not defensible and so neither is the Bailey.  Rather one retreats to the insalubrious but defensible, perhaps impregnable, Motte.  Eventually the marauders give up, when one is well placed to reoccupy desirable land.&lt;br /&gt;
&lt;br /&gt;
For my purposes the desirable but only lightly defensible territory of the Motte and Bailey castle, that is to say, the Bailey, represents a philosophical doctrine or position with similar properties: desirable to its proponent but only lightly defensible.  The Motte is the defensible but undesired position to which one retreats when hard pressed.  I think it is evident that Troll’s Truisms have the Motte and Bailey property, since the exciting falsehoods constitute the desired but indefensible region within the ditch whilst the trivial truth constitutes the defensible but dank Motte to which one may retreat when pressed.&amp;quot;&lt;br /&gt;
&amp;lt;/em&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In our case, the &#039;&#039;Motte&#039;&#039; is an easily defensible statement like: &#039;&#039;&amp;quot;You don&#039;t consider transwomen literally women, therefore you are trans-exclusionary, which makes you a TERF.&amp;quot;&#039;&#039;  Whereas the &#039;&#039;Bailey&#039;&#039; is: &#039;&#039;&amp;quot;You want to exclude trans people from housing and employment, therefore I&#039;m justified in hating you with a passion!&amp;quot;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It could also be called a &amp;quot;bait-and-switch&amp;quot; argument, where one is &amp;quot;baited&amp;quot; into agreeing with the claim that someone is a &amp;quot;TERF&amp;quot; by using a mundane definition of &amp;quot;trans exclusion,&amp;quot; and then the definition is switched into something bad, to justify expressions of hatred.&lt;br /&gt;
&lt;br /&gt;
=== Inspection of the claims on &#039;&#039;The TERFs&#039;&#039; ===&lt;br /&gt;
&lt;br /&gt;
[[File:Theterfs-logo.png|thumb|right|300px|Actual logo of TheTERFs.com: Evil black scribbles]]&lt;br /&gt;
&lt;br /&gt;
It should be noted that &#039;&#039;The TERFs&#039;&#039; offers little more than out-of-context quotes from several decades ago as &amp;quot;evidence&amp;quot; for its hyperbolic claims regarding so-called &amp;quot;TERF&amp;quot; ideology.  It also showcases a small number of cherry-picked tweets, half of which are from right-wing sources that also happen to oppose the transgender movement, which trans activists claim proves that feminists are secretly allied with them in a big conspiracy.  (This line of thinking is often ridiculed as: &amp;quot;Hitler was a vegetarian, therefore vegetarians are Nazis.&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Regarding supposed evidence of &amp;quot;real-life violence motivated by TERF ideology,&amp;quot; the website lists six examples, of which three don&#039;t actually present any violence.  Those which do, relate to incidences from several decades ago, in which women tried to evict transwomen from female-only groups or spaces, using physical force or face-to-face threats.  Since women are expected to be always nice and passive towards males, even when trying to form radical feminist groups and keep males out of them, this is of course seen as unacceptable.  Two examples are about verbal threats, which is a run-of-the-mill experience for feminists opposing transgender activists, and the last one is about the deaths of trans people that are &#039;&#039;assumed&#039;&#039; to be related to lack of access to health care, which to be very blunt has fuck-all to do with feminist ideologies.&lt;br /&gt;
&lt;br /&gt;
To summarize: there is not a single documented instance of a feminist group going up to a transgender group to assault or threaten them.  Any claims of &amp;quot;violence by TERFs&amp;quot; refer either to women trying to evict transwomen from female-only spaces, extremely rare verbal threats, and lots and lots of fabrication.  In comparison, transgender activists have gone to women&#039;s libraries to vandalize them,&amp;lt;ref name=vwl/&amp;gt; went to feminist meetings to assault women,&amp;lt;ref name=fc1/&amp;gt;&amp;lt;ref name=fc2/&amp;gt; appeared with face masks at feminist conferences to intimidate women,&amp;lt;ref name=jamjar/&amp;gt; and the ubiquitous verbal abuse they send in the direction of women fills up [https://terfisaslur.com/ a whole website] set up solely to archive it.&lt;br /&gt;
&lt;br /&gt;
== &#039;SWERF&#039; ==&lt;br /&gt;
&lt;br /&gt;
The word &#039;&#039;SWERF&#039;&#039; is a close relative to &#039;&#039;TERF&#039;&#039; and is applied in a similarly dishonest, misrepresenting way.  Women (and men who care about women&#039;s rights) who are critical of the sex industry for its exploitative nature are accused of being &amp;quot;sex-worker exclusionary&amp;quot; in an attempt to make them seem hateful towards an oppressed group.&lt;br /&gt;
&lt;br /&gt;
In fact, the people slurred as &amp;quot;SWERF&amp;quot; tend to be supporters of the [[Nordic Model]] against prostitution, which sees a high-quality welfare system as a necessary component in tackling prostitution, and in alleviating problems faced by women who would otherwise choose to do prostitution out of economic desperation.  Further, many of those slurred &amp;quot;SWERF&amp;quot; tend to be women who worked in prostitution themselves.&lt;br /&gt;
&lt;br /&gt;
Notably, one of the biggest anti-prostitution and anti-pornography feminists [[Andrea Dworkin]] was an ex-prostitute herself, and not ashamed of admitting so.  Another notable example is [[Rachel Moran]], who was in prostitution between the ages of 15 and 22, only to become one of the most notable anti-prostitution, pro-Nordic Model activists in recent years.&lt;br /&gt;
&lt;br /&gt;
== Gallery ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Some examples of tweets using &#039;terf&#039;&amp;quot; widths=300px heights=150px&amp;gt;&lt;br /&gt;
File:Terf-gallery-1.png | &amp;quot;terf isn&#039;t a slur ... terfs don&#039;t deserve rights&amp;quot;&lt;br /&gt;
File:Terf-gallery-2.jpg | &amp;quot;All terfs will be arrested on sight&amp;quot;&lt;br /&gt;
File:Terf-gallery-3.jpg | &amp;quot;It&#039;s [[Wikipedia:Pride Month|Pride]] punch a terf&amp;quot;&lt;br /&gt;
File:Terf-gallery-4.png | Putting &amp;quot;terf&amp;quot; right aside &amp;quot;nazi&amp;quot;&lt;br /&gt;
File:Terf-gallery-5.png | [[Wikipedia:Arthur Chu|Arthur Chu]] supporting SonicFox&#039;s hate speech&lt;br /&gt;
File:Terf-gallery-6.png | &amp;quot;Being a TERF is a choice.  Like being a Nazi.&amp;quot;&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Transgender ideology]]&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.feministcurrent.com/2017/09/21/terf-isnt-slur-hate-speech/ TERF isn&#039;t just a slur, it&#039;s hate speech | Feminist Current]&lt;br /&gt;
* [https://www.feministcurrent.com/tag/terf/ TERF Archives | Feminist Current]&lt;br /&gt;
* [https://speakupforwomen.nz/dont-call-women-terfs/ Don&#039;t Call Women &#039;Terfs&#039; | Speak Up for Women NZ]&lt;br /&gt;
* [https://terfisaslur.com/ terfisaslur.com - Documenting the abuse, harassment and misogyny of transgender identity politics]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=terf-origin&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://hoydenabouttown.com/2008/08/17/carnivalia-transgenderism-and-the-gender-binary/&lt;br /&gt;
|title=Carnivalia, transgenderism and the gender binary&lt;br /&gt;
|author=Viv Smythe (aka tigtog)&lt;br /&gt;
|date=August 17, 2008&lt;br /&gt;
|website=Hoyden About Town&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=guardian-smythe&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.theguardian.com/commentisfree/2018/nov/29/im-credited-with-having-coined-the-acronym-terf-heres-how-it-happened&lt;br /&gt;
|title=I&#039;m credited with having coined the word &#039;Terf&#039;. Here&#039;s how it happened&lt;br /&gt;
|author=Viv Smythe (aka tigtog)&lt;br /&gt;
|date=November 28, 2018&lt;br /&gt;
|website=The Guardian&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=fc-egbert&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.feministcurrent.com/2014/07/16/defending-the-terf-gender-as-political/&lt;br /&gt;
|title=Defending the ‘TERF’: Gender as political&lt;br /&gt;
|author=C.K. Egbert&lt;br /&gt;
|date=July 16, 2014&lt;br /&gt;
|website=Feminist Current&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=fc-ditum&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.feministcurrent.com/2014/07/29/how-terf-works/&lt;br /&gt;
|title=How ‘TERF’ works&lt;br /&gt;
|author=Sarah Ditum&lt;br /&gt;
|date=July 29, 2014&lt;br /&gt;
|website=Feminist Current&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=vice-robbins&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.vice.com/en_uk/article/7bap7y/whats-the-block-blot-martin-robbins-757&lt;br /&gt;
|title=I Am Now Officially a Transphobic Twitter Troll&lt;br /&gt;
|author=Martin Robbins&lt;br /&gt;
|date=August 8, 2014&lt;br /&gt;
|website=Vice&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=fc-white&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.feministcurrent.com/2015/11/10/why-i-no-longer-hate-terfs/&lt;br /&gt;
|title=Why I no longer hate ‘TERFs’&lt;br /&gt;
|author=Penny White&lt;br /&gt;
|date=November 10, 2015&lt;br /&gt;
|website=Feminist Current&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=fc-tra-violence&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.feministcurrent.com/2018/05/01/trans-activism-become-centered-justifying-violence-women-time-allies-speak/&lt;br /&gt;
|title=Trans activism is excusing &amp;amp; advocating violence against women, and it’s time to speak up&lt;br /&gt;
|author=Meghan Murphy&lt;br /&gt;
|date=May 1, 2018&lt;br /&gt;
|website=Feminist Current&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=sonicfox&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.newstatesman.com/politics/feminism/2019/05/welcome-age-ironic-bigotry-where-old-hatreds-are-cloaked-woke-new-language&lt;br /&gt;
|title=Welcome to the age of ironic bigotry, where old hatreds are cloaked in woke new language&lt;br /&gt;
|author=Helen Lewis&lt;br /&gt;
|date=May 1, 2019&lt;br /&gt;
|website=The New Statesman&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=rousey-fox&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://bleacherreport.com/articles/1651451-ronda-rousey-vs-fallon-fox-head-to-toe-breakdown&lt;br /&gt;
|title=Ronda Rousey vs. Fallon Fox Head-to-Toe Breakdown&lt;br /&gt;
|author=Jordy McElroy&lt;br /&gt;
|date=May 25, 2013&lt;br /&gt;
|website=Bleacher Report&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=rousey-marysue&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.themarysue.com/ronda-rousey-and-transmisogyny/&lt;br /&gt;
|title=When Role Models Become Problematic: Ronda Rousey and Transmisogyny&lt;br /&gt;
|author=Teresa Jusino&lt;br /&gt;
|date=August 3, 2015&lt;br /&gt;
|website=The Mary Sue&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=fallon-fox&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://archive.is/yZfcs&lt;br /&gt;
|title=After Being TKO’d by Fallon Fox, Tamikka Brents Says Transgender Fighters in MMA ‘Just Isn’t Fair’&lt;br /&gt;
|website=Cage Potato&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=rousey-reddit&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.reddit.com/r/GamerGhazi/comments/ah4120/celebrity_terf_ronda_rousey_to_play_sonya_blade/&lt;br /&gt;
|title=Celebrity TERF Ronda Rousey to play Sonya Blade in Mortal Kombat 11&lt;br /&gt;
|website=reddit&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=pov-terf&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://web.archive.org/web/20191019184351/https://radfemrebecca.wordpress.com/2019/10/06/terfinmymentions/amp/&lt;br /&gt;
|title=“This is what I want to do to you” – Dissecting the ‘POV ur a TERF in my mentions’ trend.&lt;br /&gt;
|author=Rebecca&lt;br /&gt;
|date=October 6, 2019&lt;br /&gt;
|website=radfemrebecca.wordpress.com&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=medium-izaguirre&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://web.archive.org/web/20200527135844/https://medium.com/@laura.izaguirre/resisting-terfs-and-transforming-their-organizations-95cd21714fc8&lt;br /&gt;
|title=Resisting TERF&#039;s and Transforming Their Organizations (Archived from Medium.com)&lt;br /&gt;
|author=Laura Izaguirre&lt;br /&gt;
|date=May 26, 2020&lt;br /&gt;
|website=Medium.com&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=elcomun-calvo&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://elcomun.es/2021/02/20/violencia-machista-ahorcan-a-una-muneca-con-la-cara-de-carmen-calvo-en-santiago/&lt;br /&gt;
|title=Violencia machista: Ahorcan a una muñeca con la cara de Carmen Calvo en Santiago (English: &amp;quot;Sexist violence: They hang a doll with the face of Carmen Calvo in Santiago&amp;quot;)&lt;br /&gt;
|date=February 20, 2021&lt;br /&gt;
|website=El Común&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
English translation by Google: https://2lovojqocmwrvggaapshhrg6yi-adwhj77lcyoafdy-elcomun-es.translate.goog/2021/02/20/violencia-machista-ahorcan-a-una-muneca-con-la-cara-de-carmen-calvo-en-santiago/&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=wp-izaguirre&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://web.archive.org/web/20200528035805/https://queeratxlaura.wordpress.com/2020/05/27/resisting-terfs-and-transforming-their-organizations/&lt;br /&gt;
|title=Resisting TERF&#039;s and Transforming Their Organizations (Archived from WordPress.com)&lt;br /&gt;
|author=Laura Izaguirre&lt;br /&gt;
|date=May 28, 2020&lt;br /&gt;
|website=WordPress&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=vwl&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.feministcurrent.com/2017/02/07/vancouver-womens-library-opens-amid-anti-feminist-backlash/&lt;br /&gt;
|title=Vancouver Women’s Library opens amid anti-feminist backlash&lt;br /&gt;
|author=Meghan Murphy&lt;br /&gt;
|date=February 7, 2017&lt;br /&gt;
|website=Feminist Current&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=guardian&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.theguardian.com/uk-news/2017/oct/26/woman-punched-in-brawl-between-transgender-activists-and-radical-feminists&lt;br /&gt;
|title=Suspects sought after brawl between transgender activists and radical feminists&lt;br /&gt;
|author=Press Association&lt;br /&gt;
|date=October 26, 2017&lt;br /&gt;
|website=The Guardian&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=statesman1&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.newstatesman.com/politics/feminism/2018/04/madness-our-gender-debate-where-feminists-defend-slapping-60-year-old&lt;br /&gt;
|title=The madness of our gender debate, where feminists defend slapping a 60-year-old woman&lt;br /&gt;
|author=Helen Lewis&lt;br /&gt;
|date=April 20, 2018&lt;br /&gt;
|website=NewStatesman&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=statesman2&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.newstatesman.com/politics/feminism/2017/09/trans-rights-terfs-and-bruised-60-year-old-what-happened-speakers-corner&lt;br /&gt;
|title=Trans rights, TERFs, and a bruised 60-year-old: what happened at Speakers’ Corner?&lt;br /&gt;
|author=Anoosh Chakelian&lt;br /&gt;
|date=September 14, 2017&lt;br /&gt;
|website=NewStatesman&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=telegraph&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.telegraph.co.uk/news/2018/04/12/radical-feminist-warned-refer-transgender-defendant-assault/&lt;br /&gt;
|title=Radical feminist warned to refer to transgender defendant as a &#039;she&#039; during assault case&lt;br /&gt;
|author=Victoria Ward&lt;br /&gt;
|date=April 12, 2018&lt;br /&gt;
|website=The Telegraph&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=times1&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.thetimes.co.uk/article/transgender-activist-denies-thumping-radical-feminist-wvzgq6fx7&lt;br /&gt;
|title=Transgender activist Tara Wolf denies thumping radical feminist&lt;br /&gt;
|author=Lucy Bannerman&lt;br /&gt;
|date=April 12, 2018&lt;br /&gt;
|website=The Times&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=times2&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.thetimes.co.uk/article/trans-attacker-tara-wolf-is-a-thug-says-feminist-maria-maclachlan-pq0bwvthv&lt;br /&gt;
|title=Trans attacker is a thug, says feminist&lt;br /&gt;
|author=Lucy Bannerman&lt;br /&gt;
|date=April 14, 2018&lt;br /&gt;
|website=The Times&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=standard&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.standard.co.uk/news/crime/transgender-activist-tara-wolf-fined-150-for-assaulting-exclusionary-radical-feminist-in-hyde-park-a3813856.html&lt;br /&gt;
|title=Transgender activist Tara Wolf fined £150 for assaulting &#039;exclusionary&#039; radical feminist in Hyde Park&lt;br /&gt;
|author=Martin Coulter&lt;br /&gt;
|date=April 13, 2018&lt;br /&gt;
|website=EveningStandard&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=dailymail&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.dailymail.co.uk/news/article-5613057/Model-punched-feminist-smashed-120-camera-violent-brawl-walks-free-court.html&lt;br /&gt;
|title=Transgender model who punched feminist and smashed her £120 camera in violent brawl at Hyde Park Speakers&#039; Corner protest walks free from court&lt;br /&gt;
|author=Bridie Pearson-jones&lt;br /&gt;
|date=April 13, 2018&lt;br /&gt;
|website=MailOnline&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=fc1&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.feministcurrent.com/2017/09/15/historic-speakers-corner-becomes-site-anti-feminist-silencing-violence/&lt;br /&gt;
|title=Historic Speaker’s Corner becomes site of anti-feminist silencing and violence&lt;br /&gt;
|author=Meghan Murphy&lt;br /&gt;
|date=September 15, 2017&lt;br /&gt;
|website=Feminist Current&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=fc2&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.feministcurrent.com/2018/04/27/trans-identified-male-tara-wolf-charged-assault-hyde-park-attack/&lt;br /&gt;
|title=Trans-identified male, Tara Wolf, convicted of assault after Hyde Park attack&lt;br /&gt;
|author=Jen Izaakson&lt;br /&gt;
|date=April 27, 2018&lt;br /&gt;
|website=Feminist Current&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=rivers&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://sanfrancisco.cbslocal.com/2018/03/07/transgender-activist-trial-oakland-triple-murder/&lt;br /&gt;
|title=Transgender Activist Ordered To Stand Trial For Oakland Triple Murder&lt;br /&gt;
|date=March 7, 2018&lt;br /&gt;
|website=CBS SF BayArea&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=camptrans&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=http://eminism.org/michigan/20000812-camptrans.txt&lt;br /&gt;
|title=&#039;MICHIGAN EIGHT&#039; EVICTED OVER FESTIVAL&#039;S NEW &#039;DON&#039;T ASK DON&#039;T TELL&#039; GENDER POLICY&lt;br /&gt;
|date=August 12, 2000&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=autostraddle&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.autostraddle.com/more-bad-news-oakland-lesbian-couple-and-their-son-brutally-murdered-by-former-lgbt-activist-359026/&lt;br /&gt;
|title=Oakland Lesbian Couple and Their Son Murdered By Former LGBT Activist&lt;br /&gt;
|author=Riese&lt;br /&gt;
|date=November 16, 2016&lt;br /&gt;
|website=Autostraddle&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=edinburgh&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.scotsman.com/news/crime/feminist-speaker-julie-bindel-attacked-by-transgender-person-at-edinburgh-university-after-talk-1-4942260&lt;br /&gt;
|title=Feminist speaker Julie Bindel &#039;attacked by transgender person&#039; at Edinburgh University after talk&lt;br /&gt;
|author=Gina Davidson&lt;br /&gt;
|date=June 6, 2019&lt;br /&gt;
|website=The Scotsman&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=planettrans&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://planettransgender.com/when-terf-attack-at-hyde-park/&lt;br /&gt;
|title=Trans Activists Vilified For Defense against TERF Attack at Hyde Park&lt;br /&gt;
|author=Kelli Busey&lt;br /&gt;
|date=September 18, 2017&lt;br /&gt;
|website=Planet Transgender&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=queerness&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://thequeerness.com/2017/09/29/trial-by-media-over-speakers-corner-fracas/&lt;br /&gt;
|title=Trial by media over Speakers’ Corner fracas&lt;br /&gt;
|author=Sam Hope&lt;br /&gt;
|date=September 29, 2017&lt;br /&gt;
|website=The Queerness&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=jamjar&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://twitter.com/magdalenberns/status/988003582250291201&lt;br /&gt;
|title=Masked transactivists surround woman on stairwell&lt;br /&gt;
|author=Magdalen Berns&lt;br /&gt;
|date=April 22, 2018&lt;br /&gt;
|website=Twitter&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=dhejne&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://fairplayforwomen.com/criminality/&lt;br /&gt;
|title=Study suggests that transwomen exhibit a male pattern of criminality&lt;br /&gt;
|date=September 8, 2018&lt;br /&gt;
|website=Fair Play For Women&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=wpcrime&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://en.wikipedia.org/wiki/Sex_differences_in_crime#Statistics&lt;br /&gt;
|title=Sex differences in crime&lt;br /&gt;
|website=Wikipedia&lt;br /&gt;
|access-date=May 31, 2019&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=freedman&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.bbc.com/news/uk-england-berkshire-46454454&lt;br /&gt;
|title=Rosa Freedman: Professor&#039;s door &#039;covered in urine&#039; after gender law debate&lt;br /&gt;
|date=December 5, 2018&lt;br /&gt;
|website=BBC News&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=vrr-fb&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.facebook.com/VancouverRapeRelief/posts/710603379412445&lt;br /&gt;
|title=Vancouver Rape Relief &amp;amp; Women&#039;s Shelter - Facebook&lt;br /&gt;
|date=August 16, 2019&lt;br /&gt;
|website=Facebook&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=vrr-twitter&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://twitter.com/VanRapeRelief/status/1166426534321647616&lt;br /&gt;
|title=VancouverRapeRelief on Twitter&lt;br /&gt;
|date=August 26, 2019&lt;br /&gt;
|website=Twitter&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=vrr-vancouverisawesome&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.vancouverisawesome.com/2019/08/28/vancouver-rape-relief-centre-targeted-vandalism-threats-transgender-controversy/&lt;br /&gt;
|title=Vancouver Rape Relief centre targeted with vandalism, threats over transgender controversy&lt;br /&gt;
|author=Jessica Kerr&lt;br /&gt;
|date=August 28, 2019&lt;br /&gt;
|website=Vancouver is Awesome&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=vrr-nationalreview&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.nationalreview.com/2019/08/women-only-rape-relief-shelter-defunded-then-vandalized/&lt;br /&gt;
|title=Women-Only Rape-Relief Shelter Defunded, Then Vandalized&lt;br /&gt;
|author=Madeleine Kearns&lt;br /&gt;
|date=August 28, 2019&lt;br /&gt;
|website=National Review&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=vrr-citynews&amp;gt;&lt;br /&gt;
{{cite web&lt;br /&gt;
|url=https://www.citynews1130.com/2019/08/27/vancouver-rape-relief-centre-vandalized-likely-over-restrictions-for-transgender-people/&lt;br /&gt;
|title=Vancouver Rape Relief centre vandalized, likely over restrictions for transgender people&lt;br /&gt;
|author=Jonathan Szekeres and Lauren Boothby&lt;br /&gt;
|date=Aug 27, 2019&lt;br /&gt;
|website=City News&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Language links: --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[pt:TERF]]&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1192</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1192"/>
		<updated>2021-08-26T19:05:43Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Initial setup of the new server */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Configure reverse DNS ===&lt;br /&gt;
&lt;br /&gt;
In the settings of the VPS host (e.g. Strato AG), you can configure reverse-DNS for the IP address of the server.  Set the FQDN for the IP address to {{C|feministwiki.org}}.  It&#039;s good to do this early since it can take some time to propagate.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the {{C|A}} entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup \&lt;br /&gt;
                 certbot \&lt;br /&gt;
                 dnsutils \&lt;br /&gt;
                 emacs \&lt;br /&gt;
                 git \&lt;br /&gt;
                 mg \&lt;br /&gt;
                 moreutils \&lt;br /&gt;
                 net-tools \&lt;br /&gt;
                 nmap \&lt;br /&gt;
                 rsync \&lt;br /&gt;
                 software-properties-common \&lt;br /&gt;
                 tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the {{C|.ssh/id_rsa}} from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in {{C|/root/pwd/meta}} on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 apt-get install apache2 \&lt;br /&gt;
                 dovecot-core \&lt;br /&gt;
                 dovecot-imapd \&lt;br /&gt;
                 dovecot-ldap \&lt;br /&gt;
                 dovecot-pop3d \&lt;br /&gt;
                 ejabberd \&lt;br /&gt;
                 fail2ban \&lt;br /&gt;
                 inspircd \&lt;br /&gt;
                 mailman \&lt;br /&gt;
                 mariadb-server \&lt;br /&gt;
                 opendkim \&lt;br /&gt;
                 postfix \&lt;br /&gt;
                 postfix-ldap \&lt;br /&gt;
                 slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in {{C|/root/pwd}}.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Install PHP and modules ===&lt;br /&gt;
&lt;br /&gt;
This should really be part of the last section, but due to the sheer number of PHP modules we want to install, it&#039;s in its own section:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install php${php_version} \&lt;br /&gt;
                 php${php_version}-apcu \&lt;br /&gt;
                 php${php_version}-bcmath \&lt;br /&gt;
                 php${php_version}-cli \&lt;br /&gt;
                 php${php_version}-ctype \&lt;br /&gt;
                 php${php_version}-curl \&lt;br /&gt;
                 php${php_version}-gd \&lt;br /&gt;
                 php${php_version}-gmp \&lt;br /&gt;
                 php${php_version}-iconv \&lt;br /&gt;
                 php${php_version}-imagick \&lt;br /&gt;
                 php${php_version}-intl \&lt;br /&gt;
                 php${php_version}-json \&lt;br /&gt;
                 php${php_version}-ldap \&lt;br /&gt;
                 php${php_version}-mbstring \&lt;br /&gt;
                 php${php_version}-mysql \&lt;br /&gt;
                 php${php_version}-opcache \&lt;br /&gt;
                 php${php_version}-readline \&lt;br /&gt;
                 php${php_version}-xml \&lt;br /&gt;
                 php${php_version}-zip&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules, config, and sites ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
 &lt;br /&gt;
 a2enconf 99-feministwiki&lt;br /&gt;
 &lt;br /&gt;
 a2ensite 000-wiki&lt;br /&gt;
 a2ensite account&lt;br /&gt;
 a2ensite blogs&lt;br /&gt;
 a2ensite chat&lt;br /&gt;
 a2ensite files&lt;br /&gt;
 a2ensite forum&lt;br /&gt;
 a2ensite mail&lt;br /&gt;
 a2ensite xmpp&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our {{C|letsencrypt-refresh}} script makes sure that the cert files are found in {{C|/etc/fw-certs}} and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes.  Note that although some of the steps described in this section take a long time to finish, they can be done in parallel.&lt;br /&gt;
&lt;br /&gt;
=== LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
==== Breaking changes in OpenLDAP ====&lt;br /&gt;
&lt;br /&gt;
There might be incompatible changes between OpenLDAP (aka {{C|slapd}}) versions which require manual editing of the {{C|slapcat}} output before it&#039;s read in on the new server with {{C|slapadd}}.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open {{C|/etc/ldap/schema/ppolicy.ldif}} and search for {{C|pwdMaxRecordedFailure}}.  You will note that there is a {{C|olcAttributeTypes: ...}} entry that defines it, and also it&#039;s listed in the {{C|MAY}} attributes block of the {{C|olcObjectClasses: ...}} entry that defines the {{C|pwdPolicy}} object class.&lt;br /&gt;
# On the old server, save the output of {{C|slapcat -n 0}} to a file, open the file, and search for the block where the {{C|ppolicy}} schema is defined.  It should start with the line {{C|dn: cn={4}ppolicy,cn=schema,cn=config}} (the {{C|{4}}} part might contain a different integer, that&#039;s OK).  There, note that the {{C|olcAttributeTypes: ...}} entry for {{C|pwdMaxRecordedFailure}} is missing, and also it&#039;s not listed in the {{C|MAY}} list of the {{C|pwdPolicy}} object class definition.  Copy over the attribute type definition from the {{C|ppolicy.ldif}} file on the new server, and amend the {{C|MAY}} list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Contents of /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -az --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/var/www/}} is important; if not provided, it will copy the directory to {{C|/var/www/www}} on the new server.&lt;br /&gt;
&lt;br /&gt;
=== SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | gzip | ssh root@feministwiki.dev &#039;gunzip | /root/bin/sql&#039;&lt;br /&gt;
&lt;br /&gt;
You can use the {{C|show databases;}} command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the {{C|--all-databases}} option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
=== Emails ===&lt;br /&gt;
&lt;br /&gt;
This is a simple one.  Run this command from the old server:&lt;br /&gt;
&lt;br /&gt;
 rsync -az --delete /home/vmail/ root@feministwiki.dev:/home/vmail&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/home/vmail/}} is important.&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 rsync -az --delete archives data lists root@feministwiki.dev:/var/lib/mailman&lt;br /&gt;
&lt;br /&gt;
And then this on the new server:&lt;br /&gt;
&lt;br /&gt;
 check_perms -f&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing file ownership and permissions.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch.  To do so, run this on the new server:&lt;br /&gt;
&lt;br /&gt;
 /root/bin/sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_de.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_es.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_it.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_pt.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
=== Deactivate again ===&lt;br /&gt;
&lt;br /&gt;
After we&#039;re done testing, we can &amp;quot;deactivate&amp;quot; the new server again to prepare it for the final switch-over:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
 &lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Simply repeat the whole section &#039;&#039;Copying over live data&#039;&#039;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;Copying over live data&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  For instance, the {{C|--delete}} argument to the {{C|rsync}} command and the {{C|--add-drop-database}} argument to the {{C|mysqldump}} command help to make sure of this.&lt;br /&gt;
&lt;br /&gt;
So just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Reboot the new server ===&lt;br /&gt;
&lt;br /&gt;
At this point we can reboot the new server again, to make sure all services are properly restarted.&lt;br /&gt;
&lt;br /&gt;
=== Open ports on the new server ===&lt;br /&gt;
&lt;br /&gt;
Now we can open the ports again on the new server:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main {{C|A}} entry for {{C|@}} (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The {{C|A}} entry for {{C|smtp}} since this is not allowed to be a CNAME&lt;br /&gt;
* The {{C|A}} entry for {{C|xmpp}} since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main {{C|A}} entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the {{C|letsencrypt-refresh}} script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1191</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1191"/>
		<updated>2021-08-26T19:05:02Z</updated>

		<summary type="html">&lt;p&gt;Technician : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the {{C|A}} entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup \&lt;br /&gt;
                 certbot \&lt;br /&gt;
                 dnsutils \&lt;br /&gt;
                 emacs \&lt;br /&gt;
                 git \&lt;br /&gt;
                 mg \&lt;br /&gt;
                 moreutils \&lt;br /&gt;
                 net-tools \&lt;br /&gt;
                 nmap \&lt;br /&gt;
                 rsync \&lt;br /&gt;
                 software-properties-common \&lt;br /&gt;
                 tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the {{C|.ssh/id_rsa}} from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in {{C|/root/pwd/meta}} on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 apt-get install apache2 \&lt;br /&gt;
                 dovecot-core \&lt;br /&gt;
                 dovecot-imapd \&lt;br /&gt;
                 dovecot-ldap \&lt;br /&gt;
                 dovecot-pop3d \&lt;br /&gt;
                 ejabberd \&lt;br /&gt;
                 fail2ban \&lt;br /&gt;
                 inspircd \&lt;br /&gt;
                 mailman \&lt;br /&gt;
                 mariadb-server \&lt;br /&gt;
                 opendkim \&lt;br /&gt;
                 postfix \&lt;br /&gt;
                 postfix-ldap \&lt;br /&gt;
                 slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in {{C|/root/pwd}}.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Install PHP and modules ===&lt;br /&gt;
&lt;br /&gt;
This should really be part of the last section, but due to the sheer number of PHP modules we want to install, it&#039;s in its own section:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install php${php_version} \&lt;br /&gt;
                 php${php_version}-apcu \&lt;br /&gt;
                 php${php_version}-bcmath \&lt;br /&gt;
                 php${php_version}-cli \&lt;br /&gt;
                 php${php_version}-ctype \&lt;br /&gt;
                 php${php_version}-curl \&lt;br /&gt;
                 php${php_version}-gd \&lt;br /&gt;
                 php${php_version}-gmp \&lt;br /&gt;
                 php${php_version}-iconv \&lt;br /&gt;
                 php${php_version}-imagick \&lt;br /&gt;
                 php${php_version}-intl \&lt;br /&gt;
                 php${php_version}-json \&lt;br /&gt;
                 php${php_version}-ldap \&lt;br /&gt;
                 php${php_version}-mbstring \&lt;br /&gt;
                 php${php_version}-mysql \&lt;br /&gt;
                 php${php_version}-opcache \&lt;br /&gt;
                 php${php_version}-readline \&lt;br /&gt;
                 php${php_version}-xml \&lt;br /&gt;
                 php${php_version}-zip&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules, config, and sites ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
 &lt;br /&gt;
 a2enconf 99-feministwiki&lt;br /&gt;
 &lt;br /&gt;
 a2ensite 000-wiki&lt;br /&gt;
 a2ensite account&lt;br /&gt;
 a2ensite blogs&lt;br /&gt;
 a2ensite chat&lt;br /&gt;
 a2ensite files&lt;br /&gt;
 a2ensite forum&lt;br /&gt;
 a2ensite mail&lt;br /&gt;
 a2ensite xmpp&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our {{C|letsencrypt-refresh}} script makes sure that the cert files are found in {{C|/etc/fw-certs}} and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
=== Configure reverse DNS ===&lt;br /&gt;
&lt;br /&gt;
In the settings of the VPS host (e.g. Strato AG), you can configure reverse-DNS for the IP address of the server.  Set the FQDN for the IP address to {{C|feministwiki.org}}.&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes.  Note that although some of the steps described in this section take a long time to finish, they can be done in parallel.&lt;br /&gt;
&lt;br /&gt;
=== LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
==== Breaking changes in OpenLDAP ====&lt;br /&gt;
&lt;br /&gt;
There might be incompatible changes between OpenLDAP (aka {{C|slapd}}) versions which require manual editing of the {{C|slapcat}} output before it&#039;s read in on the new server with {{C|slapadd}}.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open {{C|/etc/ldap/schema/ppolicy.ldif}} and search for {{C|pwdMaxRecordedFailure}}.  You will note that there is a {{C|olcAttributeTypes: ...}} entry that defines it, and also it&#039;s listed in the {{C|MAY}} attributes block of the {{C|olcObjectClasses: ...}} entry that defines the {{C|pwdPolicy}} object class.&lt;br /&gt;
# On the old server, save the output of {{C|slapcat -n 0}} to a file, open the file, and search for the block where the {{C|ppolicy}} schema is defined.  It should start with the line {{C|dn: cn={4}ppolicy,cn=schema,cn=config}} (the {{C|{4}}} part might contain a different integer, that&#039;s OK).  There, note that the {{C|olcAttributeTypes: ...}} entry for {{C|pwdMaxRecordedFailure}} is missing, and also it&#039;s not listed in the {{C|MAY}} list of the {{C|pwdPolicy}} object class definition.  Copy over the attribute type definition from the {{C|ppolicy.ldif}} file on the new server, and amend the {{C|MAY}} list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Contents of /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -az --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/var/www/}} is important; if not provided, it will copy the directory to {{C|/var/www/www}} on the new server.&lt;br /&gt;
&lt;br /&gt;
=== SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | gzip | ssh root@feministwiki.dev &#039;gunzip | /root/bin/sql&#039;&lt;br /&gt;
&lt;br /&gt;
You can use the {{C|show databases;}} command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the {{C|--all-databases}} option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
=== Emails ===&lt;br /&gt;
&lt;br /&gt;
This is a simple one.  Run this command from the old server:&lt;br /&gt;
&lt;br /&gt;
 rsync -az --delete /home/vmail/ root@feministwiki.dev:/home/vmail&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/home/vmail/}} is important.&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 rsync -az --delete archives data lists root@feministwiki.dev:/var/lib/mailman&lt;br /&gt;
&lt;br /&gt;
And then this on the new server:&lt;br /&gt;
&lt;br /&gt;
 check_perms -f&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing file ownership and permissions.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch.  To do so, run this on the new server:&lt;br /&gt;
&lt;br /&gt;
 /root/bin/sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_de.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_es.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_it.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_pt.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
=== Deactivate again ===&lt;br /&gt;
&lt;br /&gt;
After we&#039;re done testing, we can &amp;quot;deactivate&amp;quot; the new server again to prepare it for the final switch-over:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
 &lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Simply repeat the whole section &#039;&#039;Copying over live data&#039;&#039;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;Copying over live data&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  For instance, the {{C|--delete}} argument to the {{C|rsync}} command and the {{C|--add-drop-database}} argument to the {{C|mysqldump}} command help to make sure of this.&lt;br /&gt;
&lt;br /&gt;
So just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Reboot the new server ===&lt;br /&gt;
&lt;br /&gt;
At this point we can reboot the new server again, to make sure all services are properly restarted.&lt;br /&gt;
&lt;br /&gt;
=== Open ports on the new server ===&lt;br /&gt;
&lt;br /&gt;
Now we can open the ports again on the new server:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main {{C|A}} entry for {{C|@}} (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The {{C|A}} entry for {{C|smtp}} since this is not allowed to be a CNAME&lt;br /&gt;
* The {{C|A}} entry for {{C|xmpp}} since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main {{C|A}} entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the {{C|letsencrypt-refresh}} script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1190</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1190"/>
		<updated>2021-08-26T19:02:56Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Finishing up */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the {{C|A}} entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup \&lt;br /&gt;
                 certbot \&lt;br /&gt;
                 dnsutils \&lt;br /&gt;
                 emacs \&lt;br /&gt;
                 git \&lt;br /&gt;
                 mg \&lt;br /&gt;
                 moreutils \&lt;br /&gt;
                 net-tools \&lt;br /&gt;
                 nmap \&lt;br /&gt;
                 rsync \&lt;br /&gt;
                 software-properties-common \&lt;br /&gt;
                 tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the {{C|.ssh/id_rsa}} from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in {{C|/root/pwd/meta}} on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 apt-get install apache2 \&lt;br /&gt;
                 dovecot-core \&lt;br /&gt;
                 dovecot-imapd \&lt;br /&gt;
                 dovecot-ldap \&lt;br /&gt;
                 dovecot-pop3d \&lt;br /&gt;
                 ejabberd \&lt;br /&gt;
                 fail2ban \&lt;br /&gt;
                 inspircd \&lt;br /&gt;
                 mailman \&lt;br /&gt;
                 mariadb-server \&lt;br /&gt;
                 opendkim \&lt;br /&gt;
                 postfix \&lt;br /&gt;
                 postfix-ldap \&lt;br /&gt;
                 slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in {{C|/root/pwd}}.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Install PHP and modules ===&lt;br /&gt;
&lt;br /&gt;
This should really be part of the last section, but due to the sheer number of PHP modules we want to install, it&#039;s in its own section:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install php${php_version} \&lt;br /&gt;
                 php${php_version}-apcu \&lt;br /&gt;
                 php${php_version}-bcmath \&lt;br /&gt;
                 php${php_version}-cli \&lt;br /&gt;
                 php${php_version}-ctype \&lt;br /&gt;
                 php${php_version}-curl \&lt;br /&gt;
                 php${php_version}-gd \&lt;br /&gt;
                 php${php_version}-gmp \&lt;br /&gt;
                 php${php_version}-iconv \&lt;br /&gt;
                 php${php_version}-imagick \&lt;br /&gt;
                 php${php_version}-intl \&lt;br /&gt;
                 php${php_version}-json \&lt;br /&gt;
                 php${php_version}-ldap \&lt;br /&gt;
                 php${php_version}-mbstring \&lt;br /&gt;
                 php${php_version}-mysql \&lt;br /&gt;
                 php${php_version}-opcache \&lt;br /&gt;
                 php${php_version}-readline \&lt;br /&gt;
                 php${php_version}-xml \&lt;br /&gt;
                 php${php_version}-zip&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules, config, and sites ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
 &lt;br /&gt;
 a2enconf 99-feministwiki&lt;br /&gt;
 &lt;br /&gt;
 a2ensite 000-wiki&lt;br /&gt;
 a2ensite account&lt;br /&gt;
 a2ensite blogs&lt;br /&gt;
 a2ensite chat&lt;br /&gt;
 a2ensite files&lt;br /&gt;
 a2ensite forum&lt;br /&gt;
 a2ensite mail&lt;br /&gt;
 a2ensite xmpp&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our {{C|letsencrypt-refresh}} script makes sure that the cert files are found in {{C|/etc/fw-certs}} and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes.  Note that although some of the steps described in this section take a long time to finish, they can be done in parallel.&lt;br /&gt;
&lt;br /&gt;
=== LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
==== Breaking changes in OpenLDAP ====&lt;br /&gt;
&lt;br /&gt;
There might be incompatible changes between OpenLDAP (aka {{C|slapd}}) versions which require manual editing of the {{C|slapcat}} output before it&#039;s read in on the new server with {{C|slapadd}}.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open {{C|/etc/ldap/schema/ppolicy.ldif}} and search for {{C|pwdMaxRecordedFailure}}.  You will note that there is a {{C|olcAttributeTypes: ...}} entry that defines it, and also it&#039;s listed in the {{C|MAY}} attributes block of the {{C|olcObjectClasses: ...}} entry that defines the {{C|pwdPolicy}} object class.&lt;br /&gt;
# On the old server, save the output of {{C|slapcat -n 0}} to a file, open the file, and search for the block where the {{C|ppolicy}} schema is defined.  It should start with the line {{C|dn: cn={4}ppolicy,cn=schema,cn=config}} (the {{C|{4}}} part might contain a different integer, that&#039;s OK).  There, note that the {{C|olcAttributeTypes: ...}} entry for {{C|pwdMaxRecordedFailure}} is missing, and also it&#039;s not listed in the {{C|MAY}} list of the {{C|pwdPolicy}} object class definition.  Copy over the attribute type definition from the {{C|ppolicy.ldif}} file on the new server, and amend the {{C|MAY}} list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Contents of /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -az --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/var/www/}} is important; if not provided, it will copy the directory to {{C|/var/www/www}} on the new server.&lt;br /&gt;
&lt;br /&gt;
=== SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | gzip | ssh root@feministwiki.dev &#039;gunzip | /root/bin/sql&#039;&lt;br /&gt;
&lt;br /&gt;
You can use the {{C|show databases;}} command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the {{C|--all-databases}} option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
=== Emails ===&lt;br /&gt;
&lt;br /&gt;
This is a simple one.  Run this command from the old server:&lt;br /&gt;
&lt;br /&gt;
 rsync -az --delete /home/vmail/ root@feministwiki.dev:/home/vmail&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/home/vmail/}} is important.&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 rsync -az --delete archives data lists root@feministwiki.dev:/var/lib/mailman&lt;br /&gt;
&lt;br /&gt;
And then this on the new server:&lt;br /&gt;
&lt;br /&gt;
 check_perms -f&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing file ownership and permissions.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch.  To do so, run this on the new server:&lt;br /&gt;
&lt;br /&gt;
 /root/bin/sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_de.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_es.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_it.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_pt.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
=== Deactivate again ===&lt;br /&gt;
&lt;br /&gt;
After we&#039;re done testing, we can &amp;quot;deactivate&amp;quot; the new server again to prepare it for the final switch-over:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
 &lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Simply repeat the whole section &#039;&#039;Copying over live data&#039;&#039;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;Copying over live data&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  For instance, the {{C|--delete}} argument to the {{C|rsync}} command and the {{C|--add-drop-database}} argument to the {{C|mysqldump}} command help to make sure of this.&lt;br /&gt;
&lt;br /&gt;
So just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Reboot the new server ===&lt;br /&gt;
&lt;br /&gt;
At this point we can reboot the new server again, to make sure all services are properly restarted.&lt;br /&gt;
&lt;br /&gt;
=== Open ports on the new server ===&lt;br /&gt;
&lt;br /&gt;
Now we can open the ports again on the new server:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main {{C|A}} entry for {{C|@}} (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The {{C|A}} entry for {{C|smtp}} since this is not allowed to be a CNAME&lt;br /&gt;
* The {{C|A}} entry for {{C|xmpp}} since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main {{C|A}} entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the {{C|letsencrypt-refresh}} script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1189</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1189"/>
		<updated>2021-08-26T18:59:11Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Deactivate again */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the {{C|A}} entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup \&lt;br /&gt;
                 certbot \&lt;br /&gt;
                 dnsutils \&lt;br /&gt;
                 emacs \&lt;br /&gt;
                 git \&lt;br /&gt;
                 mg \&lt;br /&gt;
                 moreutils \&lt;br /&gt;
                 net-tools \&lt;br /&gt;
                 nmap \&lt;br /&gt;
                 rsync \&lt;br /&gt;
                 software-properties-common \&lt;br /&gt;
                 tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the {{C|.ssh/id_rsa}} from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in {{C|/root/pwd/meta}} on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 apt-get install apache2 \&lt;br /&gt;
                 dovecot-core \&lt;br /&gt;
                 dovecot-imapd \&lt;br /&gt;
                 dovecot-ldap \&lt;br /&gt;
                 dovecot-pop3d \&lt;br /&gt;
                 ejabberd \&lt;br /&gt;
                 fail2ban \&lt;br /&gt;
                 inspircd \&lt;br /&gt;
                 mailman \&lt;br /&gt;
                 mariadb-server \&lt;br /&gt;
                 opendkim \&lt;br /&gt;
                 postfix \&lt;br /&gt;
                 postfix-ldap \&lt;br /&gt;
                 slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in {{C|/root/pwd}}.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Install PHP and modules ===&lt;br /&gt;
&lt;br /&gt;
This should really be part of the last section, but due to the sheer number of PHP modules we want to install, it&#039;s in its own section:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install php${php_version} \&lt;br /&gt;
                 php${php_version}-apcu \&lt;br /&gt;
                 php${php_version}-bcmath \&lt;br /&gt;
                 php${php_version}-cli \&lt;br /&gt;
                 php${php_version}-ctype \&lt;br /&gt;
                 php${php_version}-curl \&lt;br /&gt;
                 php${php_version}-gd \&lt;br /&gt;
                 php${php_version}-gmp \&lt;br /&gt;
                 php${php_version}-iconv \&lt;br /&gt;
                 php${php_version}-imagick \&lt;br /&gt;
                 php${php_version}-intl \&lt;br /&gt;
                 php${php_version}-json \&lt;br /&gt;
                 php${php_version}-ldap \&lt;br /&gt;
                 php${php_version}-mbstring \&lt;br /&gt;
                 php${php_version}-mysql \&lt;br /&gt;
                 php${php_version}-opcache \&lt;br /&gt;
                 php${php_version}-readline \&lt;br /&gt;
                 php${php_version}-xml \&lt;br /&gt;
                 php${php_version}-zip&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules, config, and sites ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
 &lt;br /&gt;
 a2enconf 99-feministwiki&lt;br /&gt;
 &lt;br /&gt;
 a2ensite 000-wiki&lt;br /&gt;
 a2ensite account&lt;br /&gt;
 a2ensite blogs&lt;br /&gt;
 a2ensite chat&lt;br /&gt;
 a2ensite files&lt;br /&gt;
 a2ensite forum&lt;br /&gt;
 a2ensite mail&lt;br /&gt;
 a2ensite xmpp&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our {{C|letsencrypt-refresh}} script makes sure that the cert files are found in {{C|/etc/fw-certs}} and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes.  Note that although some of the steps described in this section take a long time to finish, they can be done in parallel.&lt;br /&gt;
&lt;br /&gt;
=== LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
==== Breaking changes in OpenLDAP ====&lt;br /&gt;
&lt;br /&gt;
There might be incompatible changes between OpenLDAP (aka {{C|slapd}}) versions which require manual editing of the {{C|slapcat}} output before it&#039;s read in on the new server with {{C|slapadd}}.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open {{C|/etc/ldap/schema/ppolicy.ldif}} and search for {{C|pwdMaxRecordedFailure}}.  You will note that there is a {{C|olcAttributeTypes: ...}} entry that defines it, and also it&#039;s listed in the {{C|MAY}} attributes block of the {{C|olcObjectClasses: ...}} entry that defines the {{C|pwdPolicy}} object class.&lt;br /&gt;
# On the old server, save the output of {{C|slapcat -n 0}} to a file, open the file, and search for the block where the {{C|ppolicy}} schema is defined.  It should start with the line {{C|dn: cn={4}ppolicy,cn=schema,cn=config}} (the {{C|{4}}} part might contain a different integer, that&#039;s OK).  There, note that the {{C|olcAttributeTypes: ...}} entry for {{C|pwdMaxRecordedFailure}} is missing, and also it&#039;s not listed in the {{C|MAY}} list of the {{C|pwdPolicy}} object class definition.  Copy over the attribute type definition from the {{C|ppolicy.ldif}} file on the new server, and amend the {{C|MAY}} list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Contents of /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -az --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/var/www/}} is important; if not provided, it will copy the directory to {{C|/var/www/www}} on the new server.&lt;br /&gt;
&lt;br /&gt;
=== SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | gzip | ssh root@feministwiki.dev &#039;gunzip | /root/bin/sql&#039;&lt;br /&gt;
&lt;br /&gt;
You can use the {{C|show databases;}} command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the {{C|--all-databases}} option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
=== Emails ===&lt;br /&gt;
&lt;br /&gt;
This is a simple one.  Run this command from the old server:&lt;br /&gt;
&lt;br /&gt;
 rsync -az --delete /home/vmail/ root@feministwiki.dev:/home/vmail&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/home/vmail/}} is important.&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 rsync -az --delete archives data lists root@feministwiki.dev:/var/lib/mailman&lt;br /&gt;
&lt;br /&gt;
And then this on the new server:&lt;br /&gt;
&lt;br /&gt;
 check_perms -f&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing file ownership and permissions.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch.  To do so, run this on the new server:&lt;br /&gt;
&lt;br /&gt;
 /root/bin/sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_de.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_es.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_it.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_pt.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
=== Deactivate again ===&lt;br /&gt;
&lt;br /&gt;
After we&#039;re done testing, we can &amp;quot;deactivate&amp;quot; the new server again to prepare it for the final switch-over:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
 &lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;&#039;Copying over live data&#039;&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  (For instance, the {{C|--delete}} argument to the {{C|rsync}} command and the {{C|--add-drop-database}} argument to the {{C|mysqldump}} command help to make sure of this.)&lt;br /&gt;
&lt;br /&gt;
So in short, just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main {{C|A}} entry for {{C|@}} (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The {{C|A}} entry for {{C|smtp}} since this is not allowed to be a CNAME&lt;br /&gt;
* The {{C|A}} entry for {{C|xmpp}} since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main {{C|A}} entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the {{C|letsencrypt-refresh}} script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1188</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1188"/>
		<updated>2021-08-26T18:58:33Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Test */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the {{C|A}} entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup \&lt;br /&gt;
                 certbot \&lt;br /&gt;
                 dnsutils \&lt;br /&gt;
                 emacs \&lt;br /&gt;
                 git \&lt;br /&gt;
                 mg \&lt;br /&gt;
                 moreutils \&lt;br /&gt;
                 net-tools \&lt;br /&gt;
                 nmap \&lt;br /&gt;
                 rsync \&lt;br /&gt;
                 software-properties-common \&lt;br /&gt;
                 tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the {{C|.ssh/id_rsa}} from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in {{C|/root/pwd/meta}} on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 apt-get install apache2 \&lt;br /&gt;
                 dovecot-core \&lt;br /&gt;
                 dovecot-imapd \&lt;br /&gt;
                 dovecot-ldap \&lt;br /&gt;
                 dovecot-pop3d \&lt;br /&gt;
                 ejabberd \&lt;br /&gt;
                 fail2ban \&lt;br /&gt;
                 inspircd \&lt;br /&gt;
                 mailman \&lt;br /&gt;
                 mariadb-server \&lt;br /&gt;
                 opendkim \&lt;br /&gt;
                 postfix \&lt;br /&gt;
                 postfix-ldap \&lt;br /&gt;
                 slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in {{C|/root/pwd}}.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Install PHP and modules ===&lt;br /&gt;
&lt;br /&gt;
This should really be part of the last section, but due to the sheer number of PHP modules we want to install, it&#039;s in its own section:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install php${php_version} \&lt;br /&gt;
                 php${php_version}-apcu \&lt;br /&gt;
                 php${php_version}-bcmath \&lt;br /&gt;
                 php${php_version}-cli \&lt;br /&gt;
                 php${php_version}-ctype \&lt;br /&gt;
                 php${php_version}-curl \&lt;br /&gt;
                 php${php_version}-gd \&lt;br /&gt;
                 php${php_version}-gmp \&lt;br /&gt;
                 php${php_version}-iconv \&lt;br /&gt;
                 php${php_version}-imagick \&lt;br /&gt;
                 php${php_version}-intl \&lt;br /&gt;
                 php${php_version}-json \&lt;br /&gt;
                 php${php_version}-ldap \&lt;br /&gt;
                 php${php_version}-mbstring \&lt;br /&gt;
                 php${php_version}-mysql \&lt;br /&gt;
                 php${php_version}-opcache \&lt;br /&gt;
                 php${php_version}-readline \&lt;br /&gt;
                 php${php_version}-xml \&lt;br /&gt;
                 php${php_version}-zip&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules, config, and sites ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
 &lt;br /&gt;
 a2enconf 99-feministwiki&lt;br /&gt;
 &lt;br /&gt;
 a2ensite 000-wiki&lt;br /&gt;
 a2ensite account&lt;br /&gt;
 a2ensite blogs&lt;br /&gt;
 a2ensite chat&lt;br /&gt;
 a2ensite files&lt;br /&gt;
 a2ensite forum&lt;br /&gt;
 a2ensite mail&lt;br /&gt;
 a2ensite xmpp&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our {{C|letsencrypt-refresh}} script makes sure that the cert files are found in {{C|/etc/fw-certs}} and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes.  Note that although some of the steps described in this section take a long time to finish, they can be done in parallel.&lt;br /&gt;
&lt;br /&gt;
=== LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
==== Breaking changes in OpenLDAP ====&lt;br /&gt;
&lt;br /&gt;
There might be incompatible changes between OpenLDAP (aka {{C|slapd}}) versions which require manual editing of the {{C|slapcat}} output before it&#039;s read in on the new server with {{C|slapadd}}.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open {{C|/etc/ldap/schema/ppolicy.ldif}} and search for {{C|pwdMaxRecordedFailure}}.  You will note that there is a {{C|olcAttributeTypes: ...}} entry that defines it, and also it&#039;s listed in the {{C|MAY}} attributes block of the {{C|olcObjectClasses: ...}} entry that defines the {{C|pwdPolicy}} object class.&lt;br /&gt;
# On the old server, save the output of {{C|slapcat -n 0}} to a file, open the file, and search for the block where the {{C|ppolicy}} schema is defined.  It should start with the line {{C|dn: cn={4}ppolicy,cn=schema,cn=config}} (the {{C|{4}}} part might contain a different integer, that&#039;s OK).  There, note that the {{C|olcAttributeTypes: ...}} entry for {{C|pwdMaxRecordedFailure}} is missing, and also it&#039;s not listed in the {{C|MAY}} list of the {{C|pwdPolicy}} object class definition.  Copy over the attribute type definition from the {{C|ppolicy.ldif}} file on the new server, and amend the {{C|MAY}} list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Contents of /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -az --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/var/www/}} is important; if not provided, it will copy the directory to {{C|/var/www/www}} on the new server.&lt;br /&gt;
&lt;br /&gt;
=== SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | gzip | ssh root@feministwiki.dev &#039;gunzip | /root/bin/sql&#039;&lt;br /&gt;
&lt;br /&gt;
You can use the {{C|show databases;}} command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the {{C|--all-databases}} option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
=== Emails ===&lt;br /&gt;
&lt;br /&gt;
This is a simple one.  Run this command from the old server:&lt;br /&gt;
&lt;br /&gt;
 rsync -az --delete /home/vmail/ root@feministwiki.dev:/home/vmail&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/home/vmail/}} is important.&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 rsync -az --delete archives data lists root@feministwiki.dev:/var/lib/mailman&lt;br /&gt;
&lt;br /&gt;
And then this on the new server:&lt;br /&gt;
&lt;br /&gt;
 check_perms -f&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing file ownership and permissions.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch.  To do so, run this on the new server:&lt;br /&gt;
&lt;br /&gt;
 /root/bin/sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_de.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_es.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_it.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_pt.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
=== Deactivate again ===&lt;br /&gt;
&lt;br /&gt;
After we&#039;re done testing, we can &amp;quot;deactivate&amp;quot; the server again to prepare it for the final switch-over:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;&#039;Copying over live data&#039;&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  (For instance, the {{C|--delete}} argument to the {{C|rsync}} command and the {{C|--add-drop-database}} argument to the {{C|mysqldump}} command help to make sure of this.)&lt;br /&gt;
&lt;br /&gt;
So in short, just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main {{C|A}} entry for {{C|@}} (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The {{C|A}} entry for {{C|smtp}} since this is not allowed to be a CNAME&lt;br /&gt;
* The {{C|A}} entry for {{C|xmpp}} since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main {{C|A}} entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the {{C|letsencrypt-refresh}} script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1187</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1187"/>
		<updated>2021-08-26T18:53:33Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Mailman data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the {{C|A}} entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup \&lt;br /&gt;
                 certbot \&lt;br /&gt;
                 dnsutils \&lt;br /&gt;
                 emacs \&lt;br /&gt;
                 git \&lt;br /&gt;
                 mg \&lt;br /&gt;
                 moreutils \&lt;br /&gt;
                 net-tools \&lt;br /&gt;
                 nmap \&lt;br /&gt;
                 rsync \&lt;br /&gt;
                 software-properties-common \&lt;br /&gt;
                 tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the {{C|.ssh/id_rsa}} from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in {{C|/root/pwd/meta}} on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 apt-get install apache2 \&lt;br /&gt;
                 dovecot-core \&lt;br /&gt;
                 dovecot-imapd \&lt;br /&gt;
                 dovecot-ldap \&lt;br /&gt;
                 dovecot-pop3d \&lt;br /&gt;
                 ejabberd \&lt;br /&gt;
                 fail2ban \&lt;br /&gt;
                 inspircd \&lt;br /&gt;
                 mailman \&lt;br /&gt;
                 mariadb-server \&lt;br /&gt;
                 opendkim \&lt;br /&gt;
                 postfix \&lt;br /&gt;
                 postfix-ldap \&lt;br /&gt;
                 slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in {{C|/root/pwd}}.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Install PHP and modules ===&lt;br /&gt;
&lt;br /&gt;
This should really be part of the last section, but due to the sheer number of PHP modules we want to install, it&#039;s in its own section:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install php${php_version} \&lt;br /&gt;
                 php${php_version}-apcu \&lt;br /&gt;
                 php${php_version}-bcmath \&lt;br /&gt;
                 php${php_version}-cli \&lt;br /&gt;
                 php${php_version}-ctype \&lt;br /&gt;
                 php${php_version}-curl \&lt;br /&gt;
                 php${php_version}-gd \&lt;br /&gt;
                 php${php_version}-gmp \&lt;br /&gt;
                 php${php_version}-iconv \&lt;br /&gt;
                 php${php_version}-imagick \&lt;br /&gt;
                 php${php_version}-intl \&lt;br /&gt;
                 php${php_version}-json \&lt;br /&gt;
                 php${php_version}-ldap \&lt;br /&gt;
                 php${php_version}-mbstring \&lt;br /&gt;
                 php${php_version}-mysql \&lt;br /&gt;
                 php${php_version}-opcache \&lt;br /&gt;
                 php${php_version}-readline \&lt;br /&gt;
                 php${php_version}-xml \&lt;br /&gt;
                 php${php_version}-zip&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules, config, and sites ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
 &lt;br /&gt;
 a2enconf 99-feministwiki&lt;br /&gt;
 &lt;br /&gt;
 a2ensite 000-wiki&lt;br /&gt;
 a2ensite account&lt;br /&gt;
 a2ensite blogs&lt;br /&gt;
 a2ensite chat&lt;br /&gt;
 a2ensite files&lt;br /&gt;
 a2ensite forum&lt;br /&gt;
 a2ensite mail&lt;br /&gt;
 a2ensite xmpp&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our {{C|letsencrypt-refresh}} script makes sure that the cert files are found in {{C|/etc/fw-certs}} and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes.  Note that although some of the steps described in this section take a long time to finish, they can be done in parallel.&lt;br /&gt;
&lt;br /&gt;
=== LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
==== Breaking changes in OpenLDAP ====&lt;br /&gt;
&lt;br /&gt;
There might be incompatible changes between OpenLDAP (aka {{C|slapd}}) versions which require manual editing of the {{C|slapcat}} output before it&#039;s read in on the new server with {{C|slapadd}}.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open {{C|/etc/ldap/schema/ppolicy.ldif}} and search for {{C|pwdMaxRecordedFailure}}.  You will note that there is a {{C|olcAttributeTypes: ...}} entry that defines it, and also it&#039;s listed in the {{C|MAY}} attributes block of the {{C|olcObjectClasses: ...}} entry that defines the {{C|pwdPolicy}} object class.&lt;br /&gt;
# On the old server, save the output of {{C|slapcat -n 0}} to a file, open the file, and search for the block where the {{C|ppolicy}} schema is defined.  It should start with the line {{C|dn: cn={4}ppolicy,cn=schema,cn=config}} (the {{C|{4}}} part might contain a different integer, that&#039;s OK).  There, note that the {{C|olcAttributeTypes: ...}} entry for {{C|pwdMaxRecordedFailure}} is missing, and also it&#039;s not listed in the {{C|MAY}} list of the {{C|pwdPolicy}} object class definition.  Copy over the attribute type definition from the {{C|ppolicy.ldif}} file on the new server, and amend the {{C|MAY}} list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Contents of /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -az --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/var/www/}} is important; if not provided, it will copy the directory to {{C|/var/www/www}} on the new server.&lt;br /&gt;
&lt;br /&gt;
=== SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | gzip | ssh root@feministwiki.dev &#039;gunzip | /root/bin/sql&#039;&lt;br /&gt;
&lt;br /&gt;
You can use the {{C|show databases;}} command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the {{C|--all-databases}} option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
=== Emails ===&lt;br /&gt;
&lt;br /&gt;
This is a simple one.  Run this command from the old server:&lt;br /&gt;
&lt;br /&gt;
 rsync -az --delete /home/vmail/ root@feministwiki.dev:/home/vmail&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/home/vmail/}} is important.&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 rsync -az --delete archives data lists root@feministwiki.dev:/var/lib/mailman&lt;br /&gt;
&lt;br /&gt;
And then this on the new server:&lt;br /&gt;
&lt;br /&gt;
 check_perms -f&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing file ownership and permissions.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch.  To do so, run this on the new server:&lt;br /&gt;
&lt;br /&gt;
 /root/bin/sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_de.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_es.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_it.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_pt.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;&#039;Copying over live data&#039;&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  (For instance, the {{C|--delete}} argument to the {{C|rsync}} command and the {{C|--add-drop-database}} argument to the {{C|mysqldump}} command help to make sure of this.)&lt;br /&gt;
&lt;br /&gt;
So in short, just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main {{C|A}} entry for {{C|@}} (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The {{C|A}} entry for {{C|smtp}} since this is not allowed to be a CNAME&lt;br /&gt;
* The {{C|A}} entry for {{C|xmpp}} since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main {{C|A}} entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the {{C|letsencrypt-refresh}} script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1186</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1186"/>
		<updated>2021-08-25T18:05:32Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Recreate SQL users */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the {{C|A}} entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup \&lt;br /&gt;
                 certbot \&lt;br /&gt;
                 dnsutils \&lt;br /&gt;
                 emacs \&lt;br /&gt;
                 git \&lt;br /&gt;
                 mg \&lt;br /&gt;
                 moreutils \&lt;br /&gt;
                 net-tools \&lt;br /&gt;
                 nmap \&lt;br /&gt;
                 rsync \&lt;br /&gt;
                 software-properties-common \&lt;br /&gt;
                 tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the {{C|.ssh/id_rsa}} from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in {{C|/root/pwd/meta}} on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 apt-get install apache2 \&lt;br /&gt;
                 dovecot-core \&lt;br /&gt;
                 dovecot-imapd \&lt;br /&gt;
                 dovecot-ldap \&lt;br /&gt;
                 dovecot-pop3d \&lt;br /&gt;
                 ejabberd \&lt;br /&gt;
                 fail2ban \&lt;br /&gt;
                 inspircd \&lt;br /&gt;
                 mailman \&lt;br /&gt;
                 mariadb-server \&lt;br /&gt;
                 opendkim \&lt;br /&gt;
                 postfix \&lt;br /&gt;
                 postfix-ldap \&lt;br /&gt;
                 slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in {{C|/root/pwd}}.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Install PHP and modules ===&lt;br /&gt;
&lt;br /&gt;
This should really be part of the last section, but due to the sheer number of PHP modules we want to install, it&#039;s in its own section:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install php${php_version} \&lt;br /&gt;
                 php${php_version}-apcu \&lt;br /&gt;
                 php${php_version}-bcmath \&lt;br /&gt;
                 php${php_version}-cli \&lt;br /&gt;
                 php${php_version}-ctype \&lt;br /&gt;
                 php${php_version}-curl \&lt;br /&gt;
                 php${php_version}-gd \&lt;br /&gt;
                 php${php_version}-gmp \&lt;br /&gt;
                 php${php_version}-iconv \&lt;br /&gt;
                 php${php_version}-imagick \&lt;br /&gt;
                 php${php_version}-intl \&lt;br /&gt;
                 php${php_version}-json \&lt;br /&gt;
                 php${php_version}-ldap \&lt;br /&gt;
                 php${php_version}-mbstring \&lt;br /&gt;
                 php${php_version}-mysql \&lt;br /&gt;
                 php${php_version}-opcache \&lt;br /&gt;
                 php${php_version}-readline \&lt;br /&gt;
                 php${php_version}-xml \&lt;br /&gt;
                 php${php_version}-zip&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules, config, and sites ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
 &lt;br /&gt;
 a2enconf 99-feministwiki&lt;br /&gt;
 &lt;br /&gt;
 a2ensite 000-wiki&lt;br /&gt;
 a2ensite account&lt;br /&gt;
 a2ensite blogs&lt;br /&gt;
 a2ensite chat&lt;br /&gt;
 a2ensite files&lt;br /&gt;
 a2ensite forum&lt;br /&gt;
 a2ensite mail&lt;br /&gt;
 a2ensite xmpp&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our {{C|letsencrypt-refresh}} script makes sure that the cert files are found in {{C|/etc/fw-certs}} and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes.  Note that although some of the steps described in this section take a long time to finish, they can be done in parallel.&lt;br /&gt;
&lt;br /&gt;
=== LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
==== Breaking changes in OpenLDAP ====&lt;br /&gt;
&lt;br /&gt;
There might be incompatible changes between OpenLDAP (aka {{C|slapd}}) versions which require manual editing of the {{C|slapcat}} output before it&#039;s read in on the new server with {{C|slapadd}}.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open {{C|/etc/ldap/schema/ppolicy.ldif}} and search for {{C|pwdMaxRecordedFailure}}.  You will note that there is a {{C|olcAttributeTypes: ...}} entry that defines it, and also it&#039;s listed in the {{C|MAY}} attributes block of the {{C|olcObjectClasses: ...}} entry that defines the {{C|pwdPolicy}} object class.&lt;br /&gt;
# On the old server, save the output of {{C|slapcat -n 0}} to a file, open the file, and search for the block where the {{C|ppolicy}} schema is defined.  It should start with the line {{C|dn: cn={4}ppolicy,cn=schema,cn=config}} (the {{C|{4}}} part might contain a different integer, that&#039;s OK).  There, note that the {{C|olcAttributeTypes: ...}} entry for {{C|pwdMaxRecordedFailure}} is missing, and also it&#039;s not listed in the {{C|MAY}} list of the {{C|pwdPolicy}} object class definition.  Copy over the attribute type definition from the {{C|ppolicy.ldif}} file on the new server, and amend the {{C|MAY}} list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Contents of /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -az --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/var/www/}} is important; if not provided, it will copy the directory to {{C|/var/www/www}} on the new server.&lt;br /&gt;
&lt;br /&gt;
=== SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | gzip | ssh root@feministwiki.dev &#039;gunzip | /root/bin/sql&#039;&lt;br /&gt;
&lt;br /&gt;
You can use the {{C|show databases;}} command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the {{C|--all-databases}} option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
=== Emails ===&lt;br /&gt;
&lt;br /&gt;
This is a simple one.  Run this command from the old server:&lt;br /&gt;
&lt;br /&gt;
 rsync -az --delete /home/vmail/ root@feministwiki.dev:/home/vmail&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/home/vmail/}} is important.&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 tar -czf - archives data lists | ssh root@feministwiki.dev &#039;cd /var/lib/mailman &amp;amp;&amp;amp; tar -xzf - &amp;amp;&amp;amp; check_perms -f&#039;&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing the group ownership of the extracted files.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch.  To do so, run this on the new server:&lt;br /&gt;
&lt;br /&gt;
 /root/bin/sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_de.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_es.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_it.* to feministwiki@localhost;&lt;br /&gt;
 grant all on feministwiki_pt.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;&#039;Copying over live data&#039;&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  (For instance, the {{C|--delete}} argument to the {{C|rsync}} command and the {{C|--add-drop-database}} argument to the {{C|mysqldump}} command help to make sure of this.)&lt;br /&gt;
&lt;br /&gt;
So in short, just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main {{C|A}} entry for {{C|@}} (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The {{C|A}} entry for {{C|smtp}} since this is not allowed to be a CNAME&lt;br /&gt;
* The {{C|A}} entry for {{C|xmpp}} since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main {{C|A}} entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the {{C|letsencrypt-refresh}} script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Welcome&amp;diff=1185</id>
		<title>FeministWiki:Welcome</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Welcome&amp;diff=1185"/>
		<updated>2021-08-23T16:28:23Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Can I trust you with my data? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the FeministWiki!  This page will guide you through everything you need to know as a member.&lt;br /&gt;
&lt;br /&gt;
== What is the FeministWiki? ==&lt;br /&gt;
&lt;br /&gt;
The FeministWiki is a website with different components, that aims to offer a rich digital platform for feminist information and activism.  The components of the FeministWiki are:&lt;br /&gt;
&lt;br /&gt;
* A wiki, where educational and informational articles on feminist topics can be curated by the community.  Like Wikipedia, but for feminism.  You&#039;re reading a page of the wiki right now.&lt;br /&gt;
* A [https://blogs.feministwiki.org/ blog platform] where members who wish to publish articles can become authors on the shared main blog, or get their own personalized blog which they have full control over, such as: [https://blogs.feministwiki.org/socjuswiz/ SocialJusticeWizardry]&lt;br /&gt;
* A [https://files.feministwiki.org file-storage platform] (similar to DropBox) where you can upload files you want to save, and optionally share them with others.  For instance, you could upload PDF documents, information charts, recordings of seminars, or even just feminist memes, so you can access them from any computer by logging in to your FeministFiles account.&lt;br /&gt;
* A [https://forum.feministwiki.org/ traditional web forum] where members can hold discussions about all sorts of topics.  If you&#039;re familiar with the British website Mumsnet, this one&#039;s a bit like that.&lt;br /&gt;
* A [https://chat.feministwiki.org chat messaging system] that can be used through the website or via smartphone apps.  Like WhatsApp, but accessible for FeministWiki members only, and it doesn&#039;t need your mobile number.&lt;br /&gt;
&lt;br /&gt;
Members of the FeministWiki can use all of these services by logging in with the same username and password in each of them.&lt;br /&gt;
&lt;br /&gt;
Further, every member is given an e-mail address like &#039;&#039;janedoe@feministwiki.org&#039;&#039; which they can use to send and receive e-mails.  This might be useful, for example, if you don&#039;t want to use your personal e-mail address for political purposes.&lt;br /&gt;
&lt;br /&gt;
=== What sort of feminism is it for? ===&lt;br /&gt;
&lt;br /&gt;
As explained on the [[Main Page]], the FeministWiki is aimed at classical/radical feminism.&lt;br /&gt;
&lt;br /&gt;
This includes, for instance, anti-prostitution and anti-pornography activism, female reproductive rights, opposition to gender stereotypes, support for female-only spaces, alliance with lesbian feminists and generally support for lesbian rights, and so on.&lt;br /&gt;
&lt;br /&gt;
Genuine intersectional approaches are definitely valued, such as alliance with black feminists, support of women in poverty, etc., whereas faux-intersectionality that denies sex-based oppression and centers male interests is frowned upon.&lt;br /&gt;
&lt;br /&gt;
=== How are new members added? ===&lt;br /&gt;
&lt;br /&gt;
All members of the FeministWiki have a right to [https://add-member.feministwiki.org add further members] as they like.&lt;br /&gt;
&lt;br /&gt;
Please be careful in who you add, as communities like this are juicy targets for troll infiltration.  The system internally keeps track of who was added by who, so in the absolute worst case the technician is able to find the source of a troll infiltration and issue a sweeping ban to bring back peace, but it would of course be ideal if something like this didn&#039;t happen in the first place.&lt;br /&gt;
&lt;br /&gt;
That said, please bring in as many of your trusted friends as you can!  The FeministWiki only has a purpose so long as there&#039;s a community making use of it.&lt;br /&gt;
&lt;br /&gt;
=== Can I trust you with my data? ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Please never use any FeministWiki service to store or transmit sensitive private information, period&#039;&#039;&#039;.  The [[FW:Technician|technician(s)]] who have administrative access to the server can see your chat messages, emails, files uploaded to file storage, and so on, unless you use encryption on your computer before uploading the data.  There is also always the possibility of security holes in the server leading to data leaks, even if the technicians are trustworthy and follow state-of-the-art security best practices.&lt;br /&gt;
&lt;br /&gt;
That said, the FeministWiki promises to show the utmost responsibility with regard to data privacy and security.  It doesn&#039;t expect you to provide any sort of personally identifying information in your profile, and even if you choose to do so, the FeministWiki will never give that information out, &#039;&#039;&#039;unless required by German law&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Being hosted in Germany and belonging to a German non-profit organization, the FeministWiki is also bound by European and German law with regard to respecting user data and privacy.&lt;br /&gt;
&lt;br /&gt;
For more in-depth information, you may read the [[FW:Privacy policy|FeministWiki Privacy Policy]], which contains a legally binding policy text and some non-binding but detailed explanations in lay terms.&lt;br /&gt;
&lt;br /&gt;
=== Who runs the site? ===&lt;br /&gt;
&lt;br /&gt;
The platform is offered by the German non-profit company &#039;&#039;&#039;FeministWiki gemeinnützige UG (haftungsbeschränkt)&#039;&#039;&#039; or FeministWiki gUG for short.  The founder of the non-profit and administrator of the website is male computer programmer [https://twitter.com/KammerTaylan Taylan Kammer], who also goes by [https://spinster.xyz/@socjuswiz Social Justice Wizard] on Spinster.&lt;br /&gt;
&lt;br /&gt;
== Help topics ==&lt;br /&gt;
&lt;br /&gt;
=== What happens if I lose my password? ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Main help page: [[Help:Password]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you want to have safety against lost passwords, you can set a recovery e-mail address via the [https://settings.feministwiki.org/settings.html FeministWiki Account Settings] page.  This e-mail address should &#039;&#039;&#039;not&#039;&#039;&#039; be your FeministWiki e-mail address (like &#039;&#039;janedoe@feministwiki.org&#039;&#039;), because you need your FeministWiki password to access that one in the first place.  (Chicken and egg problem.)  The recovery e-mail address will be invisible to everyone except the FeministWiki technician.&lt;br /&gt;
&lt;br /&gt;
If it&#039;s very important for you to keep your identity private, and if you don&#039;t trust the technician or fear data leaks, then you can use an e-mail address that isn&#039;t tied to your real identity.  Just make sure that you can always access the e-mail that you use for this purpose, as otherwise you will not be able to reset your password.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alternatively,&#039;&#039;&#039; you can contact the technician by sending an email to technician@feministwiki.org and ask for a manual password reset.&lt;br /&gt;
&lt;br /&gt;
=== How does creating or editing wiki pages work? ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Main help page: [[Help:Wiki]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Getting the hang of wiki editing may take some time, but the community will surely be delighted by your contributions!&lt;br /&gt;
&lt;br /&gt;
See the help page linked above to get started, or dive right into the official and comprehensive [https://www.mediawiki.org/wiki/Help:Contents MediaWiki help page] if you&#039;re already somewhat skilled with software or feel courageous.&lt;br /&gt;
&lt;br /&gt;
=== How do I use the forum? ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Main help page: [[Help:Forum]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Forum front-page: https://forum.feministwiki.org/&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
An internet forum or web forum is a website that allows members to create &amp;quot;topics&amp;quot; (also called &amp;quot;threads&amp;quot;) to discuss a certain matter.  Once a topic is created, other members can reply (or &amp;quot;post&amp;quot;) to the topic to add their insights.  There is no limit to what these topics may be about, so the forum usually offers a number of categories (or &amp;quot;sub forums&amp;quot;) under which the topics are grouped.  A well-known example of a web forum is the British website [https://www.mumsnet.com/Talk/active-conversations Mumsnet].&lt;br /&gt;
&lt;br /&gt;
For detailed instructions on how to use the FeministWiki forum, visit the forum help page linked above.&lt;br /&gt;
&lt;br /&gt;
=== How do I use the chat system? ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Main help page: [[Help:Chat]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Chat web-interface: https://chat.feministwiki.org/&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The simplest way to use the chat is by opening the web interface linked above, and logging in there with your FeministWiki username and password.&lt;br /&gt;
&lt;br /&gt;
You can also access the chat from dedicated chat programs like [https://gajim.org/ Gajim] or smartphone apps like [https://www.xabber.com/android/ Xabber for Android] or [https://chatsecure.org/ ChatSecure for iOS].&lt;br /&gt;
&lt;br /&gt;
For detailed instructions on how to set up some of these chat programs/apps, see the help page linked above.&lt;br /&gt;
&lt;br /&gt;
=== How do I publish on the blog? ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Blog front-page: https://blogs.feministwiki.org/&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you want to publish articles on the FeministWiki blog, ask the technician by sending an e-mail to technician@feministwiki.org, and your FeministWiki account will be granted the ability to publish on the blog.  If you want, you can also get a personalized blog that you have full control over, under a name like &amp;quot;blogs.feministwiki.org/JaneDoe&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The blog uses a self-hosted installation of the well-known blogging software [https://wordpress.com/features/ WordPress].  While the WordPress organization controls blogs that are hosted on their own servers, they also release the software behind their blogging system under a [https://www.fsf.org/about/what-is-free-software free software] license, so anyone can install it on their own servers.  The FeministWiki has such a local installation of that software, meaning that the WordPress organization has no control over what&#039;s published on the FeministWiki blog.  As such, you don&#039;t need to fear censorship.&lt;br /&gt;
&lt;br /&gt;
For further information on the FeministWiki blog, visit the blog front-page linked above.&lt;br /&gt;
&lt;br /&gt;
=== How do I use the file storage? ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Main help page: [[Help:Files]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Files web-interface: https://files.feministwiki.org/&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The FeministWiki file storage lets you upload potentially very large files and save them on the FeministWiki servers.  You can then access the files from anywhere, and optionally share some files with others via a link you send them.&lt;br /&gt;
&lt;br /&gt;
To prevent accidental overloading of the server, every member is granted a quota of 1 GB storage by default.  If you would like to store more data, just ask the technician to increase your quota.&lt;br /&gt;
&lt;br /&gt;
For detailed information on how to use the file storage, see the help page linked above.&lt;br /&gt;
&lt;br /&gt;
=== How do I use my FeministWiki e-mail address? ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Main help page: [[Help:Mail]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Mail web-interface: https://mail.feministwiki.org/&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The easiest way to use your FeministWiki e-mail is by visiting the web interface linked above, and logging in with your FeministWiki username and password.&lt;br /&gt;
&lt;br /&gt;
You can also set up any e-mail program/app on your computer or smartphone to use your FeministWiki e-mail address.&lt;br /&gt;
&lt;br /&gt;
For further details, see the help page linked above.&lt;br /&gt;
&lt;br /&gt;
=== Wait what?  You have an IRC server? ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Main help page: [[Help:IRC]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The FeministWiki offers an &#039;&#039;Internet Relay Chat&#039;&#039; server for those who have been using computers for a long time and feel especially nostalgic, or those among the younger generations who have re-discovered IRC.&lt;br /&gt;
&lt;br /&gt;
The server is only open to members.  It rejects connections from those who can&#039;t authenticate with a valid FeministWiki username and password.  The hostname is &#039;&#039;&#039;irc.feministwiki.org&#039;&#039;&#039; and only encrypted connections are accepted, on port 6697.  To establish a connection, configure your IRC client so that your IRC nick is your FeministWiki username, and make your client use the rudimentary &amp;lt;code&amp;gt;PASS&amp;lt;/code&amp;gt; authentication method with your FeministWiki password.  (In most IRC clients this will simply correspond to a &amp;quot;password&amp;quot; text field that you fill out while configuring the connection.)&lt;br /&gt;
&lt;br /&gt;
=== I have a friend who wants to become a member! ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Interface: [https://account.feministwiki.org/add-member.html Add a member]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Every member of the FeministWiki can add further members.  Currently the above-linked basic web interface is the way to do so.&lt;br /&gt;
&lt;br /&gt;
Simply fill out your own FeministWiki username and password, and then enter the desired username for the member you want to add.  After you click the &amp;quot;Add member&amp;quot; button, the page will show some text saying that the operation was successful and show you an automatically generated password.  Send the username and the generated password to the new member and inform them that they can change their password after logging in.&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1184</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1184"/>
		<updated>2021-08-23T00:04:26Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Install PHP and modules */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the {{C|A}} entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup \&lt;br /&gt;
                 certbot \&lt;br /&gt;
                 dnsutils \&lt;br /&gt;
                 emacs \&lt;br /&gt;
                 git \&lt;br /&gt;
                 mg \&lt;br /&gt;
                 moreutils \&lt;br /&gt;
                 net-tools \&lt;br /&gt;
                 nmap \&lt;br /&gt;
                 rsync \&lt;br /&gt;
                 software-properties-common \&lt;br /&gt;
                 tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the {{C|.ssh/id_rsa}} from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in {{C|/root/pwd/meta}} on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 apt-get install apache2 \&lt;br /&gt;
                 dovecot-core \&lt;br /&gt;
                 dovecot-imapd \&lt;br /&gt;
                 dovecot-ldap \&lt;br /&gt;
                 dovecot-pop3d \&lt;br /&gt;
                 ejabberd \&lt;br /&gt;
                 fail2ban \&lt;br /&gt;
                 inspircd \&lt;br /&gt;
                 mailman \&lt;br /&gt;
                 mariadb-server \&lt;br /&gt;
                 opendkim \&lt;br /&gt;
                 postfix \&lt;br /&gt;
                 postfix-ldap \&lt;br /&gt;
                 slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in {{C|/root/pwd}}.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Install PHP and modules ===&lt;br /&gt;
&lt;br /&gt;
This should really be part of the last section, but due to the sheer number of PHP modules we want to install, it&#039;s in its own section:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install php${php_version} \&lt;br /&gt;
                 php${php_version}-apcu \&lt;br /&gt;
                 php${php_version}-bcmath \&lt;br /&gt;
                 php${php_version}-cli \&lt;br /&gt;
                 php${php_version}-ctype \&lt;br /&gt;
                 php${php_version}-curl \&lt;br /&gt;
                 php${php_version}-gd \&lt;br /&gt;
                 php${php_version}-gmp \&lt;br /&gt;
                 php${php_version}-iconv \&lt;br /&gt;
                 php${php_version}-imagick \&lt;br /&gt;
                 php${php_version}-intl \&lt;br /&gt;
                 php${php_version}-json \&lt;br /&gt;
                 php${php_version}-ldap \&lt;br /&gt;
                 php${php_version}-mbstring \&lt;br /&gt;
                 php${php_version}-mysql \&lt;br /&gt;
                 php${php_version}-opcache \&lt;br /&gt;
                 php${php_version}-readline \&lt;br /&gt;
                 php${php_version}-xml \&lt;br /&gt;
                 php${php_version}-zip&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules, config, and sites ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
 &lt;br /&gt;
 a2enconf 99-feministwiki&lt;br /&gt;
 &lt;br /&gt;
 a2ensite 000-wiki&lt;br /&gt;
 a2ensite account&lt;br /&gt;
 a2ensite blogs&lt;br /&gt;
 a2ensite chat&lt;br /&gt;
 a2ensite files&lt;br /&gt;
 a2ensite forum&lt;br /&gt;
 a2ensite mail&lt;br /&gt;
 a2ensite xmpp&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our {{C|letsencrypt-refresh}} script makes sure that the cert files are found in {{C|/etc/fw-certs}} and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes.  Note that although some of the steps described in this section take a long time to finish, they can be done in parallel.&lt;br /&gt;
&lt;br /&gt;
=== LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
==== Breaking changes in OpenLDAP ====&lt;br /&gt;
&lt;br /&gt;
There might be incompatible changes between OpenLDAP (aka {{C|slapd}}) versions which require manual editing of the {{C|slapcat}} output before it&#039;s read in on the new server with {{C|slapadd}}.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open {{C|/etc/ldap/schema/ppolicy.ldif}} and search for {{C|pwdMaxRecordedFailure}}.  You will note that there is a {{C|olcAttributeTypes: ...}} entry that defines it, and also it&#039;s listed in the {{C|MAY}} attributes block of the {{C|olcObjectClasses: ...}} entry that defines the {{C|pwdPolicy}} object class.&lt;br /&gt;
# On the old server, save the output of {{C|slapcat -n 0}} to a file, open the file, and search for the block where the {{C|ppolicy}} schema is defined.  It should start with the line {{C|dn: cn={4}ppolicy,cn=schema,cn=config}} (the {{C|{4}}} part might contain a different integer, that&#039;s OK).  There, note that the {{C|olcAttributeTypes: ...}} entry for {{C|pwdMaxRecordedFailure}} is missing, and also it&#039;s not listed in the {{C|MAY}} list of the {{C|pwdPolicy}} object class definition.  Copy over the attribute type definition from the {{C|ppolicy.ldif}} file on the new server, and amend the {{C|MAY}} list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Contents of /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -az --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/var/www/}} is important; if not provided, it will copy the directory to {{C|/var/www/www}} on the new server.&lt;br /&gt;
&lt;br /&gt;
=== SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | gzip | ssh root@feministwiki.dev &#039;gunzip | /root/bin/sql&#039;&lt;br /&gt;
&lt;br /&gt;
You can use the {{C|show databases;}} command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the {{C|--all-databases}} option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
=== Emails ===&lt;br /&gt;
&lt;br /&gt;
This is a simple one.  Run this command from the old server:&lt;br /&gt;
&lt;br /&gt;
 rsync -az --delete /home/vmail/ root@feministwiki.dev:/home/vmail&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/home/vmail/}} is important.&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 tar -czf - archives data lists | ssh root@feministwiki.dev &#039;cd /var/lib/mailman &amp;amp;&amp;amp; tar -xzf - &amp;amp;&amp;amp; check_perms -f&#039;&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing the group ownership of the extracted files.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch.  To do so, run this on the new server:&lt;br /&gt;
&lt;br /&gt;
 /root/bin/sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;&#039;Copying over live data&#039;&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  (For instance, the {{C|--delete}} argument to the {{C|rsync}} command and the {{C|--add-drop-database}} argument to the {{C|mysqldump}} command help to make sure of this.)&lt;br /&gt;
&lt;br /&gt;
So in short, just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main {{C|A}} entry for {{C|@}} (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The {{C|A}} entry for {{C|smtp}} since this is not allowed to be a CNAME&lt;br /&gt;
* The {{C|A}} entry for {{C|xmpp}} since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main {{C|A}} entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the {{C|letsencrypt-refresh}} script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1183</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1183"/>
		<updated>2021-08-23T00:04:02Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Install server components */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the {{C|A}} entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup \&lt;br /&gt;
                 certbot \&lt;br /&gt;
                 dnsutils \&lt;br /&gt;
                 emacs \&lt;br /&gt;
                 git \&lt;br /&gt;
                 mg \&lt;br /&gt;
                 moreutils \&lt;br /&gt;
                 net-tools \&lt;br /&gt;
                 nmap \&lt;br /&gt;
                 rsync \&lt;br /&gt;
                 software-properties-common \&lt;br /&gt;
                 tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the {{C|.ssh/id_rsa}} from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in {{C|/root/pwd/meta}} on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 apt-get install apache2 \&lt;br /&gt;
                 dovecot-core \&lt;br /&gt;
                 dovecot-imapd \&lt;br /&gt;
                 dovecot-ldap \&lt;br /&gt;
                 dovecot-pop3d \&lt;br /&gt;
                 ejabberd \&lt;br /&gt;
                 fail2ban \&lt;br /&gt;
                 inspircd \&lt;br /&gt;
                 mailman \&lt;br /&gt;
                 mariadb-server \&lt;br /&gt;
                 opendkim \&lt;br /&gt;
                 postfix \&lt;br /&gt;
                 postfix-ldap \&lt;br /&gt;
                 slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in {{C|/root/pwd}}.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Install PHP and modules ===&lt;br /&gt;
&lt;br /&gt;
This should really be part of the last section, but due to the sheer number of PHP modules we want to install, it&#039;s in its own section:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install php${php_version}&lt;br /&gt;
 apt-get install php${php_version}-apcu&lt;br /&gt;
 apt-get install php${php_version}-bcmath&lt;br /&gt;
 apt-get install php${php_version}-cli&lt;br /&gt;
 apt-get install php${php_version}-ctype&lt;br /&gt;
 apt-get install php${php_version}-curl&lt;br /&gt;
 apt-get install php${php_version}-gd&lt;br /&gt;
 apt-get install php${php_version}-gmp&lt;br /&gt;
 apt-get install php${php_version}-iconv&lt;br /&gt;
 apt-get install php${php_version}-imagick&lt;br /&gt;
 apt-get install php${php_version}-intl&lt;br /&gt;
 apt-get install php${php_version}-json&lt;br /&gt;
 apt-get install php${php_version}-ldap&lt;br /&gt;
 apt-get install php${php_version}-mbstring&lt;br /&gt;
 apt-get install php${php_version}-mysql&lt;br /&gt;
 apt-get install php${php_version}-opcache&lt;br /&gt;
 apt-get install php${php_version}-readline&lt;br /&gt;
 apt-get install php${php_version}-xml&lt;br /&gt;
 apt-get install php${php_version}-zip&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules, config, and sites ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
 &lt;br /&gt;
 a2enconf 99-feministwiki&lt;br /&gt;
 &lt;br /&gt;
 a2ensite 000-wiki&lt;br /&gt;
 a2ensite account&lt;br /&gt;
 a2ensite blogs&lt;br /&gt;
 a2ensite chat&lt;br /&gt;
 a2ensite files&lt;br /&gt;
 a2ensite forum&lt;br /&gt;
 a2ensite mail&lt;br /&gt;
 a2ensite xmpp&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our {{C|letsencrypt-refresh}} script makes sure that the cert files are found in {{C|/etc/fw-certs}} and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes.  Note that although some of the steps described in this section take a long time to finish, they can be done in parallel.&lt;br /&gt;
&lt;br /&gt;
=== LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
==== Breaking changes in OpenLDAP ====&lt;br /&gt;
&lt;br /&gt;
There might be incompatible changes between OpenLDAP (aka {{C|slapd}}) versions which require manual editing of the {{C|slapcat}} output before it&#039;s read in on the new server with {{C|slapadd}}.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open {{C|/etc/ldap/schema/ppolicy.ldif}} and search for {{C|pwdMaxRecordedFailure}}.  You will note that there is a {{C|olcAttributeTypes: ...}} entry that defines it, and also it&#039;s listed in the {{C|MAY}} attributes block of the {{C|olcObjectClasses: ...}} entry that defines the {{C|pwdPolicy}} object class.&lt;br /&gt;
# On the old server, save the output of {{C|slapcat -n 0}} to a file, open the file, and search for the block where the {{C|ppolicy}} schema is defined.  It should start with the line {{C|dn: cn={4}ppolicy,cn=schema,cn=config}} (the {{C|{4}}} part might contain a different integer, that&#039;s OK).  There, note that the {{C|olcAttributeTypes: ...}} entry for {{C|pwdMaxRecordedFailure}} is missing, and also it&#039;s not listed in the {{C|MAY}} list of the {{C|pwdPolicy}} object class definition.  Copy over the attribute type definition from the {{C|ppolicy.ldif}} file on the new server, and amend the {{C|MAY}} list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Contents of /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -az --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/var/www/}} is important; if not provided, it will copy the directory to {{C|/var/www/www}} on the new server.&lt;br /&gt;
&lt;br /&gt;
=== SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | gzip | ssh root@feministwiki.dev &#039;gunzip | /root/bin/sql&#039;&lt;br /&gt;
&lt;br /&gt;
You can use the {{C|show databases;}} command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the {{C|--all-databases}} option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
=== Emails ===&lt;br /&gt;
&lt;br /&gt;
This is a simple one.  Run this command from the old server:&lt;br /&gt;
&lt;br /&gt;
 rsync -az --delete /home/vmail/ root@feministwiki.dev:/home/vmail&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/home/vmail/}} is important.&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 tar -czf - archives data lists | ssh root@feministwiki.dev &#039;cd /var/lib/mailman &amp;amp;&amp;amp; tar -xzf - &amp;amp;&amp;amp; check_perms -f&#039;&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing the group ownership of the extracted files.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch.  To do so, run this on the new server:&lt;br /&gt;
&lt;br /&gt;
 /root/bin/sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;&#039;Copying over live data&#039;&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  (For instance, the {{C|--delete}} argument to the {{C|rsync}} command and the {{C|--add-drop-database}} argument to the {{C|mysqldump}} command help to make sure of this.)&lt;br /&gt;
&lt;br /&gt;
So in short, just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main {{C|A}} entry for {{C|@}} (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The {{C|A}} entry for {{C|smtp}} since this is not allowed to be a CNAME&lt;br /&gt;
* The {{C|A}} entry for {{C|xmpp}} since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main {{C|A}} entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the {{C|letsencrypt-refresh}} script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1182</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1182"/>
		<updated>2021-08-23T00:03:00Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Install miscellaneous tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the {{C|A}} entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup \&lt;br /&gt;
                 certbot \&lt;br /&gt;
                 dnsutils \&lt;br /&gt;
                 emacs \&lt;br /&gt;
                 git \&lt;br /&gt;
                 mg \&lt;br /&gt;
                 moreutils \&lt;br /&gt;
                 net-tools \&lt;br /&gt;
                 nmap \&lt;br /&gt;
                 rsync \&lt;br /&gt;
                 software-properties-common \&lt;br /&gt;
                 tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the {{C|.ssh/id_rsa}} from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in {{C|/root/pwd/meta}} on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 apt-get install apache2&lt;br /&gt;
 apt-get install dovecot-core&lt;br /&gt;
 apt-get install dovecot-imapd&lt;br /&gt;
 apt-get install dovecot-ldap&lt;br /&gt;
 apt-get install dovecot-pop3d&lt;br /&gt;
 apt-get install ejabberd # good candidate for backports&lt;br /&gt;
 apt-get install fail2ban&lt;br /&gt;
 apt-get install inspircd&lt;br /&gt;
 apt-get install mailman&lt;br /&gt;
 apt-get install mariadb-server&lt;br /&gt;
 apt-get install opendkim&lt;br /&gt;
 apt-get install postfix&lt;br /&gt;
 apt-get install postfix-ldap&lt;br /&gt;
 apt-get install slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in {{C|/root/pwd}}.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Install PHP and modules ===&lt;br /&gt;
&lt;br /&gt;
This should really be part of the last section, but due to the sheer number of PHP modules we want to install, it&#039;s in its own section:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install php${php_version}&lt;br /&gt;
 apt-get install php${php_version}-apcu&lt;br /&gt;
 apt-get install php${php_version}-bcmath&lt;br /&gt;
 apt-get install php${php_version}-cli&lt;br /&gt;
 apt-get install php${php_version}-ctype&lt;br /&gt;
 apt-get install php${php_version}-curl&lt;br /&gt;
 apt-get install php${php_version}-gd&lt;br /&gt;
 apt-get install php${php_version}-gmp&lt;br /&gt;
 apt-get install php${php_version}-iconv&lt;br /&gt;
 apt-get install php${php_version}-imagick&lt;br /&gt;
 apt-get install php${php_version}-intl&lt;br /&gt;
 apt-get install php${php_version}-json&lt;br /&gt;
 apt-get install php${php_version}-ldap&lt;br /&gt;
 apt-get install php${php_version}-mbstring&lt;br /&gt;
 apt-get install php${php_version}-mysql&lt;br /&gt;
 apt-get install php${php_version}-opcache&lt;br /&gt;
 apt-get install php${php_version}-readline&lt;br /&gt;
 apt-get install php${php_version}-xml&lt;br /&gt;
 apt-get install php${php_version}-zip&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules, config, and sites ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
 &lt;br /&gt;
 a2enconf 99-feministwiki&lt;br /&gt;
 &lt;br /&gt;
 a2ensite 000-wiki&lt;br /&gt;
 a2ensite account&lt;br /&gt;
 a2ensite blogs&lt;br /&gt;
 a2ensite chat&lt;br /&gt;
 a2ensite files&lt;br /&gt;
 a2ensite forum&lt;br /&gt;
 a2ensite mail&lt;br /&gt;
 a2ensite xmpp&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our {{C|letsencrypt-refresh}} script makes sure that the cert files are found in {{C|/etc/fw-certs}} and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes.  Note that although some of the steps described in this section take a long time to finish, they can be done in parallel.&lt;br /&gt;
&lt;br /&gt;
=== LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
==== Breaking changes in OpenLDAP ====&lt;br /&gt;
&lt;br /&gt;
There might be incompatible changes between OpenLDAP (aka {{C|slapd}}) versions which require manual editing of the {{C|slapcat}} output before it&#039;s read in on the new server with {{C|slapadd}}.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open {{C|/etc/ldap/schema/ppolicy.ldif}} and search for {{C|pwdMaxRecordedFailure}}.  You will note that there is a {{C|olcAttributeTypes: ...}} entry that defines it, and also it&#039;s listed in the {{C|MAY}} attributes block of the {{C|olcObjectClasses: ...}} entry that defines the {{C|pwdPolicy}} object class.&lt;br /&gt;
# On the old server, save the output of {{C|slapcat -n 0}} to a file, open the file, and search for the block where the {{C|ppolicy}} schema is defined.  It should start with the line {{C|dn: cn={4}ppolicy,cn=schema,cn=config}} (the {{C|{4}}} part might contain a different integer, that&#039;s OK).  There, note that the {{C|olcAttributeTypes: ...}} entry for {{C|pwdMaxRecordedFailure}} is missing, and also it&#039;s not listed in the {{C|MAY}} list of the {{C|pwdPolicy}} object class definition.  Copy over the attribute type definition from the {{C|ppolicy.ldif}} file on the new server, and amend the {{C|MAY}} list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Contents of /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -az --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/var/www/}} is important; if not provided, it will copy the directory to {{C|/var/www/www}} on the new server.&lt;br /&gt;
&lt;br /&gt;
=== SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | gzip | ssh root@feministwiki.dev &#039;gunzip | /root/bin/sql&#039;&lt;br /&gt;
&lt;br /&gt;
You can use the {{C|show databases;}} command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the {{C|--all-databases}} option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
=== Emails ===&lt;br /&gt;
&lt;br /&gt;
This is a simple one.  Run this command from the old server:&lt;br /&gt;
&lt;br /&gt;
 rsync -az --delete /home/vmail/ root@feministwiki.dev:/home/vmail&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/home/vmail/}} is important.&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 tar -czf - archives data lists | ssh root@feministwiki.dev &#039;cd /var/lib/mailman &amp;amp;&amp;amp; tar -xzf - &amp;amp;&amp;amp; check_perms -f&#039;&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing the group ownership of the extracted files.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch.  To do so, run this on the new server:&lt;br /&gt;
&lt;br /&gt;
 /root/bin/sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;&#039;Copying over live data&#039;&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  (For instance, the {{C|--delete}} argument to the {{C|rsync}} command and the {{C|--add-drop-database}} argument to the {{C|mysqldump}} command help to make sure of this.)&lt;br /&gt;
&lt;br /&gt;
So in short, just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main {{C|A}} entry for {{C|@}} (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The {{C|A}} entry for {{C|smtp}} since this is not allowed to be a CNAME&lt;br /&gt;
* The {{C|A}} entry for {{C|xmpp}} since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main {{C|A}} entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the {{C|letsencrypt-refresh}} script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1181</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1181"/>
		<updated>2021-08-23T00:01:59Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Install miscellaneous tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the {{C|A}} entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install -y automysqlbackup&lt;br /&gt;
 apt-get install -y certbot&lt;br /&gt;
 apt-get install -y dnsutils&lt;br /&gt;
 apt-get install -y emacs&lt;br /&gt;
 apt-get install -y git&lt;br /&gt;
 apt-get install -y mg&lt;br /&gt;
 apt-get install -y moreutils&lt;br /&gt;
 apt-get install -y net-tools&lt;br /&gt;
 apt-get install -y nmap&lt;br /&gt;
 apt-get install -y rsync&lt;br /&gt;
 apt-get install -y software-properties-common&lt;br /&gt;
 apt-get install -y tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the {{C|.ssh/id_rsa}} from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in {{C|/root/pwd/meta}} on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 apt-get install apache2&lt;br /&gt;
 apt-get install dovecot-core&lt;br /&gt;
 apt-get install dovecot-imapd&lt;br /&gt;
 apt-get install dovecot-ldap&lt;br /&gt;
 apt-get install dovecot-pop3d&lt;br /&gt;
 apt-get install ejabberd # good candidate for backports&lt;br /&gt;
 apt-get install fail2ban&lt;br /&gt;
 apt-get install inspircd&lt;br /&gt;
 apt-get install mailman&lt;br /&gt;
 apt-get install mariadb-server&lt;br /&gt;
 apt-get install opendkim&lt;br /&gt;
 apt-get install postfix&lt;br /&gt;
 apt-get install postfix-ldap&lt;br /&gt;
 apt-get install slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in {{C|/root/pwd}}.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Install PHP and modules ===&lt;br /&gt;
&lt;br /&gt;
This should really be part of the last section, but due to the sheer number of PHP modules we want to install, it&#039;s in its own section:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install php${php_version}&lt;br /&gt;
 apt-get install php${php_version}-apcu&lt;br /&gt;
 apt-get install php${php_version}-bcmath&lt;br /&gt;
 apt-get install php${php_version}-cli&lt;br /&gt;
 apt-get install php${php_version}-ctype&lt;br /&gt;
 apt-get install php${php_version}-curl&lt;br /&gt;
 apt-get install php${php_version}-gd&lt;br /&gt;
 apt-get install php${php_version}-gmp&lt;br /&gt;
 apt-get install php${php_version}-iconv&lt;br /&gt;
 apt-get install php${php_version}-imagick&lt;br /&gt;
 apt-get install php${php_version}-intl&lt;br /&gt;
 apt-get install php${php_version}-json&lt;br /&gt;
 apt-get install php${php_version}-ldap&lt;br /&gt;
 apt-get install php${php_version}-mbstring&lt;br /&gt;
 apt-get install php${php_version}-mysql&lt;br /&gt;
 apt-get install php${php_version}-opcache&lt;br /&gt;
 apt-get install php${php_version}-readline&lt;br /&gt;
 apt-get install php${php_version}-xml&lt;br /&gt;
 apt-get install php${php_version}-zip&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules, config, and sites ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
 &lt;br /&gt;
 a2enconf 99-feministwiki&lt;br /&gt;
 &lt;br /&gt;
 a2ensite 000-wiki&lt;br /&gt;
 a2ensite account&lt;br /&gt;
 a2ensite blogs&lt;br /&gt;
 a2ensite chat&lt;br /&gt;
 a2ensite files&lt;br /&gt;
 a2ensite forum&lt;br /&gt;
 a2ensite mail&lt;br /&gt;
 a2ensite xmpp&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our {{C|letsencrypt-refresh}} script makes sure that the cert files are found in {{C|/etc/fw-certs}} and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes.  Note that although some of the steps described in this section take a long time to finish, they can be done in parallel.&lt;br /&gt;
&lt;br /&gt;
=== LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
==== Breaking changes in OpenLDAP ====&lt;br /&gt;
&lt;br /&gt;
There might be incompatible changes between OpenLDAP (aka {{C|slapd}}) versions which require manual editing of the {{C|slapcat}} output before it&#039;s read in on the new server with {{C|slapadd}}.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open {{C|/etc/ldap/schema/ppolicy.ldif}} and search for {{C|pwdMaxRecordedFailure}}.  You will note that there is a {{C|olcAttributeTypes: ...}} entry that defines it, and also it&#039;s listed in the {{C|MAY}} attributes block of the {{C|olcObjectClasses: ...}} entry that defines the {{C|pwdPolicy}} object class.&lt;br /&gt;
# On the old server, save the output of {{C|slapcat -n 0}} to a file, open the file, and search for the block where the {{C|ppolicy}} schema is defined.  It should start with the line {{C|dn: cn={4}ppolicy,cn=schema,cn=config}} (the {{C|{4}}} part might contain a different integer, that&#039;s OK).  There, note that the {{C|olcAttributeTypes: ...}} entry for {{C|pwdMaxRecordedFailure}} is missing, and also it&#039;s not listed in the {{C|MAY}} list of the {{C|pwdPolicy}} object class definition.  Copy over the attribute type definition from the {{C|ppolicy.ldif}} file on the new server, and amend the {{C|MAY}} list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Contents of /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -az --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/var/www/}} is important; if not provided, it will copy the directory to {{C|/var/www/www}} on the new server.&lt;br /&gt;
&lt;br /&gt;
=== SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | gzip | ssh root@feministwiki.dev &#039;gunzip | /root/bin/sql&#039;&lt;br /&gt;
&lt;br /&gt;
You can use the {{C|show databases;}} command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the {{C|--all-databases}} option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
=== Emails ===&lt;br /&gt;
&lt;br /&gt;
This is a simple one.  Run this command from the old server:&lt;br /&gt;
&lt;br /&gt;
 rsync -az --delete /home/vmail/ root@feministwiki.dev:/home/vmail&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/home/vmail/}} is important.&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 tar -czf - archives data lists | ssh root@feministwiki.dev &#039;cd /var/lib/mailman &amp;amp;&amp;amp; tar -xzf - &amp;amp;&amp;amp; check_perms -f&#039;&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing the group ownership of the extracted files.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch.  To do so, run this on the new server:&lt;br /&gt;
&lt;br /&gt;
 /root/bin/sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;&#039;Copying over live data&#039;&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  (For instance, the {{C|--delete}} argument to the {{C|rsync}} command and the {{C|--add-drop-database}} argument to the {{C|mysqldump}} command help to make sure of this.)&lt;br /&gt;
&lt;br /&gt;
So in short, just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main {{C|A}} entry for {{C|@}} (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The {{C|A}} entry for {{C|smtp}} since this is not allowed to be a CNAME&lt;br /&gt;
* The {{C|A}} entry for {{C|xmpp}} since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main {{C|A}} entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the {{C|letsencrypt-refresh}} script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1177</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1177"/>
		<updated>2021-08-20T12:35:34Z</updated>

		<summary type="html">&lt;p&gt;Technician : Change all uses of the code HTML tag to the &amp;quot;C&amp;quot; template.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the {{C|A}} entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup&lt;br /&gt;
 apt-get install certbot&lt;br /&gt;
 apt-get install dnsutils&lt;br /&gt;
 apt-get install emacs&lt;br /&gt;
 apt-get install git&lt;br /&gt;
 apt-get install mg&lt;br /&gt;
 apt-get install moreutils&lt;br /&gt;
 apt-get install net-tools&lt;br /&gt;
 apt-get install nmap&lt;br /&gt;
 apt-get install rsync&lt;br /&gt;
 apt-get install software-properties-common&lt;br /&gt;
 apt-get install tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the {{C|.ssh/id_rsa}} from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in {{C|/root/pwd/meta}} on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 apt-get install apache2&lt;br /&gt;
 apt-get install dovecot-core&lt;br /&gt;
 apt-get install dovecot-imapd&lt;br /&gt;
 apt-get install dovecot-ldap&lt;br /&gt;
 apt-get install dovecot-pop3d&lt;br /&gt;
 apt-get install ejabberd # good candidate for backports&lt;br /&gt;
 apt-get install fail2ban&lt;br /&gt;
 apt-get install inspircd&lt;br /&gt;
 apt-get install mailman&lt;br /&gt;
 apt-get install mariadb-server&lt;br /&gt;
 apt-get install opendkim&lt;br /&gt;
 apt-get install postfix&lt;br /&gt;
 apt-get install postfix-ldap&lt;br /&gt;
 apt-get install slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in {{C|/root/pwd}}.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Install PHP and modules ===&lt;br /&gt;
&lt;br /&gt;
This should really be part of the last section, but due to the sheer number of PHP modules we want to install, it&#039;s in its own section:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install php${php_version}&lt;br /&gt;
 apt-get install php${php_version}-apcu&lt;br /&gt;
 apt-get install php${php_version}-bcmath&lt;br /&gt;
 apt-get install php${php_version}-cli&lt;br /&gt;
 apt-get install php${php_version}-ctype&lt;br /&gt;
 apt-get install php${php_version}-curl&lt;br /&gt;
 apt-get install php${php_version}-gd&lt;br /&gt;
 apt-get install php${php_version}-gmp&lt;br /&gt;
 apt-get install php${php_version}-iconv&lt;br /&gt;
 apt-get install php${php_version}-imagick&lt;br /&gt;
 apt-get install php${php_version}-intl&lt;br /&gt;
 apt-get install php${php_version}-json&lt;br /&gt;
 apt-get install php${php_version}-ldap&lt;br /&gt;
 apt-get install php${php_version}-mbstring&lt;br /&gt;
 apt-get install php${php_version}-mysql&lt;br /&gt;
 apt-get install php${php_version}-opcache&lt;br /&gt;
 apt-get install php${php_version}-readline&lt;br /&gt;
 apt-get install php${php_version}-xml&lt;br /&gt;
 apt-get install php${php_version}-zip&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules, config, and sites ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
 &lt;br /&gt;
 a2enconf 99-feministwiki&lt;br /&gt;
 &lt;br /&gt;
 a2ensite 000-wiki&lt;br /&gt;
 a2ensite account&lt;br /&gt;
 a2ensite blogs&lt;br /&gt;
 a2ensite chat&lt;br /&gt;
 a2ensite files&lt;br /&gt;
 a2ensite forum&lt;br /&gt;
 a2ensite mail&lt;br /&gt;
 a2ensite xmpp&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our {{C|letsencrypt-refresh}} script makes sure that the cert files are found in {{C|/etc/fw-certs}} and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes.  Note that although some of the steps described in this section take a long time to finish, they can be done in parallel.&lt;br /&gt;
&lt;br /&gt;
=== LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
==== Breaking changes in OpenLDAP ====&lt;br /&gt;
&lt;br /&gt;
There might be incompatible changes between OpenLDAP (aka {{C|slapd}}) versions which require manual editing of the {{C|slapcat}} output before it&#039;s read in on the new server with {{C|slapadd}}.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open {{C|/etc/ldap/schema/ppolicy.ldif}} and search for {{C|pwdMaxRecordedFailure}}.  You will note that there is a {{C|olcAttributeTypes: ...}} entry that defines it, and also it&#039;s listed in the {{C|MAY}} attributes block of the {{C|olcObjectClasses: ...}} entry that defines the {{C|pwdPolicy}} object class.&lt;br /&gt;
# On the old server, save the output of {{C|slapcat -n 0}} to a file, open the file, and search for the block where the {{C|ppolicy}} schema is defined.  It should start with the line {{C|dn: cn={4}ppolicy,cn=schema,cn=config}} (the {{C|{4}}} part might contain a different integer, that&#039;s OK).  There, note that the {{C|olcAttributeTypes: ...}} entry for {{C|pwdMaxRecordedFailure}} is missing, and also it&#039;s not listed in the {{C|MAY}} list of the {{C|pwdPolicy}} object class definition.  Copy over the attribute type definition from the {{C|ppolicy.ldif}} file on the new server, and amend the {{C|MAY}} list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Contents of /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -az --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/var/www/}} is important; if not provided, it will copy the directory to {{C|/var/www/www}} on the new server.&lt;br /&gt;
&lt;br /&gt;
=== SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | gzip | ssh root@feministwiki.dev &#039;gunzip | /root/bin/sql&#039;&lt;br /&gt;
&lt;br /&gt;
You can use the {{C|show databases;}} command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the {{C|--all-databases}} option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
=== Emails ===&lt;br /&gt;
&lt;br /&gt;
This is a simple one.  Run this command from the old server:&lt;br /&gt;
&lt;br /&gt;
 rsync -az --delete /home/vmail/ root@feministwiki.dev:/home/vmail&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/home/vmail/}} is important.&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 tar -czf - archives data lists | ssh root@feministwiki.dev &#039;cd /var/lib/mailman &amp;amp;&amp;amp; tar -xzf - &amp;amp;&amp;amp; check_perms -f&#039;&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing the group ownership of the extracted files.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch.  To do so, run this on the new server:&lt;br /&gt;
&lt;br /&gt;
 /root/bin/sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;&#039;Copying over live data&#039;&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  (For instance, the {{C|--delete}} argument to the {{C|rsync}} command and the {{C|--add-drop-database}} argument to the {{C|mysqldump}} command help to make sure of this.)&lt;br /&gt;
&lt;br /&gt;
So in short, just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main {{C|A}} entry for {{C|@}} (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The {{C|A}} entry for {{C|smtp}} since this is not allowed to be a CNAME&lt;br /&gt;
* The {{C|A}} entry for {{C|xmpp}} since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main {{C|A}} entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the {{C|letsencrypt-refresh}} script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1176</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1176"/>
		<updated>2021-08-20T12:34:16Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Contents of /var/www */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup&lt;br /&gt;
 apt-get install certbot&lt;br /&gt;
 apt-get install dnsutils&lt;br /&gt;
 apt-get install emacs&lt;br /&gt;
 apt-get install git&lt;br /&gt;
 apt-get install mg&lt;br /&gt;
 apt-get install moreutils&lt;br /&gt;
 apt-get install net-tools&lt;br /&gt;
 apt-get install nmap&lt;br /&gt;
 apt-get install rsync&lt;br /&gt;
 apt-get install software-properties-common&lt;br /&gt;
 apt-get install tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the &amp;lt;code&amp;gt;.ssh/id_rsa&amp;lt;/code&amp;gt; from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in &amp;lt;code&amp;gt;/root/pwd/meta&amp;lt;/code&amp;gt; on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 apt-get install apache2&lt;br /&gt;
 apt-get install dovecot-core&lt;br /&gt;
 apt-get install dovecot-imapd&lt;br /&gt;
 apt-get install dovecot-ldap&lt;br /&gt;
 apt-get install dovecot-pop3d&lt;br /&gt;
 apt-get install ejabberd # good candidate for backports&lt;br /&gt;
 apt-get install fail2ban&lt;br /&gt;
 apt-get install inspircd&lt;br /&gt;
 apt-get install mailman&lt;br /&gt;
 apt-get install mariadb-server&lt;br /&gt;
 apt-get install opendkim&lt;br /&gt;
 apt-get install postfix&lt;br /&gt;
 apt-get install postfix-ldap&lt;br /&gt;
 apt-get install slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in &amp;lt;code&amp;gt;/root/pwd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Install PHP and modules ===&lt;br /&gt;
&lt;br /&gt;
This should really be part of the last section, but due to the sheer number of PHP modules we want to install, it&#039;s in its own section:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install php${php_version}&lt;br /&gt;
 apt-get install php${php_version}-apcu&lt;br /&gt;
 apt-get install php${php_version}-bcmath&lt;br /&gt;
 apt-get install php${php_version}-cli&lt;br /&gt;
 apt-get install php${php_version}-ctype&lt;br /&gt;
 apt-get install php${php_version}-curl&lt;br /&gt;
 apt-get install php${php_version}-gd&lt;br /&gt;
 apt-get install php${php_version}-gmp&lt;br /&gt;
 apt-get install php${php_version}-iconv&lt;br /&gt;
 apt-get install php${php_version}-imagick&lt;br /&gt;
 apt-get install php${php_version}-intl&lt;br /&gt;
 apt-get install php${php_version}-json&lt;br /&gt;
 apt-get install php${php_version}-ldap&lt;br /&gt;
 apt-get install php${php_version}-mbstring&lt;br /&gt;
 apt-get install php${php_version}-mysql&lt;br /&gt;
 apt-get install php${php_version}-opcache&lt;br /&gt;
 apt-get install php${php_version}-readline&lt;br /&gt;
 apt-get install php${php_version}-xml&lt;br /&gt;
 apt-get install php${php_version}-zip&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules, config, and sites ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
 &lt;br /&gt;
 a2enconf 99-feministwiki&lt;br /&gt;
 &lt;br /&gt;
 a2ensite 000-wiki&lt;br /&gt;
 a2ensite account&lt;br /&gt;
 a2ensite blogs&lt;br /&gt;
 a2ensite chat&lt;br /&gt;
 a2ensite files&lt;br /&gt;
 a2ensite forum&lt;br /&gt;
 a2ensite mail&lt;br /&gt;
 a2ensite xmpp&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script makes sure that the cert files are found in &amp;lt;code&amp;gt;/etc/fw-certs&amp;lt;/code&amp;gt; and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes.  Note that although some of the steps described in this section take a long time to finish, they can be done in parallel.&lt;br /&gt;
&lt;br /&gt;
=== LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
==== Breaking changes in OpenLDAP ====&lt;br /&gt;
&lt;br /&gt;
There might be incompatible changes between OpenLDAP (aka &amp;lt;code&amp;gt;slapd&amp;lt;/code&amp;gt;) versions which require manual editing of the &amp;lt;code&amp;gt;slapcat&amp;lt;/code&amp;gt; output before it&#039;s read in on the new server with &amp;lt;code&amp;gt;slapadd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open &amp;lt;code&amp;gt;/etc/ldap/schema/ppolicy.ldif&amp;lt;/code&amp;gt; and search for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt;.  You will note that there is a &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry that defines it, and also it&#039;s listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; attributes block of the &amp;lt;code&amp;gt;olcObjectClasses: ...&amp;lt;/code&amp;gt; entry that defines the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class.&lt;br /&gt;
# On the old server, save the output of &amp;lt;code&amp;gt;slapcat -n 0&amp;lt;/code&amp;gt; to a file, open the file, and search for the block where the &amp;lt;code&amp;gt;ppolicy&amp;lt;/code&amp;gt; schema is defined.  It should start with the line &amp;lt;code&amp;gt;dn: cn={4}ppolicy,cn=schema,cn=config&amp;lt;/code&amp;gt; (the &amp;lt;code&amp;gt;{4}&amp;lt;/code&amp;gt; part might contain a different integer, that&#039;s OK).  There, note that the &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt; is missing, and also it&#039;s not listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list of the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class definition.  Copy over the attribute type definition from the &amp;lt;code&amp;gt;ppolicy.ldif&amp;lt;/code&amp;gt; file on the new server, and amend the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Contents of /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -az --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in &amp;lt;code&amp;gt;/var/www/&amp;lt;/code&amp;gt; is important; if not provided, it will copy the directory to &amp;lt;code&amp;gt;/var/www/www&amp;lt;/code&amp;gt; on the new server.&lt;br /&gt;
&lt;br /&gt;
=== SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | gzip | ssh root@feministwiki.dev &#039;gunzip | /root/bin/sql&#039;&lt;br /&gt;
&lt;br /&gt;
You can use the &amp;lt;code&amp;gt;show databases;&amp;lt;/code&amp;gt; command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the &amp;lt;code&amp;gt;--all-databases&amp;lt;/code&amp;gt; option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
=== Emails ===&lt;br /&gt;
&lt;br /&gt;
This is a simple one.  Run this command from the old server:&lt;br /&gt;
&lt;br /&gt;
 rsync -az --delete /home/vmail/ root@feministwiki.dev:/home/vmail&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/home/vmail/}} is important.&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 tar -czf - archives data lists | ssh root@feministwiki.dev &#039;cd /var/lib/mailman &amp;amp;&amp;amp; tar -xzf - &amp;amp;&amp;amp; check_perms -f&#039;&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing the group ownership of the extracted files.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch.  To do so, run this on the new server:&lt;br /&gt;
&lt;br /&gt;
 /root/bin/sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;&#039;Copying over live data&#039;&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  (For instance, the &amp;lt;code&amp;gt;--delete&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;rsync&amp;lt;/code&amp;gt; command and the &amp;lt;code&amp;gt;--add-drop-database&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;mysqldump&amp;lt;/code&amp;gt; command help to make sure of this.)&lt;br /&gt;
&lt;br /&gt;
So in short, just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;smtp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;xmpp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1175</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1175"/>
		<updated>2021-08-20T12:34:07Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Emails */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup&lt;br /&gt;
 apt-get install certbot&lt;br /&gt;
 apt-get install dnsutils&lt;br /&gt;
 apt-get install emacs&lt;br /&gt;
 apt-get install git&lt;br /&gt;
 apt-get install mg&lt;br /&gt;
 apt-get install moreutils&lt;br /&gt;
 apt-get install net-tools&lt;br /&gt;
 apt-get install nmap&lt;br /&gt;
 apt-get install rsync&lt;br /&gt;
 apt-get install software-properties-common&lt;br /&gt;
 apt-get install tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the &amp;lt;code&amp;gt;.ssh/id_rsa&amp;lt;/code&amp;gt; from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in &amp;lt;code&amp;gt;/root/pwd/meta&amp;lt;/code&amp;gt; on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 apt-get install apache2&lt;br /&gt;
 apt-get install dovecot-core&lt;br /&gt;
 apt-get install dovecot-imapd&lt;br /&gt;
 apt-get install dovecot-ldap&lt;br /&gt;
 apt-get install dovecot-pop3d&lt;br /&gt;
 apt-get install ejabberd # good candidate for backports&lt;br /&gt;
 apt-get install fail2ban&lt;br /&gt;
 apt-get install inspircd&lt;br /&gt;
 apt-get install mailman&lt;br /&gt;
 apt-get install mariadb-server&lt;br /&gt;
 apt-get install opendkim&lt;br /&gt;
 apt-get install postfix&lt;br /&gt;
 apt-get install postfix-ldap&lt;br /&gt;
 apt-get install slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in &amp;lt;code&amp;gt;/root/pwd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Install PHP and modules ===&lt;br /&gt;
&lt;br /&gt;
This should really be part of the last section, but due to the sheer number of PHP modules we want to install, it&#039;s in its own section:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install php${php_version}&lt;br /&gt;
 apt-get install php${php_version}-apcu&lt;br /&gt;
 apt-get install php${php_version}-bcmath&lt;br /&gt;
 apt-get install php${php_version}-cli&lt;br /&gt;
 apt-get install php${php_version}-ctype&lt;br /&gt;
 apt-get install php${php_version}-curl&lt;br /&gt;
 apt-get install php${php_version}-gd&lt;br /&gt;
 apt-get install php${php_version}-gmp&lt;br /&gt;
 apt-get install php${php_version}-iconv&lt;br /&gt;
 apt-get install php${php_version}-imagick&lt;br /&gt;
 apt-get install php${php_version}-intl&lt;br /&gt;
 apt-get install php${php_version}-json&lt;br /&gt;
 apt-get install php${php_version}-ldap&lt;br /&gt;
 apt-get install php${php_version}-mbstring&lt;br /&gt;
 apt-get install php${php_version}-mysql&lt;br /&gt;
 apt-get install php${php_version}-opcache&lt;br /&gt;
 apt-get install php${php_version}-readline&lt;br /&gt;
 apt-get install php${php_version}-xml&lt;br /&gt;
 apt-get install php${php_version}-zip&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules, config, and sites ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
 &lt;br /&gt;
 a2enconf 99-feministwiki&lt;br /&gt;
 &lt;br /&gt;
 a2ensite 000-wiki&lt;br /&gt;
 a2ensite account&lt;br /&gt;
 a2ensite blogs&lt;br /&gt;
 a2ensite chat&lt;br /&gt;
 a2ensite files&lt;br /&gt;
 a2ensite forum&lt;br /&gt;
 a2ensite mail&lt;br /&gt;
 a2ensite xmpp&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script makes sure that the cert files are found in &amp;lt;code&amp;gt;/etc/fw-certs&amp;lt;/code&amp;gt; and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes.  Note that although some of the steps described in this section take a long time to finish, they can be done in parallel.&lt;br /&gt;
&lt;br /&gt;
=== LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
==== Breaking changes in OpenLDAP ====&lt;br /&gt;
&lt;br /&gt;
There might be incompatible changes between OpenLDAP (aka &amp;lt;code&amp;gt;slapd&amp;lt;/code&amp;gt;) versions which require manual editing of the &amp;lt;code&amp;gt;slapcat&amp;lt;/code&amp;gt; output before it&#039;s read in on the new server with &amp;lt;code&amp;gt;slapadd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open &amp;lt;code&amp;gt;/etc/ldap/schema/ppolicy.ldif&amp;lt;/code&amp;gt; and search for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt;.  You will note that there is a &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry that defines it, and also it&#039;s listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; attributes block of the &amp;lt;code&amp;gt;olcObjectClasses: ...&amp;lt;/code&amp;gt; entry that defines the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class.&lt;br /&gt;
# On the old server, save the output of &amp;lt;code&amp;gt;slapcat -n 0&amp;lt;/code&amp;gt; to a file, open the file, and search for the block where the &amp;lt;code&amp;gt;ppolicy&amp;lt;/code&amp;gt; schema is defined.  It should start with the line &amp;lt;code&amp;gt;dn: cn={4}ppolicy,cn=schema,cn=config&amp;lt;/code&amp;gt; (the &amp;lt;code&amp;gt;{4}&amp;lt;/code&amp;gt; part might contain a different integer, that&#039;s OK).  There, note that the &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt; is missing, and also it&#039;s not listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list of the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class definition.  Copy over the attribute type definition from the &amp;lt;code&amp;gt;ppolicy.ldif&amp;lt;/code&amp;gt; file on the new server, and amend the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Contents of /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in &amp;lt;code&amp;gt;/var/www/&amp;lt;/code&amp;gt; is important; if not provided, it will copy the directory to &amp;lt;code&amp;gt;/var/www/www&amp;lt;/code&amp;gt; on the new server.&lt;br /&gt;
&lt;br /&gt;
=== SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | gzip | ssh root@feministwiki.dev &#039;gunzip | /root/bin/sql&#039;&lt;br /&gt;
&lt;br /&gt;
You can use the &amp;lt;code&amp;gt;show databases;&amp;lt;/code&amp;gt; command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the &amp;lt;code&amp;gt;--all-databases&amp;lt;/code&amp;gt; option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
=== Emails ===&lt;br /&gt;
&lt;br /&gt;
This is a simple one.  Run this command from the old server:&lt;br /&gt;
&lt;br /&gt;
 rsync -az --delete /home/vmail/ root@feministwiki.dev:/home/vmail&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/home/vmail/}} is important.&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 tar -czf - archives data lists | ssh root@feministwiki.dev &#039;cd /var/lib/mailman &amp;amp;&amp;amp; tar -xzf - &amp;amp;&amp;amp; check_perms -f&#039;&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing the group ownership of the extracted files.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch.  To do so, run this on the new server:&lt;br /&gt;
&lt;br /&gt;
 /root/bin/sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;&#039;Copying over live data&#039;&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  (For instance, the &amp;lt;code&amp;gt;--delete&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;rsync&amp;lt;/code&amp;gt; command and the &amp;lt;code&amp;gt;--add-drop-database&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;mysqldump&amp;lt;/code&amp;gt; command help to make sure of this.)&lt;br /&gt;
&lt;br /&gt;
So in short, just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;smtp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;xmpp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1174</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1174"/>
		<updated>2021-08-20T12:33:56Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* SQL databases */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup&lt;br /&gt;
 apt-get install certbot&lt;br /&gt;
 apt-get install dnsutils&lt;br /&gt;
 apt-get install emacs&lt;br /&gt;
 apt-get install git&lt;br /&gt;
 apt-get install mg&lt;br /&gt;
 apt-get install moreutils&lt;br /&gt;
 apt-get install net-tools&lt;br /&gt;
 apt-get install nmap&lt;br /&gt;
 apt-get install rsync&lt;br /&gt;
 apt-get install software-properties-common&lt;br /&gt;
 apt-get install tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the &amp;lt;code&amp;gt;.ssh/id_rsa&amp;lt;/code&amp;gt; from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in &amp;lt;code&amp;gt;/root/pwd/meta&amp;lt;/code&amp;gt; on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 apt-get install apache2&lt;br /&gt;
 apt-get install dovecot-core&lt;br /&gt;
 apt-get install dovecot-imapd&lt;br /&gt;
 apt-get install dovecot-ldap&lt;br /&gt;
 apt-get install dovecot-pop3d&lt;br /&gt;
 apt-get install ejabberd # good candidate for backports&lt;br /&gt;
 apt-get install fail2ban&lt;br /&gt;
 apt-get install inspircd&lt;br /&gt;
 apt-get install mailman&lt;br /&gt;
 apt-get install mariadb-server&lt;br /&gt;
 apt-get install opendkim&lt;br /&gt;
 apt-get install postfix&lt;br /&gt;
 apt-get install postfix-ldap&lt;br /&gt;
 apt-get install slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in &amp;lt;code&amp;gt;/root/pwd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Install PHP and modules ===&lt;br /&gt;
&lt;br /&gt;
This should really be part of the last section, but due to the sheer number of PHP modules we want to install, it&#039;s in its own section:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install php${php_version}&lt;br /&gt;
 apt-get install php${php_version}-apcu&lt;br /&gt;
 apt-get install php${php_version}-bcmath&lt;br /&gt;
 apt-get install php${php_version}-cli&lt;br /&gt;
 apt-get install php${php_version}-ctype&lt;br /&gt;
 apt-get install php${php_version}-curl&lt;br /&gt;
 apt-get install php${php_version}-gd&lt;br /&gt;
 apt-get install php${php_version}-gmp&lt;br /&gt;
 apt-get install php${php_version}-iconv&lt;br /&gt;
 apt-get install php${php_version}-imagick&lt;br /&gt;
 apt-get install php${php_version}-intl&lt;br /&gt;
 apt-get install php${php_version}-json&lt;br /&gt;
 apt-get install php${php_version}-ldap&lt;br /&gt;
 apt-get install php${php_version}-mbstring&lt;br /&gt;
 apt-get install php${php_version}-mysql&lt;br /&gt;
 apt-get install php${php_version}-opcache&lt;br /&gt;
 apt-get install php${php_version}-readline&lt;br /&gt;
 apt-get install php${php_version}-xml&lt;br /&gt;
 apt-get install php${php_version}-zip&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules, config, and sites ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
 &lt;br /&gt;
 a2enconf 99-feministwiki&lt;br /&gt;
 &lt;br /&gt;
 a2ensite 000-wiki&lt;br /&gt;
 a2ensite account&lt;br /&gt;
 a2ensite blogs&lt;br /&gt;
 a2ensite chat&lt;br /&gt;
 a2ensite files&lt;br /&gt;
 a2ensite forum&lt;br /&gt;
 a2ensite mail&lt;br /&gt;
 a2ensite xmpp&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script makes sure that the cert files are found in &amp;lt;code&amp;gt;/etc/fw-certs&amp;lt;/code&amp;gt; and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes.  Note that although some of the steps described in this section take a long time to finish, they can be done in parallel.&lt;br /&gt;
&lt;br /&gt;
=== LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
==== Breaking changes in OpenLDAP ====&lt;br /&gt;
&lt;br /&gt;
There might be incompatible changes between OpenLDAP (aka &amp;lt;code&amp;gt;slapd&amp;lt;/code&amp;gt;) versions which require manual editing of the &amp;lt;code&amp;gt;slapcat&amp;lt;/code&amp;gt; output before it&#039;s read in on the new server with &amp;lt;code&amp;gt;slapadd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open &amp;lt;code&amp;gt;/etc/ldap/schema/ppolicy.ldif&amp;lt;/code&amp;gt; and search for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt;.  You will note that there is a &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry that defines it, and also it&#039;s listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; attributes block of the &amp;lt;code&amp;gt;olcObjectClasses: ...&amp;lt;/code&amp;gt; entry that defines the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class.&lt;br /&gt;
# On the old server, save the output of &amp;lt;code&amp;gt;slapcat -n 0&amp;lt;/code&amp;gt; to a file, open the file, and search for the block where the &amp;lt;code&amp;gt;ppolicy&amp;lt;/code&amp;gt; schema is defined.  It should start with the line &amp;lt;code&amp;gt;dn: cn={4}ppolicy,cn=schema,cn=config&amp;lt;/code&amp;gt; (the &amp;lt;code&amp;gt;{4}&amp;lt;/code&amp;gt; part might contain a different integer, that&#039;s OK).  There, note that the &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt; is missing, and also it&#039;s not listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list of the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class definition.  Copy over the attribute type definition from the &amp;lt;code&amp;gt;ppolicy.ldif&amp;lt;/code&amp;gt; file on the new server, and amend the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Contents of /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in &amp;lt;code&amp;gt;/var/www/&amp;lt;/code&amp;gt; is important; if not provided, it will copy the directory to &amp;lt;code&amp;gt;/var/www/www&amp;lt;/code&amp;gt; on the new server.&lt;br /&gt;
&lt;br /&gt;
=== SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | gzip | ssh root@feministwiki.dev &#039;gunzip | /root/bin/sql&#039;&lt;br /&gt;
&lt;br /&gt;
You can use the &amp;lt;code&amp;gt;show databases;&amp;lt;/code&amp;gt; command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the &amp;lt;code&amp;gt;--all-databases&amp;lt;/code&amp;gt; option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
=== Emails ===&lt;br /&gt;
&lt;br /&gt;
This is a simple one.  Run this command from the old server:&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /home/vmail/ root@feministwiki.dev:/home/vmail&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/home/vmail/}} is important.&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 tar -czf - archives data lists | ssh root@feministwiki.dev &#039;cd /var/lib/mailman &amp;amp;&amp;amp; tar -xzf - &amp;amp;&amp;amp; check_perms -f&#039;&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing the group ownership of the extracted files.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch.  To do so, run this on the new server:&lt;br /&gt;
&lt;br /&gt;
 /root/bin/sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;&#039;Copying over live data&#039;&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  (For instance, the &amp;lt;code&amp;gt;--delete&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;rsync&amp;lt;/code&amp;gt; command and the &amp;lt;code&amp;gt;--add-drop-database&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;mysqldump&amp;lt;/code&amp;gt; command help to make sure of this.)&lt;br /&gt;
&lt;br /&gt;
So in short, just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;smtp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;xmpp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1173</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1173"/>
		<updated>2021-08-20T12:32:29Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Breaking changes in OpenLDAP */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup&lt;br /&gt;
 apt-get install certbot&lt;br /&gt;
 apt-get install dnsutils&lt;br /&gt;
 apt-get install emacs&lt;br /&gt;
 apt-get install git&lt;br /&gt;
 apt-get install mg&lt;br /&gt;
 apt-get install moreutils&lt;br /&gt;
 apt-get install net-tools&lt;br /&gt;
 apt-get install nmap&lt;br /&gt;
 apt-get install rsync&lt;br /&gt;
 apt-get install software-properties-common&lt;br /&gt;
 apt-get install tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the &amp;lt;code&amp;gt;.ssh/id_rsa&amp;lt;/code&amp;gt; from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in &amp;lt;code&amp;gt;/root/pwd/meta&amp;lt;/code&amp;gt; on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 apt-get install apache2&lt;br /&gt;
 apt-get install dovecot-core&lt;br /&gt;
 apt-get install dovecot-imapd&lt;br /&gt;
 apt-get install dovecot-ldap&lt;br /&gt;
 apt-get install dovecot-pop3d&lt;br /&gt;
 apt-get install ejabberd # good candidate for backports&lt;br /&gt;
 apt-get install fail2ban&lt;br /&gt;
 apt-get install inspircd&lt;br /&gt;
 apt-get install mailman&lt;br /&gt;
 apt-get install mariadb-server&lt;br /&gt;
 apt-get install opendkim&lt;br /&gt;
 apt-get install postfix&lt;br /&gt;
 apt-get install postfix-ldap&lt;br /&gt;
 apt-get install slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in &amp;lt;code&amp;gt;/root/pwd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Install PHP and modules ===&lt;br /&gt;
&lt;br /&gt;
This should really be part of the last section, but due to the sheer number of PHP modules we want to install, it&#039;s in its own section:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install php${php_version}&lt;br /&gt;
 apt-get install php${php_version}-apcu&lt;br /&gt;
 apt-get install php${php_version}-bcmath&lt;br /&gt;
 apt-get install php${php_version}-cli&lt;br /&gt;
 apt-get install php${php_version}-ctype&lt;br /&gt;
 apt-get install php${php_version}-curl&lt;br /&gt;
 apt-get install php${php_version}-gd&lt;br /&gt;
 apt-get install php${php_version}-gmp&lt;br /&gt;
 apt-get install php${php_version}-iconv&lt;br /&gt;
 apt-get install php${php_version}-imagick&lt;br /&gt;
 apt-get install php${php_version}-intl&lt;br /&gt;
 apt-get install php${php_version}-json&lt;br /&gt;
 apt-get install php${php_version}-ldap&lt;br /&gt;
 apt-get install php${php_version}-mbstring&lt;br /&gt;
 apt-get install php${php_version}-mysql&lt;br /&gt;
 apt-get install php${php_version}-opcache&lt;br /&gt;
 apt-get install php${php_version}-readline&lt;br /&gt;
 apt-get install php${php_version}-xml&lt;br /&gt;
 apt-get install php${php_version}-zip&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules, config, and sites ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
 &lt;br /&gt;
 a2enconf 99-feministwiki&lt;br /&gt;
 &lt;br /&gt;
 a2ensite 000-wiki&lt;br /&gt;
 a2ensite account&lt;br /&gt;
 a2ensite blogs&lt;br /&gt;
 a2ensite chat&lt;br /&gt;
 a2ensite files&lt;br /&gt;
 a2ensite forum&lt;br /&gt;
 a2ensite mail&lt;br /&gt;
 a2ensite xmpp&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script makes sure that the cert files are found in &amp;lt;code&amp;gt;/etc/fw-certs&amp;lt;/code&amp;gt; and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes.  Note that although some of the steps described in this section take a long time to finish, they can be done in parallel.&lt;br /&gt;
&lt;br /&gt;
=== LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
==== Breaking changes in OpenLDAP ====&lt;br /&gt;
&lt;br /&gt;
There might be incompatible changes between OpenLDAP (aka &amp;lt;code&amp;gt;slapd&amp;lt;/code&amp;gt;) versions which require manual editing of the &amp;lt;code&amp;gt;slapcat&amp;lt;/code&amp;gt; output before it&#039;s read in on the new server with &amp;lt;code&amp;gt;slapadd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open &amp;lt;code&amp;gt;/etc/ldap/schema/ppolicy.ldif&amp;lt;/code&amp;gt; and search for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt;.  You will note that there is a &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry that defines it, and also it&#039;s listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; attributes block of the &amp;lt;code&amp;gt;olcObjectClasses: ...&amp;lt;/code&amp;gt; entry that defines the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class.&lt;br /&gt;
# On the old server, save the output of &amp;lt;code&amp;gt;slapcat -n 0&amp;lt;/code&amp;gt; to a file, open the file, and search for the block where the &amp;lt;code&amp;gt;ppolicy&amp;lt;/code&amp;gt; schema is defined.  It should start with the line &amp;lt;code&amp;gt;dn: cn={4}ppolicy,cn=schema,cn=config&amp;lt;/code&amp;gt; (the &amp;lt;code&amp;gt;{4}&amp;lt;/code&amp;gt; part might contain a different integer, that&#039;s OK).  There, note that the &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt; is missing, and also it&#039;s not listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list of the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class definition.  Copy over the attribute type definition from the &amp;lt;code&amp;gt;ppolicy.ldif&amp;lt;/code&amp;gt; file on the new server, and amend the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Contents of /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in &amp;lt;code&amp;gt;/var/www/&amp;lt;/code&amp;gt; is important; if not provided, it will copy the directory to &amp;lt;code&amp;gt;/var/www/www&amp;lt;/code&amp;gt; on the new server.&lt;br /&gt;
&lt;br /&gt;
=== SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | ssh root@feministwiki.dev /root/bin/sql&lt;br /&gt;
&lt;br /&gt;
You can use the &amp;lt;code&amp;gt;show databases;&amp;lt;/code&amp;gt; command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the &amp;lt;code&amp;gt;--all-databases&amp;lt;/code&amp;gt; option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
=== Emails ===&lt;br /&gt;
&lt;br /&gt;
This is a simple one.  Run this command from the old server:&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /home/vmail/ root@feministwiki.dev:/home/vmail&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/home/vmail/}} is important.&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 tar -czf - archives data lists | ssh root@feministwiki.dev &#039;cd /var/lib/mailman &amp;amp;&amp;amp; tar -xzf - &amp;amp;&amp;amp; check_perms -f&#039;&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing the group ownership of the extracted files.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch.  To do so, run this on the new server:&lt;br /&gt;
&lt;br /&gt;
 /root/bin/sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;&#039;Copying over live data&#039;&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  (For instance, the &amp;lt;code&amp;gt;--delete&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;rsync&amp;lt;/code&amp;gt; command and the &amp;lt;code&amp;gt;--add-drop-database&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;mysqldump&amp;lt;/code&amp;gt; command help to make sure of this.)&lt;br /&gt;
&lt;br /&gt;
So in short, just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;smtp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;xmpp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1172</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1172"/>
		<updated>2021-08-20T12:32:08Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* LDAP databases */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup&lt;br /&gt;
 apt-get install certbot&lt;br /&gt;
 apt-get install dnsutils&lt;br /&gt;
 apt-get install emacs&lt;br /&gt;
 apt-get install git&lt;br /&gt;
 apt-get install mg&lt;br /&gt;
 apt-get install moreutils&lt;br /&gt;
 apt-get install net-tools&lt;br /&gt;
 apt-get install nmap&lt;br /&gt;
 apt-get install rsync&lt;br /&gt;
 apt-get install software-properties-common&lt;br /&gt;
 apt-get install tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the &amp;lt;code&amp;gt;.ssh/id_rsa&amp;lt;/code&amp;gt; from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in &amp;lt;code&amp;gt;/root/pwd/meta&amp;lt;/code&amp;gt; on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 apt-get install apache2&lt;br /&gt;
 apt-get install dovecot-core&lt;br /&gt;
 apt-get install dovecot-imapd&lt;br /&gt;
 apt-get install dovecot-ldap&lt;br /&gt;
 apt-get install dovecot-pop3d&lt;br /&gt;
 apt-get install ejabberd # good candidate for backports&lt;br /&gt;
 apt-get install fail2ban&lt;br /&gt;
 apt-get install inspircd&lt;br /&gt;
 apt-get install mailman&lt;br /&gt;
 apt-get install mariadb-server&lt;br /&gt;
 apt-get install opendkim&lt;br /&gt;
 apt-get install postfix&lt;br /&gt;
 apt-get install postfix-ldap&lt;br /&gt;
 apt-get install slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in &amp;lt;code&amp;gt;/root/pwd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Install PHP and modules ===&lt;br /&gt;
&lt;br /&gt;
This should really be part of the last section, but due to the sheer number of PHP modules we want to install, it&#039;s in its own section:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install php${php_version}&lt;br /&gt;
 apt-get install php${php_version}-apcu&lt;br /&gt;
 apt-get install php${php_version}-bcmath&lt;br /&gt;
 apt-get install php${php_version}-cli&lt;br /&gt;
 apt-get install php${php_version}-ctype&lt;br /&gt;
 apt-get install php${php_version}-curl&lt;br /&gt;
 apt-get install php${php_version}-gd&lt;br /&gt;
 apt-get install php${php_version}-gmp&lt;br /&gt;
 apt-get install php${php_version}-iconv&lt;br /&gt;
 apt-get install php${php_version}-imagick&lt;br /&gt;
 apt-get install php${php_version}-intl&lt;br /&gt;
 apt-get install php${php_version}-json&lt;br /&gt;
 apt-get install php${php_version}-ldap&lt;br /&gt;
 apt-get install php${php_version}-mbstring&lt;br /&gt;
 apt-get install php${php_version}-mysql&lt;br /&gt;
 apt-get install php${php_version}-opcache&lt;br /&gt;
 apt-get install php${php_version}-readline&lt;br /&gt;
 apt-get install php${php_version}-xml&lt;br /&gt;
 apt-get install php${php_version}-zip&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules, config, and sites ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
 &lt;br /&gt;
 a2enconf 99-feministwiki&lt;br /&gt;
 &lt;br /&gt;
 a2ensite 000-wiki&lt;br /&gt;
 a2ensite account&lt;br /&gt;
 a2ensite blogs&lt;br /&gt;
 a2ensite chat&lt;br /&gt;
 a2ensite files&lt;br /&gt;
 a2ensite forum&lt;br /&gt;
 a2ensite mail&lt;br /&gt;
 a2ensite xmpp&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script makes sure that the cert files are found in &amp;lt;code&amp;gt;/etc/fw-certs&amp;lt;/code&amp;gt; and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes.  Note that although some of the steps described in this section take a long time to finish, they can be done in parallel.&lt;br /&gt;
&lt;br /&gt;
=== LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
==== Breaking changes in OpenLDAP ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;There might be incompatible changes between OpenLDAP (aka &amp;lt;code&amp;gt;slapd&amp;lt;/code&amp;gt;) versions which require manual editing of the &amp;lt;code&amp;gt;slapcat&amp;lt;/code&amp;gt; output before it&#039;s read in on the new server with &amp;lt;code&amp;gt;slapadd&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open &amp;lt;code&amp;gt;/etc/ldap/schema/ppolicy.ldif&amp;lt;/code&amp;gt; and search for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt;.  You will note that there is a &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry that defines it, and also it&#039;s listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; attributes block of the &amp;lt;code&amp;gt;olcObjectClasses: ...&amp;lt;/code&amp;gt; entry that defines the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class.&lt;br /&gt;
# On the old server, save the output of &amp;lt;code&amp;gt;slapcat -n 0&amp;lt;/code&amp;gt; to a file, open the file, and search for the block where the &amp;lt;code&amp;gt;ppolicy&amp;lt;/code&amp;gt; schema is defined.  It should start with the line &amp;lt;code&amp;gt;dn: cn={4}ppolicy,cn=schema,cn=config&amp;lt;/code&amp;gt; (the &amp;lt;code&amp;gt;{4}&amp;lt;/code&amp;gt; part might contain a different integer, that&#039;s OK).  There, note that the &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt; is missing, and also it&#039;s not listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list of the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class definition.  Copy over the attribute type definition from the &amp;lt;code&amp;gt;ppolicy.ldif&amp;lt;/code&amp;gt; file on the new server, and amend the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Contents of /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in &amp;lt;code&amp;gt;/var/www/&amp;lt;/code&amp;gt; is important; if not provided, it will copy the directory to &amp;lt;code&amp;gt;/var/www/www&amp;lt;/code&amp;gt; on the new server.&lt;br /&gt;
&lt;br /&gt;
=== SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | ssh root@feministwiki.dev /root/bin/sql&lt;br /&gt;
&lt;br /&gt;
You can use the &amp;lt;code&amp;gt;show databases;&amp;lt;/code&amp;gt; command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the &amp;lt;code&amp;gt;--all-databases&amp;lt;/code&amp;gt; option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
=== Emails ===&lt;br /&gt;
&lt;br /&gt;
This is a simple one.  Run this command from the old server:&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /home/vmail/ root@feministwiki.dev:/home/vmail&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/home/vmail/}} is important.&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 tar -czf - archives data lists | ssh root@feministwiki.dev &#039;cd /var/lib/mailman &amp;amp;&amp;amp; tar -xzf - &amp;amp;&amp;amp; check_perms -f&#039;&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing the group ownership of the extracted files.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch.  To do so, run this on the new server:&lt;br /&gt;
&lt;br /&gt;
 /root/bin/sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;&#039;Copying over live data&#039;&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  (For instance, the &amp;lt;code&amp;gt;--delete&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;rsync&amp;lt;/code&amp;gt; command and the &amp;lt;code&amp;gt;--add-drop-database&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;mysqldump&amp;lt;/code&amp;gt; command help to make sure of this.)&lt;br /&gt;
&lt;br /&gt;
So in short, just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;smtp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;xmpp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1171</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1171"/>
		<updated>2021-08-20T12:31:24Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Copying over live data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup&lt;br /&gt;
 apt-get install certbot&lt;br /&gt;
 apt-get install dnsutils&lt;br /&gt;
 apt-get install emacs&lt;br /&gt;
 apt-get install git&lt;br /&gt;
 apt-get install mg&lt;br /&gt;
 apt-get install moreutils&lt;br /&gt;
 apt-get install net-tools&lt;br /&gt;
 apt-get install nmap&lt;br /&gt;
 apt-get install rsync&lt;br /&gt;
 apt-get install software-properties-common&lt;br /&gt;
 apt-get install tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the &amp;lt;code&amp;gt;.ssh/id_rsa&amp;lt;/code&amp;gt; from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in &amp;lt;code&amp;gt;/root/pwd/meta&amp;lt;/code&amp;gt; on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 apt-get install apache2&lt;br /&gt;
 apt-get install dovecot-core&lt;br /&gt;
 apt-get install dovecot-imapd&lt;br /&gt;
 apt-get install dovecot-ldap&lt;br /&gt;
 apt-get install dovecot-pop3d&lt;br /&gt;
 apt-get install ejabberd # good candidate for backports&lt;br /&gt;
 apt-get install fail2ban&lt;br /&gt;
 apt-get install inspircd&lt;br /&gt;
 apt-get install mailman&lt;br /&gt;
 apt-get install mariadb-server&lt;br /&gt;
 apt-get install opendkim&lt;br /&gt;
 apt-get install postfix&lt;br /&gt;
 apt-get install postfix-ldap&lt;br /&gt;
 apt-get install slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in &amp;lt;code&amp;gt;/root/pwd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Install PHP and modules ===&lt;br /&gt;
&lt;br /&gt;
This should really be part of the last section, but due to the sheer number of PHP modules we want to install, it&#039;s in its own section:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install php${php_version}&lt;br /&gt;
 apt-get install php${php_version}-apcu&lt;br /&gt;
 apt-get install php${php_version}-bcmath&lt;br /&gt;
 apt-get install php${php_version}-cli&lt;br /&gt;
 apt-get install php${php_version}-ctype&lt;br /&gt;
 apt-get install php${php_version}-curl&lt;br /&gt;
 apt-get install php${php_version}-gd&lt;br /&gt;
 apt-get install php${php_version}-gmp&lt;br /&gt;
 apt-get install php${php_version}-iconv&lt;br /&gt;
 apt-get install php${php_version}-imagick&lt;br /&gt;
 apt-get install php${php_version}-intl&lt;br /&gt;
 apt-get install php${php_version}-json&lt;br /&gt;
 apt-get install php${php_version}-ldap&lt;br /&gt;
 apt-get install php${php_version}-mbstring&lt;br /&gt;
 apt-get install php${php_version}-mysql&lt;br /&gt;
 apt-get install php${php_version}-opcache&lt;br /&gt;
 apt-get install php${php_version}-readline&lt;br /&gt;
 apt-get install php${php_version}-xml&lt;br /&gt;
 apt-get install php${php_version}-zip&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules, config, and sites ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
 &lt;br /&gt;
 a2enconf 99-feministwiki&lt;br /&gt;
 &lt;br /&gt;
 a2ensite 000-wiki&lt;br /&gt;
 a2ensite account&lt;br /&gt;
 a2ensite blogs&lt;br /&gt;
 a2ensite chat&lt;br /&gt;
 a2ensite files&lt;br /&gt;
 a2ensite forum&lt;br /&gt;
 a2ensite mail&lt;br /&gt;
 a2ensite xmpp&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script makes sure that the cert files are found in &amp;lt;code&amp;gt;/etc/fw-certs&amp;lt;/code&amp;gt; and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes.  Note that although some of the steps described in this section take a long time to finish, they can be done in parallel.&lt;br /&gt;
&lt;br /&gt;
=== LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;There might be incompatible changes between OpenLDAP (aka &amp;lt;code&amp;gt;slapd&amp;lt;/code&amp;gt;) versions which require manual editing of the &amp;lt;code&amp;gt;slapcat&amp;lt;/code&amp;gt; output before it&#039;s read in on the new server with &amp;lt;code&amp;gt;slapadd&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open &amp;lt;code&amp;gt;/etc/ldap/schema/ppolicy.ldif&amp;lt;/code&amp;gt; and search for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt;.  You will note that there is a &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry that defines it, and also it&#039;s listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; attributes block of the &amp;lt;code&amp;gt;olcObjectClasses: ...&amp;lt;/code&amp;gt; entry that defines the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class.&lt;br /&gt;
# On the old server, save the output of &amp;lt;code&amp;gt;slapcat -n 0&amp;lt;/code&amp;gt; to a file, open the file, and search for the block where the &amp;lt;code&amp;gt;ppolicy&amp;lt;/code&amp;gt; schema is defined.  It should start with the line &amp;lt;code&amp;gt;dn: cn={4}ppolicy,cn=schema,cn=config&amp;lt;/code&amp;gt; (the &amp;lt;code&amp;gt;{4}&amp;lt;/code&amp;gt; part might contain a different integer, that&#039;s OK).  There, note that the &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt; is missing, and also it&#039;s not listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list of the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class definition.  Copy over the attribute type definition from the &amp;lt;code&amp;gt;ppolicy.ldif&amp;lt;/code&amp;gt; file on the new server, and amend the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Contents of /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in &amp;lt;code&amp;gt;/var/www/&amp;lt;/code&amp;gt; is important; if not provided, it will copy the directory to &amp;lt;code&amp;gt;/var/www/www&amp;lt;/code&amp;gt; on the new server.&lt;br /&gt;
&lt;br /&gt;
=== SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | ssh root@feministwiki.dev /root/bin/sql&lt;br /&gt;
&lt;br /&gt;
You can use the &amp;lt;code&amp;gt;show databases;&amp;lt;/code&amp;gt; command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the &amp;lt;code&amp;gt;--all-databases&amp;lt;/code&amp;gt; option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
=== Emails ===&lt;br /&gt;
&lt;br /&gt;
This is a simple one.  Run this command from the old server:&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /home/vmail/ root@feministwiki.dev:/home/vmail&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/home/vmail/}} is important.&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 tar -czf - archives data lists | ssh root@feministwiki.dev &#039;cd /var/lib/mailman &amp;amp;&amp;amp; tar -xzf - &amp;amp;&amp;amp; check_perms -f&#039;&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing the group ownership of the extracted files.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch.  To do so, run this on the new server:&lt;br /&gt;
&lt;br /&gt;
 /root/bin/sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;&#039;Copying over live data&#039;&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  (For instance, the &amp;lt;code&amp;gt;--delete&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;rsync&amp;lt;/code&amp;gt; command and the &amp;lt;code&amp;gt;--add-drop-database&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;mysqldump&amp;lt;/code&amp;gt; command help to make sure of this.)&lt;br /&gt;
&lt;br /&gt;
So in short, just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;smtp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;xmpp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1170</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1170"/>
		<updated>2021-08-20T12:29:59Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Enable Apache modules, config, and sites */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup&lt;br /&gt;
 apt-get install certbot&lt;br /&gt;
 apt-get install dnsutils&lt;br /&gt;
 apt-get install emacs&lt;br /&gt;
 apt-get install git&lt;br /&gt;
 apt-get install mg&lt;br /&gt;
 apt-get install moreutils&lt;br /&gt;
 apt-get install net-tools&lt;br /&gt;
 apt-get install nmap&lt;br /&gt;
 apt-get install rsync&lt;br /&gt;
 apt-get install software-properties-common&lt;br /&gt;
 apt-get install tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the &amp;lt;code&amp;gt;.ssh/id_rsa&amp;lt;/code&amp;gt; from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in &amp;lt;code&amp;gt;/root/pwd/meta&amp;lt;/code&amp;gt; on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 apt-get install apache2&lt;br /&gt;
 apt-get install dovecot-core&lt;br /&gt;
 apt-get install dovecot-imapd&lt;br /&gt;
 apt-get install dovecot-ldap&lt;br /&gt;
 apt-get install dovecot-pop3d&lt;br /&gt;
 apt-get install ejabberd # good candidate for backports&lt;br /&gt;
 apt-get install fail2ban&lt;br /&gt;
 apt-get install inspircd&lt;br /&gt;
 apt-get install mailman&lt;br /&gt;
 apt-get install mariadb-server&lt;br /&gt;
 apt-get install opendkim&lt;br /&gt;
 apt-get install postfix&lt;br /&gt;
 apt-get install postfix-ldap&lt;br /&gt;
 apt-get install slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in &amp;lt;code&amp;gt;/root/pwd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Install PHP and modules ===&lt;br /&gt;
&lt;br /&gt;
This should really be part of the last section, but due to the sheer number of PHP modules we want to install, it&#039;s in its own section:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install php${php_version}&lt;br /&gt;
 apt-get install php${php_version}-apcu&lt;br /&gt;
 apt-get install php${php_version}-bcmath&lt;br /&gt;
 apt-get install php${php_version}-cli&lt;br /&gt;
 apt-get install php${php_version}-ctype&lt;br /&gt;
 apt-get install php${php_version}-curl&lt;br /&gt;
 apt-get install php${php_version}-gd&lt;br /&gt;
 apt-get install php${php_version}-gmp&lt;br /&gt;
 apt-get install php${php_version}-iconv&lt;br /&gt;
 apt-get install php${php_version}-imagick&lt;br /&gt;
 apt-get install php${php_version}-intl&lt;br /&gt;
 apt-get install php${php_version}-json&lt;br /&gt;
 apt-get install php${php_version}-ldap&lt;br /&gt;
 apt-get install php${php_version}-mbstring&lt;br /&gt;
 apt-get install php${php_version}-mysql&lt;br /&gt;
 apt-get install php${php_version}-opcache&lt;br /&gt;
 apt-get install php${php_version}-readline&lt;br /&gt;
 apt-get install php${php_version}-xml&lt;br /&gt;
 apt-get install php${php_version}-zip&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules, config, and sites ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
 &lt;br /&gt;
 a2enconf 99-feministwiki&lt;br /&gt;
 &lt;br /&gt;
 a2ensite 000-wiki&lt;br /&gt;
 a2ensite account&lt;br /&gt;
 a2ensite blogs&lt;br /&gt;
 a2ensite chat&lt;br /&gt;
 a2ensite files&lt;br /&gt;
 a2ensite forum&lt;br /&gt;
 a2ensite mail&lt;br /&gt;
 a2ensite xmpp&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script makes sure that the cert files are found in &amp;lt;code&amp;gt;/etc/fw-certs&amp;lt;/code&amp;gt; and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes, before shutting down the services on the old server and repeating it to ensure integrity of live data.&lt;br /&gt;
&lt;br /&gt;
Note that although some of the steps described in this section take a long time to finish, they can be done in parallel.&lt;br /&gt;
&lt;br /&gt;
=== LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;There might be incompatible changes between OpenLDAP (aka &amp;lt;code&amp;gt;slapd&amp;lt;/code&amp;gt;) versions which require manual editing of the &amp;lt;code&amp;gt;slapcat&amp;lt;/code&amp;gt; output before it&#039;s read in on the new server with &amp;lt;code&amp;gt;slapadd&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open &amp;lt;code&amp;gt;/etc/ldap/schema/ppolicy.ldif&amp;lt;/code&amp;gt; and search for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt;.  You will note that there is a &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry that defines it, and also it&#039;s listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; attributes block of the &amp;lt;code&amp;gt;olcObjectClasses: ...&amp;lt;/code&amp;gt; entry that defines the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class.&lt;br /&gt;
# On the old server, save the output of &amp;lt;code&amp;gt;slapcat -n 0&amp;lt;/code&amp;gt; to a file, open the file, and search for the block where the &amp;lt;code&amp;gt;ppolicy&amp;lt;/code&amp;gt; schema is defined.  It should start with the line &amp;lt;code&amp;gt;dn: cn={4}ppolicy,cn=schema,cn=config&amp;lt;/code&amp;gt; (the &amp;lt;code&amp;gt;{4}&amp;lt;/code&amp;gt; part might contain a different integer, that&#039;s OK).  There, note that the &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt; is missing, and also it&#039;s not listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list of the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class definition.  Copy over the attribute type definition from the &amp;lt;code&amp;gt;ppolicy.ldif&amp;lt;/code&amp;gt; file on the new server, and amend the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Contents of /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in &amp;lt;code&amp;gt;/var/www/&amp;lt;/code&amp;gt; is important; if not provided, it will copy the directory to &amp;lt;code&amp;gt;/var/www/www&amp;lt;/code&amp;gt; on the new server.&lt;br /&gt;
&lt;br /&gt;
=== SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | ssh root@feministwiki.dev /root/bin/sql&lt;br /&gt;
&lt;br /&gt;
You can use the &amp;lt;code&amp;gt;show databases;&amp;lt;/code&amp;gt; command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the &amp;lt;code&amp;gt;--all-databases&amp;lt;/code&amp;gt; option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
=== Emails ===&lt;br /&gt;
&lt;br /&gt;
This is a simple one.  Run this command from the old server:&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /home/vmail/ root@feministwiki.dev:/home/vmail&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/home/vmail/}} is important.&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 tar -czf - archives data lists | ssh root@feministwiki.dev &#039;cd /var/lib/mailman &amp;amp;&amp;amp; tar -xzf - &amp;amp;&amp;amp; check_perms -f&#039;&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing the group ownership of the extracted files.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch.  To do so, run this on the new server:&lt;br /&gt;
&lt;br /&gt;
 /root/bin/sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;&#039;Copying over live data&#039;&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  (For instance, the &amp;lt;code&amp;gt;--delete&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;rsync&amp;lt;/code&amp;gt; command and the &amp;lt;code&amp;gt;--add-drop-database&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;mysqldump&amp;lt;/code&amp;gt; command help to make sure of this.)&lt;br /&gt;
&lt;br /&gt;
So in short, just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;smtp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;xmpp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1169</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1169"/>
		<updated>2021-08-20T07:59:10Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Install server components */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup&lt;br /&gt;
 apt-get install certbot&lt;br /&gt;
 apt-get install dnsutils&lt;br /&gt;
 apt-get install emacs&lt;br /&gt;
 apt-get install git&lt;br /&gt;
 apt-get install mg&lt;br /&gt;
 apt-get install moreutils&lt;br /&gt;
 apt-get install net-tools&lt;br /&gt;
 apt-get install nmap&lt;br /&gt;
 apt-get install rsync&lt;br /&gt;
 apt-get install software-properties-common&lt;br /&gt;
 apt-get install tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the &amp;lt;code&amp;gt;.ssh/id_rsa&amp;lt;/code&amp;gt; from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in &amp;lt;code&amp;gt;/root/pwd/meta&amp;lt;/code&amp;gt; on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 apt-get install apache2&lt;br /&gt;
 apt-get install dovecot-core&lt;br /&gt;
 apt-get install dovecot-imapd&lt;br /&gt;
 apt-get install dovecot-ldap&lt;br /&gt;
 apt-get install dovecot-pop3d&lt;br /&gt;
 apt-get install ejabberd # good candidate for backports&lt;br /&gt;
 apt-get install fail2ban&lt;br /&gt;
 apt-get install inspircd&lt;br /&gt;
 apt-get install mailman&lt;br /&gt;
 apt-get install mariadb-server&lt;br /&gt;
 apt-get install opendkim&lt;br /&gt;
 apt-get install postfix&lt;br /&gt;
 apt-get install postfix-ldap&lt;br /&gt;
 apt-get install slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in &amp;lt;code&amp;gt;/root/pwd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Install PHP and modules ===&lt;br /&gt;
&lt;br /&gt;
This should really be part of the last section, but due to the sheer number of PHP modules we want to install, it&#039;s in its own section:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install php${php_version}&lt;br /&gt;
 apt-get install php${php_version}-apcu&lt;br /&gt;
 apt-get install php${php_version}-bcmath&lt;br /&gt;
 apt-get install php${php_version}-cli&lt;br /&gt;
 apt-get install php${php_version}-ctype&lt;br /&gt;
 apt-get install php${php_version}-curl&lt;br /&gt;
 apt-get install php${php_version}-gd&lt;br /&gt;
 apt-get install php${php_version}-gmp&lt;br /&gt;
 apt-get install php${php_version}-iconv&lt;br /&gt;
 apt-get install php${php_version}-imagick&lt;br /&gt;
 apt-get install php${php_version}-intl&lt;br /&gt;
 apt-get install php${php_version}-json&lt;br /&gt;
 apt-get install php${php_version}-ldap&lt;br /&gt;
 apt-get install php${php_version}-mbstring&lt;br /&gt;
 apt-get install php${php_version}-mysql&lt;br /&gt;
 apt-get install php${php_version}-opcache&lt;br /&gt;
 apt-get install php${php_version}-readline&lt;br /&gt;
 apt-get install php${php_version}-xml&lt;br /&gt;
 apt-get install php${php_version}-zip&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules, config, and sites ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
 &lt;br /&gt;
 a2enconf 99-feministwiki&lt;br /&gt;
 &lt;br /&gt;
 a2ensite 000-wiki&lt;br /&gt;
 a2ensite blogs&lt;br /&gt;
 a2ensite chat&lt;br /&gt;
 a2ensite files&lt;br /&gt;
 a2ensite forum&lt;br /&gt;
 a2ensite mail&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script makes sure that the cert files are found in &amp;lt;code&amp;gt;/etc/fw-certs&amp;lt;/code&amp;gt; and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes, before shutting down the services on the old server and repeating it to ensure integrity of live data.&lt;br /&gt;
&lt;br /&gt;
Note that although some of the steps described in this section take a long time to finish, they can be done in parallel.&lt;br /&gt;
&lt;br /&gt;
=== LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;There might be incompatible changes between OpenLDAP (aka &amp;lt;code&amp;gt;slapd&amp;lt;/code&amp;gt;) versions which require manual editing of the &amp;lt;code&amp;gt;slapcat&amp;lt;/code&amp;gt; output before it&#039;s read in on the new server with &amp;lt;code&amp;gt;slapadd&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open &amp;lt;code&amp;gt;/etc/ldap/schema/ppolicy.ldif&amp;lt;/code&amp;gt; and search for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt;.  You will note that there is a &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry that defines it, and also it&#039;s listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; attributes block of the &amp;lt;code&amp;gt;olcObjectClasses: ...&amp;lt;/code&amp;gt; entry that defines the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class.&lt;br /&gt;
# On the old server, save the output of &amp;lt;code&amp;gt;slapcat -n 0&amp;lt;/code&amp;gt; to a file, open the file, and search for the block where the &amp;lt;code&amp;gt;ppolicy&amp;lt;/code&amp;gt; schema is defined.  It should start with the line &amp;lt;code&amp;gt;dn: cn={4}ppolicy,cn=schema,cn=config&amp;lt;/code&amp;gt; (the &amp;lt;code&amp;gt;{4}&amp;lt;/code&amp;gt; part might contain a different integer, that&#039;s OK).  There, note that the &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt; is missing, and also it&#039;s not listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list of the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class definition.  Copy over the attribute type definition from the &amp;lt;code&amp;gt;ppolicy.ldif&amp;lt;/code&amp;gt; file on the new server, and amend the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Contents of /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in &amp;lt;code&amp;gt;/var/www/&amp;lt;/code&amp;gt; is important; if not provided, it will copy the directory to &amp;lt;code&amp;gt;/var/www/www&amp;lt;/code&amp;gt; on the new server.&lt;br /&gt;
&lt;br /&gt;
=== SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | ssh root@feministwiki.dev /root/bin/sql&lt;br /&gt;
&lt;br /&gt;
You can use the &amp;lt;code&amp;gt;show databases;&amp;lt;/code&amp;gt; command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the &amp;lt;code&amp;gt;--all-databases&amp;lt;/code&amp;gt; option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
=== Emails ===&lt;br /&gt;
&lt;br /&gt;
This is a simple one.  Run this command from the old server:&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /home/vmail/ root@feministwiki.dev:/home/vmail&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/home/vmail/}} is important.&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 tar -czf - archives data lists | ssh root@feministwiki.dev &#039;cd /var/lib/mailman &amp;amp;&amp;amp; tar -xzf - &amp;amp;&amp;amp; check_perms -f&#039;&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing the group ownership of the extracted files.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch.  To do so, run this on the new server:&lt;br /&gt;
&lt;br /&gt;
 /root/bin/sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;&#039;Copying over live data&#039;&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  (For instance, the &amp;lt;code&amp;gt;--delete&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;rsync&amp;lt;/code&amp;gt; command and the &amp;lt;code&amp;gt;--add-drop-database&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;mysqldump&amp;lt;/code&amp;gt; command help to make sure of this.)&lt;br /&gt;
&lt;br /&gt;
So in short, just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;smtp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;xmpp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1168</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1168"/>
		<updated>2021-08-20T07:47:01Z</updated>

		<summary type="html">&lt;p&gt;Technician : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup&lt;br /&gt;
 apt-get install certbot&lt;br /&gt;
 apt-get install dnsutils&lt;br /&gt;
 apt-get install emacs&lt;br /&gt;
 apt-get install git&lt;br /&gt;
 apt-get install mg&lt;br /&gt;
 apt-get install moreutils&lt;br /&gt;
 apt-get install net-tools&lt;br /&gt;
 apt-get install nmap&lt;br /&gt;
 apt-get install rsync&lt;br /&gt;
 apt-get install software-properties-common&lt;br /&gt;
 apt-get install tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the &amp;lt;code&amp;gt;.ssh/id_rsa&amp;lt;/code&amp;gt; from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in &amp;lt;code&amp;gt;/root/pwd/meta&amp;lt;/code&amp;gt; on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 apt-get install apache2&lt;br /&gt;
 apt-get install dovecot-core&lt;br /&gt;
 apt-get install dovecot-imapd&lt;br /&gt;
 apt-get install dovecot-ldap&lt;br /&gt;
 apt-get install dovecot-pop3d&lt;br /&gt;
 apt-get install ejabberd # good candidate for backports&lt;br /&gt;
 apt-get install fail2ban&lt;br /&gt;
 apt-get install inspircd&lt;br /&gt;
 apt-get install mailman&lt;br /&gt;
 apt-get install mariadb-server&lt;br /&gt;
 apt-get install opendkim&lt;br /&gt;
 apt-get install postfix&lt;br /&gt;
 apt-get install slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in &amp;lt;code&amp;gt;/root/pwd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Install PHP and modules ===&lt;br /&gt;
&lt;br /&gt;
This should really be part of the last section, but due to the sheer number of PHP modules we want to install, it&#039;s in its own section:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install php${php_version}&lt;br /&gt;
 apt-get install php${php_version}-apcu&lt;br /&gt;
 apt-get install php${php_version}-bcmath&lt;br /&gt;
 apt-get install php${php_version}-cli&lt;br /&gt;
 apt-get install php${php_version}-ctype&lt;br /&gt;
 apt-get install php${php_version}-curl&lt;br /&gt;
 apt-get install php${php_version}-gd&lt;br /&gt;
 apt-get install php${php_version}-gmp&lt;br /&gt;
 apt-get install php${php_version}-iconv&lt;br /&gt;
 apt-get install php${php_version}-imagick&lt;br /&gt;
 apt-get install php${php_version}-intl&lt;br /&gt;
 apt-get install php${php_version}-json&lt;br /&gt;
 apt-get install php${php_version}-ldap&lt;br /&gt;
 apt-get install php${php_version}-mbstring&lt;br /&gt;
 apt-get install php${php_version}-mysql&lt;br /&gt;
 apt-get install php${php_version}-opcache&lt;br /&gt;
 apt-get install php${php_version}-readline&lt;br /&gt;
 apt-get install php${php_version}-xml&lt;br /&gt;
 apt-get install php${php_version}-zip&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules, config, and sites ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
 &lt;br /&gt;
 a2enconf 99-feministwiki&lt;br /&gt;
 &lt;br /&gt;
 a2ensite 000-wiki&lt;br /&gt;
 a2ensite blogs&lt;br /&gt;
 a2ensite chat&lt;br /&gt;
 a2ensite files&lt;br /&gt;
 a2ensite forum&lt;br /&gt;
 a2ensite mail&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script makes sure that the cert files are found in &amp;lt;code&amp;gt;/etc/fw-certs&amp;lt;/code&amp;gt; and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes, before shutting down the services on the old server and repeating it to ensure integrity of live data.&lt;br /&gt;
&lt;br /&gt;
Note that although some of the steps described in this section take a long time to finish, they can be done in parallel.&lt;br /&gt;
&lt;br /&gt;
=== LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;There might be incompatible changes between OpenLDAP (aka &amp;lt;code&amp;gt;slapd&amp;lt;/code&amp;gt;) versions which require manual editing of the &amp;lt;code&amp;gt;slapcat&amp;lt;/code&amp;gt; output before it&#039;s read in on the new server with &amp;lt;code&amp;gt;slapadd&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open &amp;lt;code&amp;gt;/etc/ldap/schema/ppolicy.ldif&amp;lt;/code&amp;gt; and search for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt;.  You will note that there is a &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry that defines it, and also it&#039;s listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; attributes block of the &amp;lt;code&amp;gt;olcObjectClasses: ...&amp;lt;/code&amp;gt; entry that defines the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class.&lt;br /&gt;
# On the old server, save the output of &amp;lt;code&amp;gt;slapcat -n 0&amp;lt;/code&amp;gt; to a file, open the file, and search for the block where the &amp;lt;code&amp;gt;ppolicy&amp;lt;/code&amp;gt; schema is defined.  It should start with the line &amp;lt;code&amp;gt;dn: cn={4}ppolicy,cn=schema,cn=config&amp;lt;/code&amp;gt; (the &amp;lt;code&amp;gt;{4}&amp;lt;/code&amp;gt; part might contain a different integer, that&#039;s OK).  There, note that the &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt; is missing, and also it&#039;s not listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list of the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class definition.  Copy over the attribute type definition from the &amp;lt;code&amp;gt;ppolicy.ldif&amp;lt;/code&amp;gt; file on the new server, and amend the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Contents of /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in &amp;lt;code&amp;gt;/var/www/&amp;lt;/code&amp;gt; is important; if not provided, it will copy the directory to &amp;lt;code&amp;gt;/var/www/www&amp;lt;/code&amp;gt; on the new server.&lt;br /&gt;
&lt;br /&gt;
=== SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | ssh root@feministwiki.dev /root/bin/sql&lt;br /&gt;
&lt;br /&gt;
You can use the &amp;lt;code&amp;gt;show databases;&amp;lt;/code&amp;gt; command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the &amp;lt;code&amp;gt;--all-databases&amp;lt;/code&amp;gt; option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
=== Emails ===&lt;br /&gt;
&lt;br /&gt;
This is a simple one.  Run this command from the old server:&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /home/vmail/ root@feministwiki.dev:/home/vmail&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/home/vmail/}} is important.&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 tar -czf - archives data lists | ssh root@feministwiki.dev &#039;cd /var/lib/mailman &amp;amp;&amp;amp; tar -xzf - &amp;amp;&amp;amp; check_perms -f&#039;&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing the group ownership of the extracted files.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch.  To do so, run this on the new server:&lt;br /&gt;
&lt;br /&gt;
 /root/bin/sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;&#039;Copying over live data&#039;&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  (For instance, the &amp;lt;code&amp;gt;--delete&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;rsync&amp;lt;/code&amp;gt; command and the &amp;lt;code&amp;gt;--add-drop-database&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;mysqldump&amp;lt;/code&amp;gt; command help to make sure of this.)&lt;br /&gt;
&lt;br /&gt;
So in short, just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;smtp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;xmpp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1167</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1167"/>
		<updated>2021-08-20T03:09:42Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Emails */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;!!! WORK IN PROGRESS !!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup&lt;br /&gt;
 apt-get install certbot&lt;br /&gt;
 apt-get install dnsutils&lt;br /&gt;
 apt-get install emacs&lt;br /&gt;
 apt-get install git&lt;br /&gt;
 apt-get install mg&lt;br /&gt;
 apt-get install moreutils&lt;br /&gt;
 apt-get install net-tools&lt;br /&gt;
 apt-get install nmap&lt;br /&gt;
 apt-get install rsync&lt;br /&gt;
 apt-get install software-properties-common&lt;br /&gt;
 apt-get install tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the &amp;lt;code&amp;gt;.ssh/id_rsa&amp;lt;/code&amp;gt; from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in &amp;lt;code&amp;gt;/root/pwd/meta&amp;lt;/code&amp;gt; on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 apt-get install apache2&lt;br /&gt;
 apt-get install dovecot-core&lt;br /&gt;
 apt-get install dovecot-imapd&lt;br /&gt;
 apt-get install dovecot-ldap&lt;br /&gt;
 apt-get install dovecot-pop3d&lt;br /&gt;
 apt-get install ejabberd # good candidate for backports&lt;br /&gt;
 apt-get install fail2ban&lt;br /&gt;
 apt-get install inspircd&lt;br /&gt;
 apt-get install mailman&lt;br /&gt;
 apt-get install mariadb-server&lt;br /&gt;
 apt-get install opendkim&lt;br /&gt;
 apt-get install postfix&lt;br /&gt;
 apt-get install slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in &amp;lt;code&amp;gt;/root/pwd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Install PHP and modules ===&lt;br /&gt;
&lt;br /&gt;
This should really be part of the last section, but due to the sheer number of PHP modules we want to install, it&#039;s in its own section:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install php${php_version}&lt;br /&gt;
 apt-get install php${php_version}-apcu&lt;br /&gt;
 apt-get install php${php_version}-bcmath&lt;br /&gt;
 apt-get install php${php_version}-cli&lt;br /&gt;
 apt-get install php${php_version}-ctype&lt;br /&gt;
 apt-get install php${php_version}-curl&lt;br /&gt;
 apt-get install php${php_version}-gd&lt;br /&gt;
 apt-get install php${php_version}-gmp&lt;br /&gt;
 apt-get install php${php_version}-iconv&lt;br /&gt;
 apt-get install php${php_version}-imagick&lt;br /&gt;
 apt-get install php${php_version}-intl&lt;br /&gt;
 apt-get install php${php_version}-json&lt;br /&gt;
 apt-get install php${php_version}-ldap&lt;br /&gt;
 apt-get install php${php_version}-mbstring&lt;br /&gt;
 apt-get install php${php_version}-mysql&lt;br /&gt;
 apt-get install php${php_version}-opcache&lt;br /&gt;
 apt-get install php${php_version}-readline&lt;br /&gt;
 apt-get install php${php_version}-xml&lt;br /&gt;
 apt-get install php${php_version}-zip&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules, config, and sites ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
 &lt;br /&gt;
 a2enconf 99-feministwiki&lt;br /&gt;
 &lt;br /&gt;
 a2ensite 000-wiki&lt;br /&gt;
 a2ensite blogs&lt;br /&gt;
 a2ensite chat&lt;br /&gt;
 a2ensite files&lt;br /&gt;
 a2ensite forum&lt;br /&gt;
 a2ensite mail&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script makes sure that the cert files are found in &amp;lt;code&amp;gt;/etc/fw-certs&amp;lt;/code&amp;gt; and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes, before shutting down the services on the old server and repeating it to ensure integrity of live data.&lt;br /&gt;
&lt;br /&gt;
Note that although some of the steps described in this section take a long time to finish, they can be done in parallel.&lt;br /&gt;
&lt;br /&gt;
=== LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;There might be incompatible changes between OpenLDAP (aka &amp;lt;code&amp;gt;slapd&amp;lt;/code&amp;gt;) versions which require manual editing of the &amp;lt;code&amp;gt;slapcat&amp;lt;/code&amp;gt; output before it&#039;s read in on the new server with &amp;lt;code&amp;gt;slapadd&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open &amp;lt;code&amp;gt;/etc/ldap/schema/ppolicy.ldif&amp;lt;/code&amp;gt; and search for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt;.  You will note that there is a &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry that defines it, and also it&#039;s listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; attributes block of the &amp;lt;code&amp;gt;olcObjectClasses: ...&amp;lt;/code&amp;gt; entry that defines the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class.&lt;br /&gt;
# On the old server, save the output of &amp;lt;code&amp;gt;slapcat -n 0&amp;lt;/code&amp;gt; to a file, open the file, and search for the block where the &amp;lt;code&amp;gt;ppolicy&amp;lt;/code&amp;gt; schema is defined.  It should start with the line &amp;lt;code&amp;gt;dn: cn={4}ppolicy,cn=schema,cn=config&amp;lt;/code&amp;gt; (the &amp;lt;code&amp;gt;{4}&amp;lt;/code&amp;gt; part might contain a different integer, that&#039;s OK).  There, note that the &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt; is missing, and also it&#039;s not listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list of the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class definition.  Copy over the attribute type definition from the &amp;lt;code&amp;gt;ppolicy.ldif&amp;lt;/code&amp;gt; file on the new server, and amend the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Contents of /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in &amp;lt;code&amp;gt;/var/www/&amp;lt;/code&amp;gt; is important; if not provided, it will copy the directory to &amp;lt;code&amp;gt;/var/www/www&amp;lt;/code&amp;gt; on the new server.&lt;br /&gt;
&lt;br /&gt;
=== SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | ssh root@feministwiki.dev /root/bin/sql&lt;br /&gt;
&lt;br /&gt;
You can use the &amp;lt;code&amp;gt;show databases;&amp;lt;/code&amp;gt; command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the &amp;lt;code&amp;gt;--all-databases&amp;lt;/code&amp;gt; option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
=== Emails ===&lt;br /&gt;
&lt;br /&gt;
This is a simple one.  Run this command from the old server:&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /home/vmail/ root@feministwiki.dev:/home/vmail&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/home/vmail/}} is important.&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 tar -czf - archives data lists | ssh root@feministwiki.dev &#039;cd /var/lib/mailman &amp;amp;&amp;amp; tar -xzf - &amp;amp;&amp;amp; check_perms -f&#039;&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing the group ownership of the extracted files.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch.  To do so, run this on the new server:&lt;br /&gt;
&lt;br /&gt;
 /root/bin/sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;&#039;Copying over live data&#039;&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  (For instance, the &amp;lt;code&amp;gt;--delete&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;rsync&amp;lt;/code&amp;gt; command and the &amp;lt;code&amp;gt;--add-drop-database&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;mysqldump&amp;lt;/code&amp;gt; command help to make sure of this.)&lt;br /&gt;
&lt;br /&gt;
So in short, just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;smtp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;xmpp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1166</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1166"/>
		<updated>2021-08-20T03:09:29Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Copying over live data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;!!! WORK IN PROGRESS !!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup&lt;br /&gt;
 apt-get install certbot&lt;br /&gt;
 apt-get install dnsutils&lt;br /&gt;
 apt-get install emacs&lt;br /&gt;
 apt-get install git&lt;br /&gt;
 apt-get install mg&lt;br /&gt;
 apt-get install moreutils&lt;br /&gt;
 apt-get install net-tools&lt;br /&gt;
 apt-get install nmap&lt;br /&gt;
 apt-get install rsync&lt;br /&gt;
 apt-get install software-properties-common&lt;br /&gt;
 apt-get install tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the &amp;lt;code&amp;gt;.ssh/id_rsa&amp;lt;/code&amp;gt; from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in &amp;lt;code&amp;gt;/root/pwd/meta&amp;lt;/code&amp;gt; on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 apt-get install apache2&lt;br /&gt;
 apt-get install dovecot-core&lt;br /&gt;
 apt-get install dovecot-imapd&lt;br /&gt;
 apt-get install dovecot-ldap&lt;br /&gt;
 apt-get install dovecot-pop3d&lt;br /&gt;
 apt-get install ejabberd # good candidate for backports&lt;br /&gt;
 apt-get install fail2ban&lt;br /&gt;
 apt-get install inspircd&lt;br /&gt;
 apt-get install mailman&lt;br /&gt;
 apt-get install mariadb-server&lt;br /&gt;
 apt-get install opendkim&lt;br /&gt;
 apt-get install postfix&lt;br /&gt;
 apt-get install slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in &amp;lt;code&amp;gt;/root/pwd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Install PHP and modules ===&lt;br /&gt;
&lt;br /&gt;
This should really be part of the last section, but due to the sheer number of PHP modules we want to install, it&#039;s in its own section:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install php${php_version}&lt;br /&gt;
 apt-get install php${php_version}-apcu&lt;br /&gt;
 apt-get install php${php_version}-bcmath&lt;br /&gt;
 apt-get install php${php_version}-cli&lt;br /&gt;
 apt-get install php${php_version}-ctype&lt;br /&gt;
 apt-get install php${php_version}-curl&lt;br /&gt;
 apt-get install php${php_version}-gd&lt;br /&gt;
 apt-get install php${php_version}-gmp&lt;br /&gt;
 apt-get install php${php_version}-iconv&lt;br /&gt;
 apt-get install php${php_version}-imagick&lt;br /&gt;
 apt-get install php${php_version}-intl&lt;br /&gt;
 apt-get install php${php_version}-json&lt;br /&gt;
 apt-get install php${php_version}-ldap&lt;br /&gt;
 apt-get install php${php_version}-mbstring&lt;br /&gt;
 apt-get install php${php_version}-mysql&lt;br /&gt;
 apt-get install php${php_version}-opcache&lt;br /&gt;
 apt-get install php${php_version}-readline&lt;br /&gt;
 apt-get install php${php_version}-xml&lt;br /&gt;
 apt-get install php${php_version}-zip&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules, config, and sites ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
 &lt;br /&gt;
 a2enconf 99-feministwiki&lt;br /&gt;
 &lt;br /&gt;
 a2ensite 000-wiki&lt;br /&gt;
 a2ensite blogs&lt;br /&gt;
 a2ensite chat&lt;br /&gt;
 a2ensite files&lt;br /&gt;
 a2ensite forum&lt;br /&gt;
 a2ensite mail&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script makes sure that the cert files are found in &amp;lt;code&amp;gt;/etc/fw-certs&amp;lt;/code&amp;gt; and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes, before shutting down the services on the old server and repeating it to ensure integrity of live data.&lt;br /&gt;
&lt;br /&gt;
Note that although some of the steps described in this section take a long time to finish, they can be done in parallel.&lt;br /&gt;
&lt;br /&gt;
=== LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;There might be incompatible changes between OpenLDAP (aka &amp;lt;code&amp;gt;slapd&amp;lt;/code&amp;gt;) versions which require manual editing of the &amp;lt;code&amp;gt;slapcat&amp;lt;/code&amp;gt; output before it&#039;s read in on the new server with &amp;lt;code&amp;gt;slapadd&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open &amp;lt;code&amp;gt;/etc/ldap/schema/ppolicy.ldif&amp;lt;/code&amp;gt; and search for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt;.  You will note that there is a &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry that defines it, and also it&#039;s listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; attributes block of the &amp;lt;code&amp;gt;olcObjectClasses: ...&amp;lt;/code&amp;gt; entry that defines the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class.&lt;br /&gt;
# On the old server, save the output of &amp;lt;code&amp;gt;slapcat -n 0&amp;lt;/code&amp;gt; to a file, open the file, and search for the block where the &amp;lt;code&amp;gt;ppolicy&amp;lt;/code&amp;gt; schema is defined.  It should start with the line &amp;lt;code&amp;gt;dn: cn={4}ppolicy,cn=schema,cn=config&amp;lt;/code&amp;gt; (the &amp;lt;code&amp;gt;{4}&amp;lt;/code&amp;gt; part might contain a different integer, that&#039;s OK).  There, note that the &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt; is missing, and also it&#039;s not listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list of the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class definition.  Copy over the attribute type definition from the &amp;lt;code&amp;gt;ppolicy.ldif&amp;lt;/code&amp;gt; file on the new server, and amend the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Contents of /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in &amp;lt;code&amp;gt;/var/www/&amp;lt;/code&amp;gt; is important; if not provided, it will copy the directory to &amp;lt;code&amp;gt;/var/www/www&amp;lt;/code&amp;gt; on the new server.&lt;br /&gt;
&lt;br /&gt;
=== SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | ssh root@feministwiki.dev /root/bin/sql&lt;br /&gt;
&lt;br /&gt;
You can use the &amp;lt;code&amp;gt;show databases;&amp;lt;/code&amp;gt; command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the &amp;lt;code&amp;gt;--all-databases&amp;lt;/code&amp;gt; option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
=== Emails ===&lt;br /&gt;
&lt;br /&gt;
This is a simple one.  Run this command from the old server:&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /home/vmail/ root@feministwiki.dev:/home/vmail&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in {{C|/var/www/}} is important.&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 tar -czf - archives data lists | ssh root@feministwiki.dev &#039;cd /var/lib/mailman &amp;amp;&amp;amp; tar -xzf - &amp;amp;&amp;amp; check_perms -f&#039;&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing the group ownership of the extracted files.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch.  To do so, run this on the new server:&lt;br /&gt;
&lt;br /&gt;
 /root/bin/sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;&#039;Copying over live data&#039;&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  (For instance, the &amp;lt;code&amp;gt;--delete&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;rsync&amp;lt;/code&amp;gt; command and the &amp;lt;code&amp;gt;--add-drop-database&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;mysqldump&amp;lt;/code&amp;gt; command help to make sure of this.)&lt;br /&gt;
&lt;br /&gt;
So in short, just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;smtp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;xmpp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1165</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1165"/>
		<updated>2021-08-20T03:00:12Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Initial setup of the new server */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;!!! WORK IN PROGRESS !!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup&lt;br /&gt;
 apt-get install certbot&lt;br /&gt;
 apt-get install dnsutils&lt;br /&gt;
 apt-get install emacs&lt;br /&gt;
 apt-get install git&lt;br /&gt;
 apt-get install mg&lt;br /&gt;
 apt-get install moreutils&lt;br /&gt;
 apt-get install net-tools&lt;br /&gt;
 apt-get install nmap&lt;br /&gt;
 apt-get install rsync&lt;br /&gt;
 apt-get install software-properties-common&lt;br /&gt;
 apt-get install tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the &amp;lt;code&amp;gt;.ssh/id_rsa&amp;lt;/code&amp;gt; from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in &amp;lt;code&amp;gt;/root/pwd/meta&amp;lt;/code&amp;gt; on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 apt-get install apache2&lt;br /&gt;
 apt-get install dovecot-core&lt;br /&gt;
 apt-get install dovecot-imapd&lt;br /&gt;
 apt-get install dovecot-ldap&lt;br /&gt;
 apt-get install dovecot-pop3d&lt;br /&gt;
 apt-get install ejabberd # good candidate for backports&lt;br /&gt;
 apt-get install fail2ban&lt;br /&gt;
 apt-get install inspircd&lt;br /&gt;
 apt-get install mailman&lt;br /&gt;
 apt-get install mariadb-server&lt;br /&gt;
 apt-get install opendkim&lt;br /&gt;
 apt-get install postfix&lt;br /&gt;
 apt-get install slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in &amp;lt;code&amp;gt;/root/pwd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Install PHP and modules ===&lt;br /&gt;
&lt;br /&gt;
This should really be part of the last section, but due to the sheer number of PHP modules we want to install, it&#039;s in its own section:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install php${php_version}&lt;br /&gt;
 apt-get install php${php_version}-apcu&lt;br /&gt;
 apt-get install php${php_version}-bcmath&lt;br /&gt;
 apt-get install php${php_version}-cli&lt;br /&gt;
 apt-get install php${php_version}-ctype&lt;br /&gt;
 apt-get install php${php_version}-curl&lt;br /&gt;
 apt-get install php${php_version}-gd&lt;br /&gt;
 apt-get install php${php_version}-gmp&lt;br /&gt;
 apt-get install php${php_version}-iconv&lt;br /&gt;
 apt-get install php${php_version}-imagick&lt;br /&gt;
 apt-get install php${php_version}-intl&lt;br /&gt;
 apt-get install php${php_version}-json&lt;br /&gt;
 apt-get install php${php_version}-ldap&lt;br /&gt;
 apt-get install php${php_version}-mbstring&lt;br /&gt;
 apt-get install php${php_version}-mysql&lt;br /&gt;
 apt-get install php${php_version}-opcache&lt;br /&gt;
 apt-get install php${php_version}-readline&lt;br /&gt;
 apt-get install php${php_version}-xml&lt;br /&gt;
 apt-get install php${php_version}-zip&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules, config, and sites ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
 &lt;br /&gt;
 a2enconf 99-feministwiki&lt;br /&gt;
 &lt;br /&gt;
 a2ensite 000-wiki&lt;br /&gt;
 a2ensite blogs&lt;br /&gt;
 a2ensite chat&lt;br /&gt;
 a2ensite files&lt;br /&gt;
 a2ensite forum&lt;br /&gt;
 a2ensite mail&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script makes sure that the cert files are found in &amp;lt;code&amp;gt;/etc/fw-certs&amp;lt;/code&amp;gt; and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes, before shutting down the services on the old server and repeating it to ensure integrity of live data.&lt;br /&gt;
&lt;br /&gt;
Note that although some of the steps described in this section take a long time to finish, they can be done in parallel.&lt;br /&gt;
&lt;br /&gt;
=== LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;There might be incompatible changes between OpenLDAP (aka &amp;lt;code&amp;gt;slapd&amp;lt;/code&amp;gt;) versions which require manual editing of the &amp;lt;code&amp;gt;slapcat&amp;lt;/code&amp;gt; output before it&#039;s read in on the new server with &amp;lt;code&amp;gt;slapadd&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open &amp;lt;code&amp;gt;/etc/ldap/schema/ppolicy.ldif&amp;lt;/code&amp;gt; and search for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt;.  You will note that there is a &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry that defines it, and also it&#039;s listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; attributes block of the &amp;lt;code&amp;gt;olcObjectClasses: ...&amp;lt;/code&amp;gt; entry that defines the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class.&lt;br /&gt;
# On the old server, save the output of &amp;lt;code&amp;gt;slapcat -n 0&amp;lt;/code&amp;gt; to a file, open the file, and search for the block where the &amp;lt;code&amp;gt;ppolicy&amp;lt;/code&amp;gt; schema is defined.  It should start with the line &amp;lt;code&amp;gt;dn: cn={4}ppolicy,cn=schema,cn=config&amp;lt;/code&amp;gt; (the &amp;lt;code&amp;gt;{4}&amp;lt;/code&amp;gt; part might contain a different integer, that&#039;s OK).  There, note that the &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt; is missing, and also it&#039;s not listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list of the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class definition.  Copy over the attribute type definition from the &amp;lt;code&amp;gt;ppolicy.ldif&amp;lt;/code&amp;gt; file on the new server, and amend the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Contents of /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in &amp;lt;code&amp;gt;/var/www/&amp;lt;/code&amp;gt; is important; if not provided, it will copy the directory to &amp;lt;code&amp;gt;/var/www/www&amp;lt;/code&amp;gt; on the new server.&lt;br /&gt;
&lt;br /&gt;
=== SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | ssh root@feministwiki.dev /root/bin/sql&lt;br /&gt;
&lt;br /&gt;
You can use the &amp;lt;code&amp;gt;show databases;&amp;lt;/code&amp;gt; command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the &amp;lt;code&amp;gt;--all-databases&amp;lt;/code&amp;gt; option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
=== Emails ===&lt;br /&gt;
&lt;br /&gt;
This is a simple one.  Run this command from the old server:&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /home/vmail/ root@feministwiki.dev:/home/vmail&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 tar -czf - archives data lists | ssh root@feministwiki.dev &#039;cd /var/lib/mailman &amp;amp;&amp;amp; tar -xzf - &amp;amp;&amp;amp; check_perms -f&#039;&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing the group ownership of the extracted files.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch.  To do so, run this on the new server:&lt;br /&gt;
&lt;br /&gt;
 /root/bin/sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;&#039;Copying over live data&#039;&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  (For instance, the &amp;lt;code&amp;gt;--delete&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;rsync&amp;lt;/code&amp;gt; command and the &amp;lt;code&amp;gt;--add-drop-database&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;mysqldump&amp;lt;/code&amp;gt; command help to make sure of this.)&lt;br /&gt;
&lt;br /&gt;
So in short, just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;smtp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;xmpp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1164</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1164"/>
		<updated>2021-08-20T02:58:20Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Enable Apache modules */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;!!! WORK IN PROGRESS !!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup&lt;br /&gt;
 apt-get install certbot&lt;br /&gt;
 apt-get install dnsutils&lt;br /&gt;
 apt-get install emacs&lt;br /&gt;
 apt-get install git&lt;br /&gt;
 apt-get install mg&lt;br /&gt;
 apt-get install moreutils&lt;br /&gt;
 apt-get install net-tools&lt;br /&gt;
 apt-get install nmap&lt;br /&gt;
 apt-get install rsync&lt;br /&gt;
 apt-get install software-properties-common&lt;br /&gt;
 apt-get install tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the &amp;lt;code&amp;gt;.ssh/id_rsa&amp;lt;/code&amp;gt; from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in &amp;lt;code&amp;gt;/root/pwd/meta&amp;lt;/code&amp;gt; on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 apt-get install apache2&lt;br /&gt;
 apt-get install dovecot-core&lt;br /&gt;
 apt-get install dovecot-imapd&lt;br /&gt;
 apt-get install dovecot-ldap&lt;br /&gt;
 apt-get install dovecot-pop3d&lt;br /&gt;
 apt-get install ejabberd # good candidate for backports&lt;br /&gt;
 apt-get install fail2ban&lt;br /&gt;
 apt-get install inspircd&lt;br /&gt;
 apt-get install mailman&lt;br /&gt;
 apt-get install mariadb-server&lt;br /&gt;
 apt-get install opendkim&lt;br /&gt;
 apt-get install postfix&lt;br /&gt;
 apt-get install slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in &amp;lt;code&amp;gt;/root/pwd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Install PHP and modules ===&lt;br /&gt;
&lt;br /&gt;
This should really be part of the last section, but due to the sheer number of PHP modules we want to install, it&#039;s in its own section:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install php${php_version}&lt;br /&gt;
 apt-get install php${php_version}-apcu&lt;br /&gt;
 apt-get install php${php_version}-bcmath&lt;br /&gt;
 apt-get install php${php_version}-cli&lt;br /&gt;
 apt-get install php${php_version}-ctype&lt;br /&gt;
 apt-get install php${php_version}-curl&lt;br /&gt;
 apt-get install php${php_version}-gd&lt;br /&gt;
 apt-get install php${php_version}-gmp&lt;br /&gt;
 apt-get install php${php_version}-iconv&lt;br /&gt;
 apt-get install php${php_version}-imagick&lt;br /&gt;
 apt-get install php${php_version}-intl&lt;br /&gt;
 apt-get install php${php_version}-json&lt;br /&gt;
 apt-get install php${php_version}-ldap&lt;br /&gt;
 apt-get install php${php_version}-mbstring&lt;br /&gt;
 apt-get install php${php_version}-mysql&lt;br /&gt;
 apt-get install php${php_version}-opcache&lt;br /&gt;
 apt-get install php${php_version}-readline&lt;br /&gt;
 apt-get install php${php_version}-xml&lt;br /&gt;
 apt-get install php${php_version}-zip&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules, config, and sites ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
 &lt;br /&gt;
 a2enconf 99-feministwiki&lt;br /&gt;
 &lt;br /&gt;
 a2ensite 000-wiki&lt;br /&gt;
 a2ensite blogs&lt;br /&gt;
 a2ensite chat&lt;br /&gt;
 a2ensite files&lt;br /&gt;
 a2ensite forum&lt;br /&gt;
 a2ensite mail&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script makes sure that the cert files are found in &amp;lt;code&amp;gt;/etc/fw-certs&amp;lt;/code&amp;gt; and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes, before shutting down the services on the old server and repeating it to ensure integrity of live data.&lt;br /&gt;
&lt;br /&gt;
Note that although some of the steps described in this section take a long time to finish, they can be done in parallel.&lt;br /&gt;
&lt;br /&gt;
=== LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;There might be incompatible changes between OpenLDAP (aka &amp;lt;code&amp;gt;slapd&amp;lt;/code&amp;gt;) versions which require manual editing of the &amp;lt;code&amp;gt;slapcat&amp;lt;/code&amp;gt; output before it&#039;s read in on the new server with &amp;lt;code&amp;gt;slapadd&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open &amp;lt;code&amp;gt;/etc/ldap/schema/ppolicy.ldif&amp;lt;/code&amp;gt; and search for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt;.  You will note that there is a &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry that defines it, and also it&#039;s listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; attributes block of the &amp;lt;code&amp;gt;olcObjectClasses: ...&amp;lt;/code&amp;gt; entry that defines the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class.&lt;br /&gt;
# On the old server, save the output of &amp;lt;code&amp;gt;slapcat -n 0&amp;lt;/code&amp;gt; to a file, open the file, and search for the block where the &amp;lt;code&amp;gt;ppolicy&amp;lt;/code&amp;gt; schema is defined.  It should start with the line &amp;lt;code&amp;gt;dn: cn={4}ppolicy,cn=schema,cn=config&amp;lt;/code&amp;gt; (the &amp;lt;code&amp;gt;{4}&amp;lt;/code&amp;gt; part might contain a different integer, that&#039;s OK).  There, note that the &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt; is missing, and also it&#039;s not listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list of the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class definition.  Copy over the attribute type definition from the &amp;lt;code&amp;gt;ppolicy.ldif&amp;lt;/code&amp;gt; file on the new server, and amend the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Contents of /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in &amp;lt;code&amp;gt;/var/www/&amp;lt;/code&amp;gt; is important; if not provided, it will copy the directory to &amp;lt;code&amp;gt;/var/www/www&amp;lt;/code&amp;gt; on the new server.&lt;br /&gt;
&lt;br /&gt;
=== SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | ssh root@feministwiki.dev /root/bin/sql&lt;br /&gt;
&lt;br /&gt;
You can use the &amp;lt;code&amp;gt;show databases;&amp;lt;/code&amp;gt; command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the &amp;lt;code&amp;gt;--all-databases&amp;lt;/code&amp;gt; option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
=== Emails ===&lt;br /&gt;
&lt;br /&gt;
This is a simple one.  Run this command from the old server:&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /home/vmail/ root@feministwiki.dev:/home/vmail&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 tar -czf - archives data lists | ssh root@feministwiki.dev &#039;cd /var/lib/mailman &amp;amp;&amp;amp; tar -xzf - &amp;amp;&amp;amp; check_perms -f&#039;&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing the group ownership of the extracted files.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch.  To do so, run this on the new server:&lt;br /&gt;
&lt;br /&gt;
 /root/bin/sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;&#039;Copying over live data&#039;&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  (For instance, the &amp;lt;code&amp;gt;--delete&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;rsync&amp;lt;/code&amp;gt; command and the &amp;lt;code&amp;gt;--add-drop-database&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;mysqldump&amp;lt;/code&amp;gt; command help to make sure of this.)&lt;br /&gt;
&lt;br /&gt;
So in short, just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;smtp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;xmpp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1163</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1163"/>
		<updated>2021-08-20T02:09:50Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Install PHP and modules */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;!!! WORK IN PROGRESS !!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup&lt;br /&gt;
 apt-get install certbot&lt;br /&gt;
 apt-get install dnsutils&lt;br /&gt;
 apt-get install emacs&lt;br /&gt;
 apt-get install git&lt;br /&gt;
 apt-get install mg&lt;br /&gt;
 apt-get install moreutils&lt;br /&gt;
 apt-get install net-tools&lt;br /&gt;
 apt-get install nmap&lt;br /&gt;
 apt-get install rsync&lt;br /&gt;
 apt-get install software-properties-common&lt;br /&gt;
 apt-get install tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the &amp;lt;code&amp;gt;.ssh/id_rsa&amp;lt;/code&amp;gt; from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in &amp;lt;code&amp;gt;/root/pwd/meta&amp;lt;/code&amp;gt; on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 apt-get install apache2&lt;br /&gt;
 apt-get install dovecot-core&lt;br /&gt;
 apt-get install dovecot-imapd&lt;br /&gt;
 apt-get install dovecot-ldap&lt;br /&gt;
 apt-get install dovecot-pop3d&lt;br /&gt;
 apt-get install ejabberd # good candidate for backports&lt;br /&gt;
 apt-get install fail2ban&lt;br /&gt;
 apt-get install inspircd&lt;br /&gt;
 apt-get install mailman&lt;br /&gt;
 apt-get install mariadb-server&lt;br /&gt;
 apt-get install opendkim&lt;br /&gt;
 apt-get install postfix&lt;br /&gt;
 apt-get install slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in &amp;lt;code&amp;gt;/root/pwd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Install PHP and modules ===&lt;br /&gt;
&lt;br /&gt;
This should really be part of the last section, but due to the sheer number of PHP modules we want to install, it&#039;s in its own section:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install php${php_version}&lt;br /&gt;
 apt-get install php${php_version}-apcu&lt;br /&gt;
 apt-get install php${php_version}-bcmath&lt;br /&gt;
 apt-get install php${php_version}-cli&lt;br /&gt;
 apt-get install php${php_version}-ctype&lt;br /&gt;
 apt-get install php${php_version}-curl&lt;br /&gt;
 apt-get install php${php_version}-gd&lt;br /&gt;
 apt-get install php${php_version}-gmp&lt;br /&gt;
 apt-get install php${php_version}-iconv&lt;br /&gt;
 apt-get install php${php_version}-imagick&lt;br /&gt;
 apt-get install php${php_version}-intl&lt;br /&gt;
 apt-get install php${php_version}-json&lt;br /&gt;
 apt-get install php${php_version}-ldap&lt;br /&gt;
 apt-get install php${php_version}-mbstring&lt;br /&gt;
 apt-get install php${php_version}-mysql&lt;br /&gt;
 apt-get install php${php_version}-opcache&lt;br /&gt;
 apt-get install php${php_version}-readline&lt;br /&gt;
 apt-get install php${php_version}-xml&lt;br /&gt;
 apt-get install php${php_version}-zip&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script makes sure that the cert files are found in &amp;lt;code&amp;gt;/etc/fw-certs&amp;lt;/code&amp;gt; and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes, before shutting down the services on the old server and repeating it to ensure integrity of live data.&lt;br /&gt;
&lt;br /&gt;
Note that although some of the steps described in this section take a long time to finish, they can be done in parallel.&lt;br /&gt;
&lt;br /&gt;
=== LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;There might be incompatible changes between OpenLDAP (aka &amp;lt;code&amp;gt;slapd&amp;lt;/code&amp;gt;) versions which require manual editing of the &amp;lt;code&amp;gt;slapcat&amp;lt;/code&amp;gt; output before it&#039;s read in on the new server with &amp;lt;code&amp;gt;slapadd&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open &amp;lt;code&amp;gt;/etc/ldap/schema/ppolicy.ldif&amp;lt;/code&amp;gt; and search for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt;.  You will note that there is a &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry that defines it, and also it&#039;s listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; attributes block of the &amp;lt;code&amp;gt;olcObjectClasses: ...&amp;lt;/code&amp;gt; entry that defines the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class.&lt;br /&gt;
# On the old server, save the output of &amp;lt;code&amp;gt;slapcat -n 0&amp;lt;/code&amp;gt; to a file, open the file, and search for the block where the &amp;lt;code&amp;gt;ppolicy&amp;lt;/code&amp;gt; schema is defined.  It should start with the line &amp;lt;code&amp;gt;dn: cn={4}ppolicy,cn=schema,cn=config&amp;lt;/code&amp;gt; (the &amp;lt;code&amp;gt;{4}&amp;lt;/code&amp;gt; part might contain a different integer, that&#039;s OK).  There, note that the &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt; is missing, and also it&#039;s not listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list of the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class definition.  Copy over the attribute type definition from the &amp;lt;code&amp;gt;ppolicy.ldif&amp;lt;/code&amp;gt; file on the new server, and amend the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Contents of /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in &amp;lt;code&amp;gt;/var/www/&amp;lt;/code&amp;gt; is important; if not provided, it will copy the directory to &amp;lt;code&amp;gt;/var/www/www&amp;lt;/code&amp;gt; on the new server.&lt;br /&gt;
&lt;br /&gt;
=== SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | ssh root@feministwiki.dev /root/bin/sql&lt;br /&gt;
&lt;br /&gt;
You can use the &amp;lt;code&amp;gt;show databases;&amp;lt;/code&amp;gt; command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the &amp;lt;code&amp;gt;--all-databases&amp;lt;/code&amp;gt; option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
=== Emails ===&lt;br /&gt;
&lt;br /&gt;
This is a simple one.  Run this command from the old server:&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /home/vmail/ root@feministwiki.dev:/home/vmail&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 tar -czf - archives data lists | ssh root@feministwiki.dev &#039;cd /var/lib/mailman &amp;amp;&amp;amp; tar -xzf - &amp;amp;&amp;amp; check_perms -f&#039;&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing the group ownership of the extracted files.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch.  To do so, run this on the new server:&lt;br /&gt;
&lt;br /&gt;
 /root/bin/sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;&#039;Copying over live data&#039;&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  (For instance, the &amp;lt;code&amp;gt;--delete&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;rsync&amp;lt;/code&amp;gt; command and the &amp;lt;code&amp;gt;--add-drop-database&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;mysqldump&amp;lt;/code&amp;gt; command help to make sure of this.)&lt;br /&gt;
&lt;br /&gt;
So in short, just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;smtp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;xmpp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1162</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1162"/>
		<updated>2021-08-20T02:05:44Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Install server components */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;!!! WORK IN PROGRESS !!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup&lt;br /&gt;
 apt-get install certbot&lt;br /&gt;
 apt-get install dnsutils&lt;br /&gt;
 apt-get install emacs&lt;br /&gt;
 apt-get install git&lt;br /&gt;
 apt-get install mg&lt;br /&gt;
 apt-get install moreutils&lt;br /&gt;
 apt-get install net-tools&lt;br /&gt;
 apt-get install nmap&lt;br /&gt;
 apt-get install rsync&lt;br /&gt;
 apt-get install software-properties-common&lt;br /&gt;
 apt-get install tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the &amp;lt;code&amp;gt;.ssh/id_rsa&amp;lt;/code&amp;gt; from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in &amp;lt;code&amp;gt;/root/pwd/meta&amp;lt;/code&amp;gt; on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 apt-get install apache2&lt;br /&gt;
 apt-get install dovecot-core&lt;br /&gt;
 apt-get install dovecot-imapd&lt;br /&gt;
 apt-get install dovecot-ldap&lt;br /&gt;
 apt-get install dovecot-pop3d&lt;br /&gt;
 apt-get install ejabberd # good candidate for backports&lt;br /&gt;
 apt-get install fail2ban&lt;br /&gt;
 apt-get install inspircd&lt;br /&gt;
 apt-get install mailman&lt;br /&gt;
 apt-get install mariadb-server&lt;br /&gt;
 apt-get install opendkim&lt;br /&gt;
 apt-get install postfix&lt;br /&gt;
 apt-get install slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in &amp;lt;code&amp;gt;/root/pwd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Install PHP and modules ===&lt;br /&gt;
&lt;br /&gt;
This should really be part of the last section, but due to the sheer number of PHP modules we want to install, it&#039;s in its own section:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install php${php_version}&lt;br /&gt;
 apt-get install php${php_version}-ctype&lt;br /&gt;
 apt-get install php${php_version}-curl&lt;br /&gt;
 apt-get install php${php_version}-gd&lt;br /&gt;
 apt-get install php${php_version}-iconv&lt;br /&gt;
 apt-get install php${php_version}-json&lt;br /&gt;
 apt-get install php${php_version}-ldap&lt;br /&gt;
 apt-get install php${php_version}-mbstring&lt;br /&gt;
 apt-get install php${php_version}-mysql&lt;br /&gt;
 apt-get install php${php_version}-xml&lt;br /&gt;
 apt-get install php${php_version}-zip&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script makes sure that the cert files are found in &amp;lt;code&amp;gt;/etc/fw-certs&amp;lt;/code&amp;gt; and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes, before shutting down the services on the old server and repeating it to ensure integrity of live data.&lt;br /&gt;
&lt;br /&gt;
Note that although some of the steps described in this section take a long time to finish, they can be done in parallel.&lt;br /&gt;
&lt;br /&gt;
=== LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;There might be incompatible changes between OpenLDAP (aka &amp;lt;code&amp;gt;slapd&amp;lt;/code&amp;gt;) versions which require manual editing of the &amp;lt;code&amp;gt;slapcat&amp;lt;/code&amp;gt; output before it&#039;s read in on the new server with &amp;lt;code&amp;gt;slapadd&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open &amp;lt;code&amp;gt;/etc/ldap/schema/ppolicy.ldif&amp;lt;/code&amp;gt; and search for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt;.  You will note that there is a &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry that defines it, and also it&#039;s listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; attributes block of the &amp;lt;code&amp;gt;olcObjectClasses: ...&amp;lt;/code&amp;gt; entry that defines the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class.&lt;br /&gt;
# On the old server, save the output of &amp;lt;code&amp;gt;slapcat -n 0&amp;lt;/code&amp;gt; to a file, open the file, and search for the block where the &amp;lt;code&amp;gt;ppolicy&amp;lt;/code&amp;gt; schema is defined.  It should start with the line &amp;lt;code&amp;gt;dn: cn={4}ppolicy,cn=schema,cn=config&amp;lt;/code&amp;gt; (the &amp;lt;code&amp;gt;{4}&amp;lt;/code&amp;gt; part might contain a different integer, that&#039;s OK).  There, note that the &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt; is missing, and also it&#039;s not listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list of the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class definition.  Copy over the attribute type definition from the &amp;lt;code&amp;gt;ppolicy.ldif&amp;lt;/code&amp;gt; file on the new server, and amend the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Contents of /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in &amp;lt;code&amp;gt;/var/www/&amp;lt;/code&amp;gt; is important; if not provided, it will copy the directory to &amp;lt;code&amp;gt;/var/www/www&amp;lt;/code&amp;gt; on the new server.&lt;br /&gt;
&lt;br /&gt;
=== SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | ssh root@feministwiki.dev /root/bin/sql&lt;br /&gt;
&lt;br /&gt;
You can use the &amp;lt;code&amp;gt;show databases;&amp;lt;/code&amp;gt; command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the &amp;lt;code&amp;gt;--all-databases&amp;lt;/code&amp;gt; option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
=== Emails ===&lt;br /&gt;
&lt;br /&gt;
This is a simple one.  Run this command from the old server:&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /home/vmail/ root@feministwiki.dev:/home/vmail&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 tar -czf - archives data lists | ssh root@feministwiki.dev &#039;cd /var/lib/mailman &amp;amp;&amp;amp; tar -xzf - &amp;amp;&amp;amp; check_perms -f&#039;&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing the group ownership of the extracted files.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch.  To do so, run this on the new server:&lt;br /&gt;
&lt;br /&gt;
 /root/bin/sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;&#039;Copying over live data&#039;&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  (For instance, the &amp;lt;code&amp;gt;--delete&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;rsync&amp;lt;/code&amp;gt; command and the &amp;lt;code&amp;gt;--add-drop-database&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;mysqldump&amp;lt;/code&amp;gt; command help to make sure of this.)&lt;br /&gt;
&lt;br /&gt;
So in short, just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;smtp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;xmpp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1161</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1161"/>
		<updated>2021-08-20T01:47:52Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Install server components */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;!!! WORK IN PROGRESS !!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup&lt;br /&gt;
 apt-get install certbot&lt;br /&gt;
 apt-get install dnsutils&lt;br /&gt;
 apt-get install emacs&lt;br /&gt;
 apt-get install git&lt;br /&gt;
 apt-get install mg&lt;br /&gt;
 apt-get install moreutils&lt;br /&gt;
 apt-get install net-tools&lt;br /&gt;
 apt-get install nmap&lt;br /&gt;
 apt-get install rsync&lt;br /&gt;
 apt-get install software-properties-common&lt;br /&gt;
 apt-get install tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the &amp;lt;code&amp;gt;.ssh/id_rsa&amp;lt;/code&amp;gt; from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in &amp;lt;code&amp;gt;/root/pwd/meta&amp;lt;/code&amp;gt; on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install apache2&lt;br /&gt;
 apt-get install dovecot-core&lt;br /&gt;
 apt-get install dovecot-imapd&lt;br /&gt;
 apt-get install dovecot-ldap&lt;br /&gt;
 apt-get install dovecot-pop3d&lt;br /&gt;
 apt-get install ejabberd # good candidate for backports&lt;br /&gt;
 apt-get install fail2ban&lt;br /&gt;
 apt-get install inspircd&lt;br /&gt;
 apt-get install mailman&lt;br /&gt;
 apt-get install mariadb-server&lt;br /&gt;
 apt-get install opendkim&lt;br /&gt;
 apt-get install php${php_version}&lt;br /&gt;
 apt-get install php${php_version}-ldap&lt;br /&gt;
 apt-get install php${php_version}-mbstring&lt;br /&gt;
 apt-get install php${php_version}-mysql&lt;br /&gt;
 apt-get install php${php_version}-xml&lt;br /&gt;
 apt-get install postfix&lt;br /&gt;
 apt-get install slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in &amp;lt;code&amp;gt;/root/pwd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script makes sure that the cert files are found in &amp;lt;code&amp;gt;/etc/fw-certs&amp;lt;/code&amp;gt; and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes, before shutting down the services on the old server and repeating it to ensure integrity of live data.&lt;br /&gt;
&lt;br /&gt;
Note that although some of the steps described in this section take a long time to finish, they can be done in parallel.&lt;br /&gt;
&lt;br /&gt;
=== LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;There might be incompatible changes between OpenLDAP (aka &amp;lt;code&amp;gt;slapd&amp;lt;/code&amp;gt;) versions which require manual editing of the &amp;lt;code&amp;gt;slapcat&amp;lt;/code&amp;gt; output before it&#039;s read in on the new server with &amp;lt;code&amp;gt;slapadd&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open &amp;lt;code&amp;gt;/etc/ldap/schema/ppolicy.ldif&amp;lt;/code&amp;gt; and search for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt;.  You will note that there is a &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry that defines it, and also it&#039;s listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; attributes block of the &amp;lt;code&amp;gt;olcObjectClasses: ...&amp;lt;/code&amp;gt; entry that defines the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class.&lt;br /&gt;
# On the old server, save the output of &amp;lt;code&amp;gt;slapcat -n 0&amp;lt;/code&amp;gt; to a file, open the file, and search for the block where the &amp;lt;code&amp;gt;ppolicy&amp;lt;/code&amp;gt; schema is defined.  It should start with the line &amp;lt;code&amp;gt;dn: cn={4}ppolicy,cn=schema,cn=config&amp;lt;/code&amp;gt; (the &amp;lt;code&amp;gt;{4}&amp;lt;/code&amp;gt; part might contain a different integer, that&#039;s OK).  There, note that the &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt; is missing, and also it&#039;s not listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list of the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class definition.  Copy over the attribute type definition from the &amp;lt;code&amp;gt;ppolicy.ldif&amp;lt;/code&amp;gt; file on the new server, and amend the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Contents of /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in &amp;lt;code&amp;gt;/var/www/&amp;lt;/code&amp;gt; is important; if not provided, it will copy the directory to &amp;lt;code&amp;gt;/var/www/www&amp;lt;/code&amp;gt; on the new server.&lt;br /&gt;
&lt;br /&gt;
=== SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | ssh root@feministwiki.dev /root/bin/sql&lt;br /&gt;
&lt;br /&gt;
You can use the &amp;lt;code&amp;gt;show databases;&amp;lt;/code&amp;gt; command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the &amp;lt;code&amp;gt;--all-databases&amp;lt;/code&amp;gt; option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
=== Emails ===&lt;br /&gt;
&lt;br /&gt;
This is a simple one.  Run this command from the old server:&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /home/vmail/ root@feministwiki.dev:/home/vmail&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 tar -czf - archives data lists | ssh root@feministwiki.dev &#039;cd /var/lib/mailman &amp;amp;&amp;amp; tar -xzf - &amp;amp;&amp;amp; check_perms -f&#039;&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing the group ownership of the extracted files.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch.  To do so, run this on the new server:&lt;br /&gt;
&lt;br /&gt;
 /root/bin/sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;&#039;Copying over live data&#039;&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  (For instance, the &amp;lt;code&amp;gt;--delete&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;rsync&amp;lt;/code&amp;gt; command and the &amp;lt;code&amp;gt;--add-drop-database&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;mysqldump&amp;lt;/code&amp;gt; command help to make sure of this.)&lt;br /&gt;
&lt;br /&gt;
So in short, just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;smtp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;xmpp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1160</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1160"/>
		<updated>2021-08-20T01:45:21Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Copying over live data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;!!! WORK IN PROGRESS !!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup&lt;br /&gt;
 apt-get install certbot&lt;br /&gt;
 apt-get install dnsutils&lt;br /&gt;
 apt-get install emacs&lt;br /&gt;
 apt-get install git&lt;br /&gt;
 apt-get install mg&lt;br /&gt;
 apt-get install moreutils&lt;br /&gt;
 apt-get install net-tools&lt;br /&gt;
 apt-get install nmap&lt;br /&gt;
 apt-get install rsync&lt;br /&gt;
 apt-get install software-properties-common&lt;br /&gt;
 apt-get install tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the &amp;lt;code&amp;gt;.ssh/id_rsa&amp;lt;/code&amp;gt; from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in &amp;lt;code&amp;gt;/root/pwd/meta&amp;lt;/code&amp;gt; on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install apache2&lt;br /&gt;
 apt-get install dovecot-core&lt;br /&gt;
 apt-get install dovecot-imapd&lt;br /&gt;
 apt-get install dovecot-ldap&lt;br /&gt;
 apt-get install dovecot-pop3d&lt;br /&gt;
 apt-get install ejabberd # good candidate for backports&lt;br /&gt;
 apt-get install fail2ban&lt;br /&gt;
 apt-get install inspircd&lt;br /&gt;
 apt-get install mailman&lt;br /&gt;
 apt-get install mariadb-server&lt;br /&gt;
 apt-get install opendkim&lt;br /&gt;
 apt-get install php${php_version}&lt;br /&gt;
 apt-get install php${php_version}-mbstring&lt;br /&gt;
 apt-get install php${php_version}-mysql&lt;br /&gt;
 apt-get install php${php_version}-xml&lt;br /&gt;
 apt-get install postfix&lt;br /&gt;
 apt-get install slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in &amp;lt;code&amp;gt;/root/pwd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script makes sure that the cert files are found in &amp;lt;code&amp;gt;/etc/fw-certs&amp;lt;/code&amp;gt; and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes, before shutting down the services on the old server and repeating it to ensure integrity of live data.&lt;br /&gt;
&lt;br /&gt;
Note that although some of the steps described in this section take a long time to finish, they can be done in parallel.&lt;br /&gt;
&lt;br /&gt;
=== LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;There might be incompatible changes between OpenLDAP (aka &amp;lt;code&amp;gt;slapd&amp;lt;/code&amp;gt;) versions which require manual editing of the &amp;lt;code&amp;gt;slapcat&amp;lt;/code&amp;gt; output before it&#039;s read in on the new server with &amp;lt;code&amp;gt;slapadd&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open &amp;lt;code&amp;gt;/etc/ldap/schema/ppolicy.ldif&amp;lt;/code&amp;gt; and search for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt;.  You will note that there is a &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry that defines it, and also it&#039;s listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; attributes block of the &amp;lt;code&amp;gt;olcObjectClasses: ...&amp;lt;/code&amp;gt; entry that defines the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class.&lt;br /&gt;
# On the old server, save the output of &amp;lt;code&amp;gt;slapcat -n 0&amp;lt;/code&amp;gt; to a file, open the file, and search for the block where the &amp;lt;code&amp;gt;ppolicy&amp;lt;/code&amp;gt; schema is defined.  It should start with the line &amp;lt;code&amp;gt;dn: cn={4}ppolicy,cn=schema,cn=config&amp;lt;/code&amp;gt; (the &amp;lt;code&amp;gt;{4}&amp;lt;/code&amp;gt; part might contain a different integer, that&#039;s OK).  There, note that the &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt; is missing, and also it&#039;s not listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list of the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class definition.  Copy over the attribute type definition from the &amp;lt;code&amp;gt;ppolicy.ldif&amp;lt;/code&amp;gt; file on the new server, and amend the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Contents of /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in &amp;lt;code&amp;gt;/var/www/&amp;lt;/code&amp;gt; is important; if not provided, it will copy the directory to &amp;lt;code&amp;gt;/var/www/www&amp;lt;/code&amp;gt; on the new server.&lt;br /&gt;
&lt;br /&gt;
=== SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | ssh root@feministwiki.dev /root/bin/sql&lt;br /&gt;
&lt;br /&gt;
You can use the &amp;lt;code&amp;gt;show databases;&amp;lt;/code&amp;gt; command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the &amp;lt;code&amp;gt;--all-databases&amp;lt;/code&amp;gt; option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
=== Emails ===&lt;br /&gt;
&lt;br /&gt;
This is a simple one.  Run this command from the old server:&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /home/vmail/ root@feministwiki.dev:/home/vmail&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 tar -czf - archives data lists | ssh root@feministwiki.dev &#039;cd /var/lib/mailman &amp;amp;&amp;amp; tar -xzf - &amp;amp;&amp;amp; check_perms -f&#039;&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing the group ownership of the extracted files.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch.  To do so, run this on the new server:&lt;br /&gt;
&lt;br /&gt;
 /root/bin/sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;&#039;Copying over live data&#039;&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  (For instance, the &amp;lt;code&amp;gt;--delete&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;rsync&amp;lt;/code&amp;gt; command and the &amp;lt;code&amp;gt;--add-drop-database&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;mysqldump&amp;lt;/code&amp;gt; command help to make sure of this.)&lt;br /&gt;
&lt;br /&gt;
So in short, just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;smtp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;xmpp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1159</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1159"/>
		<updated>2021-08-20T01:39:33Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Install server components */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;!!! WORK IN PROGRESS !!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup&lt;br /&gt;
 apt-get install certbot&lt;br /&gt;
 apt-get install dnsutils&lt;br /&gt;
 apt-get install emacs&lt;br /&gt;
 apt-get install git&lt;br /&gt;
 apt-get install mg&lt;br /&gt;
 apt-get install moreutils&lt;br /&gt;
 apt-get install net-tools&lt;br /&gt;
 apt-get install nmap&lt;br /&gt;
 apt-get install rsync&lt;br /&gt;
 apt-get install software-properties-common&lt;br /&gt;
 apt-get install tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the &amp;lt;code&amp;gt;.ssh/id_rsa&amp;lt;/code&amp;gt; from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in &amp;lt;code&amp;gt;/root/pwd/meta&amp;lt;/code&amp;gt; on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install apache2&lt;br /&gt;
 apt-get install dovecot-core&lt;br /&gt;
 apt-get install dovecot-imapd&lt;br /&gt;
 apt-get install dovecot-ldap&lt;br /&gt;
 apt-get install dovecot-pop3d&lt;br /&gt;
 apt-get install ejabberd # good candidate for backports&lt;br /&gt;
 apt-get install fail2ban&lt;br /&gt;
 apt-get install inspircd&lt;br /&gt;
 apt-get install mailman&lt;br /&gt;
 apt-get install mariadb-server&lt;br /&gt;
 apt-get install opendkim&lt;br /&gt;
 apt-get install php${php_version}&lt;br /&gt;
 apt-get install php${php_version}-mbstring&lt;br /&gt;
 apt-get install php${php_version}-mysql&lt;br /&gt;
 apt-get install php${php_version}-xml&lt;br /&gt;
 apt-get install postfix&lt;br /&gt;
 apt-get install slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in &amp;lt;code&amp;gt;/root/pwd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script makes sure that the cert files are found in &amp;lt;code&amp;gt;/etc/fw-certs&amp;lt;/code&amp;gt; and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes, before shutting down the services on the old server and repeating it to ensure integrity of live data.&lt;br /&gt;
&lt;br /&gt;
=== Copy over /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in &amp;lt;code&amp;gt;/var/www/&amp;lt;/code&amp;gt; is important; if not provided, it will copy the directory to &amp;lt;code&amp;gt;/var/www/www&amp;lt;/code&amp;gt; on the new server.&lt;br /&gt;
&lt;br /&gt;
While this command is running, you can do the next two steps in parallel.&lt;br /&gt;
&lt;br /&gt;
=== Copy over SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | ssh root@feministwiki.dev /root/bin/sql&lt;br /&gt;
&lt;br /&gt;
You can use the &amp;lt;code&amp;gt;show databases;&amp;lt;/code&amp;gt; command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the &amp;lt;code&amp;gt;--all-databases&amp;lt;/code&amp;gt; option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
While the above command is still running, you can do the next step in parallel.&lt;br /&gt;
&lt;br /&gt;
=== Copy over LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;There might be incompatible changes between OpenLDAP (aka &amp;lt;code&amp;gt;slapd&amp;lt;/code&amp;gt;) versions which require manual editing of the &amp;lt;code&amp;gt;slapcat&amp;lt;/code&amp;gt; output before it&#039;s read in on the new server with &amp;lt;code&amp;gt;slapadd&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open &amp;lt;code&amp;gt;/etc/ldap/schema/ppolicy.ldif&amp;lt;/code&amp;gt; and search for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt;.  You will note that there is a &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry that defines it, and also it&#039;s listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; attributes block of the &amp;lt;code&amp;gt;olcObjectClasses: ...&amp;lt;/code&amp;gt; entry that defines the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class.&lt;br /&gt;
# On the old server, save the output of &amp;lt;code&amp;gt;slapcat -n 0&amp;lt;/code&amp;gt; to a file, open the file, and search for the block where the &amp;lt;code&amp;gt;ppolicy&amp;lt;/code&amp;gt; schema is defined.  It should start with the line &amp;lt;code&amp;gt;dn: cn={4}ppolicy,cn=schema,cn=config&amp;lt;/code&amp;gt; (the &amp;lt;code&amp;gt;{4}&amp;lt;/code&amp;gt; part might contain a different integer, that&#039;s OK).  There, note that the &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt; is missing, and also it&#039;s not listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list of the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class definition.  Copy over the attribute type definition from the &amp;lt;code&amp;gt;ppolicy.ldif&amp;lt;/code&amp;gt; file on the new server, and amend the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 tar -czf - archives data lists | ssh root@feministwiki.dev &#039;cd /var/lib/mailman &amp;amp;&amp;amp; tar -xzf - &amp;amp;&amp;amp; check_perms -f&#039;&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing the group ownership of the extracted files.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch.  To do so, run this on the new server:&lt;br /&gt;
&lt;br /&gt;
 /root/bin/sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;&#039;Copying over live data&#039;&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  (For instance, the &amp;lt;code&amp;gt;--delete&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;rsync&amp;lt;/code&amp;gt; command and the &amp;lt;code&amp;gt;--add-drop-database&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;mysqldump&amp;lt;/code&amp;gt; command help to make sure of this.)&lt;br /&gt;
&lt;br /&gt;
So in short, just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;smtp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;xmpp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1158</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1158"/>
		<updated>2021-08-20T00:53:25Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Stop services on the old server */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;!!! WORK IN PROGRESS !!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup&lt;br /&gt;
 apt-get install certbot&lt;br /&gt;
 apt-get install dnsutils&lt;br /&gt;
 apt-get install emacs&lt;br /&gt;
 apt-get install git&lt;br /&gt;
 apt-get install mg&lt;br /&gt;
 apt-get install moreutils&lt;br /&gt;
 apt-get install net-tools&lt;br /&gt;
 apt-get install nmap&lt;br /&gt;
 apt-get install rsync&lt;br /&gt;
 apt-get install software-properties-common&lt;br /&gt;
 apt-get install tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the &amp;lt;code&amp;gt;.ssh/id_rsa&amp;lt;/code&amp;gt; from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in &amp;lt;code&amp;gt;/root/pwd/meta&amp;lt;/code&amp;gt; on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install apache2&lt;br /&gt;
 apt-get install dovecot-core&lt;br /&gt;
 apt-get install dovecot-imapd&lt;br /&gt;
 apt-get install dovecot-pop3d&lt;br /&gt;
 apt-get install ejabberd # good candidate for backports&lt;br /&gt;
 apt-get install fail2ban&lt;br /&gt;
 apt-get install inspircd&lt;br /&gt;
 apt-get install mailman&lt;br /&gt;
 apt-get install mariadb-server&lt;br /&gt;
 apt-get install opendkim&lt;br /&gt;
 apt-get install php${php_version}&lt;br /&gt;
 apt-get install php${php_version}-mbstring&lt;br /&gt;
 apt-get install php${php_version}-mysql&lt;br /&gt;
 apt-get install php${php_version}-xml&lt;br /&gt;
 apt-get install postfix&lt;br /&gt;
 apt-get install slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in &amp;lt;code&amp;gt;/root/pwd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script makes sure that the cert files are found in &amp;lt;code&amp;gt;/etc/fw-certs&amp;lt;/code&amp;gt; and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes, before shutting down the services on the old server and repeating it to ensure integrity of live data.&lt;br /&gt;
&lt;br /&gt;
=== Copy over /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in &amp;lt;code&amp;gt;/var/www/&amp;lt;/code&amp;gt; is important; if not provided, it will copy the directory to &amp;lt;code&amp;gt;/var/www/www&amp;lt;/code&amp;gt; on the new server.&lt;br /&gt;
&lt;br /&gt;
While this command is running, you can do the next two steps in parallel.&lt;br /&gt;
&lt;br /&gt;
=== Copy over SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | ssh root@feministwiki.dev /root/bin/sql&lt;br /&gt;
&lt;br /&gt;
You can use the &amp;lt;code&amp;gt;show databases;&amp;lt;/code&amp;gt; command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the &amp;lt;code&amp;gt;--all-databases&amp;lt;/code&amp;gt; option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
While the above command is still running, you can do the next step in parallel.&lt;br /&gt;
&lt;br /&gt;
=== Copy over LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;There might be incompatible changes between OpenLDAP (aka &amp;lt;code&amp;gt;slapd&amp;lt;/code&amp;gt;) versions which require manual editing of the &amp;lt;code&amp;gt;slapcat&amp;lt;/code&amp;gt; output before it&#039;s read in on the new server with &amp;lt;code&amp;gt;slapadd&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open &amp;lt;code&amp;gt;/etc/ldap/schema/ppolicy.ldif&amp;lt;/code&amp;gt; and search for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt;.  You will note that there is a &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry that defines it, and also it&#039;s listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; attributes block of the &amp;lt;code&amp;gt;olcObjectClasses: ...&amp;lt;/code&amp;gt; entry that defines the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class.&lt;br /&gt;
# On the old server, save the output of &amp;lt;code&amp;gt;slapcat -n 0&amp;lt;/code&amp;gt; to a file, open the file, and search for the block where the &amp;lt;code&amp;gt;ppolicy&amp;lt;/code&amp;gt; schema is defined.  It should start with the line &amp;lt;code&amp;gt;dn: cn={4}ppolicy,cn=schema,cn=config&amp;lt;/code&amp;gt; (the &amp;lt;code&amp;gt;{4}&amp;lt;/code&amp;gt; part might contain a different integer, that&#039;s OK).  There, note that the &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt; is missing, and also it&#039;s not listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list of the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class definition.  Copy over the attribute type definition from the &amp;lt;code&amp;gt;ppolicy.ldif&amp;lt;/code&amp;gt; file on the new server, and amend the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 tar -czf - archives data lists | ssh root@feministwiki.dev &#039;cd /var/lib/mailman &amp;amp;&amp;amp; tar -xzf - &amp;amp;&amp;amp; check_perms -f&#039;&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing the group ownership of the extracted files.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch.  To do so, run this on the new server:&lt;br /&gt;
&lt;br /&gt;
 /root/bin/sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;&#039;Copying over live data&#039;&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  (For instance, the &amp;lt;code&amp;gt;--delete&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;rsync&amp;lt;/code&amp;gt; command and the &amp;lt;code&amp;gt;--add-drop-database&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;mysqldump&amp;lt;/code&amp;gt; command help to make sure of this.)&lt;br /&gt;
&lt;br /&gt;
So in short, just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;smtp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;xmpp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1157</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1157"/>
		<updated>2021-08-20T00:37:54Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Recreate SQL users */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;!!! WORK IN PROGRESS !!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup&lt;br /&gt;
 apt-get install certbot&lt;br /&gt;
 apt-get install dnsutils&lt;br /&gt;
 apt-get install emacs&lt;br /&gt;
 apt-get install git&lt;br /&gt;
 apt-get install mg&lt;br /&gt;
 apt-get install moreutils&lt;br /&gt;
 apt-get install net-tools&lt;br /&gt;
 apt-get install nmap&lt;br /&gt;
 apt-get install rsync&lt;br /&gt;
 apt-get install software-properties-common&lt;br /&gt;
 apt-get install tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the &amp;lt;code&amp;gt;.ssh/id_rsa&amp;lt;/code&amp;gt; from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in &amp;lt;code&amp;gt;/root/pwd/meta&amp;lt;/code&amp;gt; on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install apache2&lt;br /&gt;
 apt-get install dovecot-core&lt;br /&gt;
 apt-get install dovecot-imapd&lt;br /&gt;
 apt-get install dovecot-pop3d&lt;br /&gt;
 apt-get install ejabberd # good candidate for backports&lt;br /&gt;
 apt-get install fail2ban&lt;br /&gt;
 apt-get install inspircd&lt;br /&gt;
 apt-get install mailman&lt;br /&gt;
 apt-get install mariadb-server&lt;br /&gt;
 apt-get install opendkim&lt;br /&gt;
 apt-get install php${php_version}&lt;br /&gt;
 apt-get install php${php_version}-mbstring&lt;br /&gt;
 apt-get install php${php_version}-mysql&lt;br /&gt;
 apt-get install php${php_version}-xml&lt;br /&gt;
 apt-get install postfix&lt;br /&gt;
 apt-get install slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in &amp;lt;code&amp;gt;/root/pwd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script makes sure that the cert files are found in &amp;lt;code&amp;gt;/etc/fw-certs&amp;lt;/code&amp;gt; and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes, before shutting down the services on the old server and repeating it to ensure integrity of live data.&lt;br /&gt;
&lt;br /&gt;
=== Copy over /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in &amp;lt;code&amp;gt;/var/www/&amp;lt;/code&amp;gt; is important; if not provided, it will copy the directory to &amp;lt;code&amp;gt;/var/www/www&amp;lt;/code&amp;gt; on the new server.&lt;br /&gt;
&lt;br /&gt;
While this command is running, you can do the next two steps in parallel.&lt;br /&gt;
&lt;br /&gt;
=== Copy over SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | ssh root@feministwiki.dev /root/bin/sql&lt;br /&gt;
&lt;br /&gt;
You can use the &amp;lt;code&amp;gt;show databases;&amp;lt;/code&amp;gt; command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the &amp;lt;code&amp;gt;--all-databases&amp;lt;/code&amp;gt; option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
While the above command is still running, you can do the next step in parallel.&lt;br /&gt;
&lt;br /&gt;
=== Copy over LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;There might be incompatible changes between OpenLDAP (aka &amp;lt;code&amp;gt;slapd&amp;lt;/code&amp;gt;) versions which require manual editing of the &amp;lt;code&amp;gt;slapcat&amp;lt;/code&amp;gt; output before it&#039;s read in on the new server with &amp;lt;code&amp;gt;slapadd&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open &amp;lt;code&amp;gt;/etc/ldap/schema/ppolicy.ldif&amp;lt;/code&amp;gt; and search for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt;.  You will note that there is a &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry that defines it, and also it&#039;s listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; attributes block of the &amp;lt;code&amp;gt;olcObjectClasses: ...&amp;lt;/code&amp;gt; entry that defines the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class.&lt;br /&gt;
# On the old server, save the output of &amp;lt;code&amp;gt;slapcat -n 0&amp;lt;/code&amp;gt; to a file, open the file, and search for the block where the &amp;lt;code&amp;gt;ppolicy&amp;lt;/code&amp;gt; schema is defined.  It should start with the line &amp;lt;code&amp;gt;dn: cn={4}ppolicy,cn=schema,cn=config&amp;lt;/code&amp;gt; (the &amp;lt;code&amp;gt;{4}&amp;lt;/code&amp;gt; part might contain a different integer, that&#039;s OK).  There, note that the &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt; is missing, and also it&#039;s not listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list of the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class definition.  Copy over the attribute type definition from the &amp;lt;code&amp;gt;ppolicy.ldif&amp;lt;/code&amp;gt; file on the new server, and amend the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 tar -czf - archives data lists | ssh root@feministwiki.dev &#039;cd /var/lib/mailman &amp;amp;&amp;amp; tar -xzf - &amp;amp;&amp;amp; check_perms -f&#039;&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing the group ownership of the extracted files.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch.  To do so, run this on the new server:&lt;br /&gt;
&lt;br /&gt;
 /root/bin/sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop mariadb&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;&#039;Copying over live data&#039;&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  (For instance, the &amp;lt;code&amp;gt;--delete&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;rsync&amp;lt;/code&amp;gt; command and the &amp;lt;code&amp;gt;--add-drop-database&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;mysqldump&amp;lt;/code&amp;gt; command help to make sure of this.)&lt;br /&gt;
&lt;br /&gt;
So in short, just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;smtp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;xmpp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1156</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1156"/>
		<updated>2021-08-20T00:37:40Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Recreate SQL users */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;!!! WORK IN PROGRESS !!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup&lt;br /&gt;
 apt-get install certbot&lt;br /&gt;
 apt-get install dnsutils&lt;br /&gt;
 apt-get install emacs&lt;br /&gt;
 apt-get install git&lt;br /&gt;
 apt-get install mg&lt;br /&gt;
 apt-get install moreutils&lt;br /&gt;
 apt-get install net-tools&lt;br /&gt;
 apt-get install nmap&lt;br /&gt;
 apt-get install rsync&lt;br /&gt;
 apt-get install software-properties-common&lt;br /&gt;
 apt-get install tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the &amp;lt;code&amp;gt;.ssh/id_rsa&amp;lt;/code&amp;gt; from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in &amp;lt;code&amp;gt;/root/pwd/meta&amp;lt;/code&amp;gt; on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install apache2&lt;br /&gt;
 apt-get install dovecot-core&lt;br /&gt;
 apt-get install dovecot-imapd&lt;br /&gt;
 apt-get install dovecot-pop3d&lt;br /&gt;
 apt-get install ejabberd # good candidate for backports&lt;br /&gt;
 apt-get install fail2ban&lt;br /&gt;
 apt-get install inspircd&lt;br /&gt;
 apt-get install mailman&lt;br /&gt;
 apt-get install mariadb-server&lt;br /&gt;
 apt-get install opendkim&lt;br /&gt;
 apt-get install php${php_version}&lt;br /&gt;
 apt-get install php${php_version}-mbstring&lt;br /&gt;
 apt-get install php${php_version}-mysql&lt;br /&gt;
 apt-get install php${php_version}-xml&lt;br /&gt;
 apt-get install postfix&lt;br /&gt;
 apt-get install slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in &amp;lt;code&amp;gt;/root/pwd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script makes sure that the cert files are found in &amp;lt;code&amp;gt;/etc/fw-certs&amp;lt;/code&amp;gt; and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes, before shutting down the services on the old server and repeating it to ensure integrity of live data.&lt;br /&gt;
&lt;br /&gt;
=== Copy over /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in &amp;lt;code&amp;gt;/var/www/&amp;lt;/code&amp;gt; is important; if not provided, it will copy the directory to &amp;lt;code&amp;gt;/var/www/www&amp;lt;/code&amp;gt; on the new server.&lt;br /&gt;
&lt;br /&gt;
While this command is running, you can do the next two steps in parallel.&lt;br /&gt;
&lt;br /&gt;
=== Copy over SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | ssh root@feministwiki.dev /root/bin/sql&lt;br /&gt;
&lt;br /&gt;
You can use the &amp;lt;code&amp;gt;show databases;&amp;lt;/code&amp;gt; command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the &amp;lt;code&amp;gt;--all-databases&amp;lt;/code&amp;gt; option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
While the above command is still running, you can do the next step in parallel.&lt;br /&gt;
&lt;br /&gt;
=== Copy over LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;There might be incompatible changes between OpenLDAP (aka &amp;lt;code&amp;gt;slapd&amp;lt;/code&amp;gt;) versions which require manual editing of the &amp;lt;code&amp;gt;slapcat&amp;lt;/code&amp;gt; output before it&#039;s read in on the new server with &amp;lt;code&amp;gt;slapadd&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open &amp;lt;code&amp;gt;/etc/ldap/schema/ppolicy.ldif&amp;lt;/code&amp;gt; and search for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt;.  You will note that there is a &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry that defines it, and also it&#039;s listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; attributes block of the &amp;lt;code&amp;gt;olcObjectClasses: ...&amp;lt;/code&amp;gt; entry that defines the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class.&lt;br /&gt;
# On the old server, save the output of &amp;lt;code&amp;gt;slapcat -n 0&amp;lt;/code&amp;gt; to a file, open the file, and search for the block where the &amp;lt;code&amp;gt;ppolicy&amp;lt;/code&amp;gt; schema is defined.  It should start with the line &amp;lt;code&amp;gt;dn: cn={4}ppolicy,cn=schema,cn=config&amp;lt;/code&amp;gt; (the &amp;lt;code&amp;gt;{4}&amp;lt;/code&amp;gt; part might contain a different integer, that&#039;s OK).  There, note that the &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt; is missing, and also it&#039;s not listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list of the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class definition.  Copy over the attribute type definition from the &amp;lt;code&amp;gt;ppolicy.ldif&amp;lt;/code&amp;gt; file on the new server, and amend the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 tar -czf - archives data lists | ssh root@feministwiki.dev &#039;cd /var/lib/mailman &amp;amp;&amp;amp; tar -xzf - &amp;amp;&amp;amp; check_perms -f&#039;&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing the group ownership of the extracted files.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch.  To do so, run this on the new server:&lt;br /&gt;
&lt;br /&gt;
 sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop mariadb&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;&#039;Copying over live data&#039;&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  (For instance, the &amp;lt;code&amp;gt;--delete&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;rsync&amp;lt;/code&amp;gt; command and the &amp;lt;code&amp;gt;--add-drop-database&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;mysqldump&amp;lt;/code&amp;gt; command help to make sure of this.)&lt;br /&gt;
&lt;br /&gt;
So in short, just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;smtp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;xmpp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1155</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1155"/>
		<updated>2021-08-20T00:37:21Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Copy over SQL databases */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;!!! WORK IN PROGRESS !!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup&lt;br /&gt;
 apt-get install certbot&lt;br /&gt;
 apt-get install dnsutils&lt;br /&gt;
 apt-get install emacs&lt;br /&gt;
 apt-get install git&lt;br /&gt;
 apt-get install mg&lt;br /&gt;
 apt-get install moreutils&lt;br /&gt;
 apt-get install net-tools&lt;br /&gt;
 apt-get install nmap&lt;br /&gt;
 apt-get install rsync&lt;br /&gt;
 apt-get install software-properties-common&lt;br /&gt;
 apt-get install tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the &amp;lt;code&amp;gt;.ssh/id_rsa&amp;lt;/code&amp;gt; from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in &amp;lt;code&amp;gt;/root/pwd/meta&amp;lt;/code&amp;gt; on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install apache2&lt;br /&gt;
 apt-get install dovecot-core&lt;br /&gt;
 apt-get install dovecot-imapd&lt;br /&gt;
 apt-get install dovecot-pop3d&lt;br /&gt;
 apt-get install ejabberd # good candidate for backports&lt;br /&gt;
 apt-get install fail2ban&lt;br /&gt;
 apt-get install inspircd&lt;br /&gt;
 apt-get install mailman&lt;br /&gt;
 apt-get install mariadb-server&lt;br /&gt;
 apt-get install opendkim&lt;br /&gt;
 apt-get install php${php_version}&lt;br /&gt;
 apt-get install php${php_version}-mbstring&lt;br /&gt;
 apt-get install php${php_version}-mysql&lt;br /&gt;
 apt-get install php${php_version}-xml&lt;br /&gt;
 apt-get install postfix&lt;br /&gt;
 apt-get install slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in &amp;lt;code&amp;gt;/root/pwd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script makes sure that the cert files are found in &amp;lt;code&amp;gt;/etc/fw-certs&amp;lt;/code&amp;gt; and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes, before shutting down the services on the old server and repeating it to ensure integrity of live data.&lt;br /&gt;
&lt;br /&gt;
=== Copy over /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in &amp;lt;code&amp;gt;/var/www/&amp;lt;/code&amp;gt; is important; if not provided, it will copy the directory to &amp;lt;code&amp;gt;/var/www/www&amp;lt;/code&amp;gt; on the new server.&lt;br /&gt;
&lt;br /&gt;
While this command is running, you can do the next two steps in parallel.&lt;br /&gt;
&lt;br /&gt;
=== Copy over SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | ssh root@feministwiki.dev /root/bin/sql&lt;br /&gt;
&lt;br /&gt;
You can use the &amp;lt;code&amp;gt;show databases;&amp;lt;/code&amp;gt; command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the &amp;lt;code&amp;gt;--all-databases&amp;lt;/code&amp;gt; option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
While the above command is still running, you can do the next step in parallel.&lt;br /&gt;
&lt;br /&gt;
=== Copy over LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;There might be incompatible changes between OpenLDAP (aka &amp;lt;code&amp;gt;slapd&amp;lt;/code&amp;gt;) versions which require manual editing of the &amp;lt;code&amp;gt;slapcat&amp;lt;/code&amp;gt; output before it&#039;s read in on the new server with &amp;lt;code&amp;gt;slapadd&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open &amp;lt;code&amp;gt;/etc/ldap/schema/ppolicy.ldif&amp;lt;/code&amp;gt; and search for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt;.  You will note that there is a &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry that defines it, and also it&#039;s listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; attributes block of the &amp;lt;code&amp;gt;olcObjectClasses: ...&amp;lt;/code&amp;gt; entry that defines the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class.&lt;br /&gt;
# On the old server, save the output of &amp;lt;code&amp;gt;slapcat -n 0&amp;lt;/code&amp;gt; to a file, open the file, and search for the block where the &amp;lt;code&amp;gt;ppolicy&amp;lt;/code&amp;gt; schema is defined.  It should start with the line &amp;lt;code&amp;gt;dn: cn={4}ppolicy,cn=schema,cn=config&amp;lt;/code&amp;gt; (the &amp;lt;code&amp;gt;{4}&amp;lt;/code&amp;gt; part might contain a different integer, that&#039;s OK).  There, note that the &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt; is missing, and also it&#039;s not listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list of the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class definition.  Copy over the attribute type definition from the &amp;lt;code&amp;gt;ppolicy.ldif&amp;lt;/code&amp;gt; file on the new server, and amend the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 tar -czf - archives data lists | ssh root@feministwiki.dev &#039;cd /var/lib/mailman &amp;amp;&amp;amp; tar -xzf - &amp;amp;&amp;amp; check_perms -f&#039;&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing the group ownership of the extracted files.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch:&lt;br /&gt;
&lt;br /&gt;
 sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop mariadb&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;&#039;Copying over live data&#039;&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  (For instance, the &amp;lt;code&amp;gt;--delete&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;rsync&amp;lt;/code&amp;gt; command and the &amp;lt;code&amp;gt;--add-drop-database&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;mysqldump&amp;lt;/code&amp;gt; command help to make sure of this.)&lt;br /&gt;
&lt;br /&gt;
So in short, just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;smtp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;xmpp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1154</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1154"/>
		<updated>2021-08-20T00:36:36Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Copy over SQL databases */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;!!! WORK IN PROGRESS !!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup&lt;br /&gt;
 apt-get install certbot&lt;br /&gt;
 apt-get install dnsutils&lt;br /&gt;
 apt-get install emacs&lt;br /&gt;
 apt-get install git&lt;br /&gt;
 apt-get install mg&lt;br /&gt;
 apt-get install moreutils&lt;br /&gt;
 apt-get install net-tools&lt;br /&gt;
 apt-get install nmap&lt;br /&gt;
 apt-get install rsync&lt;br /&gt;
 apt-get install software-properties-common&lt;br /&gt;
 apt-get install tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the &amp;lt;code&amp;gt;.ssh/id_rsa&amp;lt;/code&amp;gt; from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in &amp;lt;code&amp;gt;/root/pwd/meta&amp;lt;/code&amp;gt; on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install apache2&lt;br /&gt;
 apt-get install dovecot-core&lt;br /&gt;
 apt-get install dovecot-imapd&lt;br /&gt;
 apt-get install dovecot-pop3d&lt;br /&gt;
 apt-get install ejabberd # good candidate for backports&lt;br /&gt;
 apt-get install fail2ban&lt;br /&gt;
 apt-get install inspircd&lt;br /&gt;
 apt-get install mailman&lt;br /&gt;
 apt-get install mariadb-server&lt;br /&gt;
 apt-get install opendkim&lt;br /&gt;
 apt-get install php${php_version}&lt;br /&gt;
 apt-get install php${php_version}-mbstring&lt;br /&gt;
 apt-get install php${php_version}-mysql&lt;br /&gt;
 apt-get install php${php_version}-xml&lt;br /&gt;
 apt-get install postfix&lt;br /&gt;
 apt-get install slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in &amp;lt;code&amp;gt;/root/pwd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script makes sure that the cert files are found in &amp;lt;code&amp;gt;/etc/fw-certs&amp;lt;/code&amp;gt; and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes, before shutting down the services on the old server and repeating it to ensure integrity of live data.&lt;br /&gt;
&lt;br /&gt;
=== Copy over /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in &amp;lt;code&amp;gt;/var/www/&amp;lt;/code&amp;gt; is important; if not provided, it will copy the directory to &amp;lt;code&amp;gt;/var/www/www&amp;lt;/code&amp;gt; on the new server.&lt;br /&gt;
&lt;br /&gt;
While this command is running, you can do the next two steps in parallel.&lt;br /&gt;
&lt;br /&gt;
=== Copy over SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | ssh root@feministwiki.dev sql&lt;br /&gt;
&lt;br /&gt;
You can use the &amp;lt;code&amp;gt;show databases;&amp;lt;/code&amp;gt; command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the &amp;lt;code&amp;gt;--all-databases&amp;lt;/code&amp;gt; option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
While the above command is still running, you can do the next step in parallel.&lt;br /&gt;
&lt;br /&gt;
=== Copy over LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;There might be incompatible changes between OpenLDAP (aka &amp;lt;code&amp;gt;slapd&amp;lt;/code&amp;gt;) versions which require manual editing of the &amp;lt;code&amp;gt;slapcat&amp;lt;/code&amp;gt; output before it&#039;s read in on the new server with &amp;lt;code&amp;gt;slapadd&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open &amp;lt;code&amp;gt;/etc/ldap/schema/ppolicy.ldif&amp;lt;/code&amp;gt; and search for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt;.  You will note that there is a &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry that defines it, and also it&#039;s listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; attributes block of the &amp;lt;code&amp;gt;olcObjectClasses: ...&amp;lt;/code&amp;gt; entry that defines the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class.&lt;br /&gt;
# On the old server, save the output of &amp;lt;code&amp;gt;slapcat -n 0&amp;lt;/code&amp;gt; to a file, open the file, and search for the block where the &amp;lt;code&amp;gt;ppolicy&amp;lt;/code&amp;gt; schema is defined.  It should start with the line &amp;lt;code&amp;gt;dn: cn={4}ppolicy,cn=schema,cn=config&amp;lt;/code&amp;gt; (the &amp;lt;code&amp;gt;{4}&amp;lt;/code&amp;gt; part might contain a different integer, that&#039;s OK).  There, note that the &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt; is missing, and also it&#039;s not listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list of the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class definition.  Copy over the attribute type definition from the &amp;lt;code&amp;gt;ppolicy.ldif&amp;lt;/code&amp;gt; file on the new server, and amend the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 tar -czf - archives data lists | ssh root@feministwiki.dev &#039;cd /var/lib/mailman &amp;amp;&amp;amp; tar -xzf - &amp;amp;&amp;amp; check_perms -f&#039;&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing the group ownership of the extracted files.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch:&lt;br /&gt;
&lt;br /&gt;
 sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop mariadb&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;&#039;Copying over live data&#039;&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  (For instance, the &amp;lt;code&amp;gt;--delete&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;rsync&amp;lt;/code&amp;gt; command and the &amp;lt;code&amp;gt;--add-drop-database&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;mysqldump&amp;lt;/code&amp;gt; command help to make sure of this.)&lt;br /&gt;
&lt;br /&gt;
So in short, just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;smtp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;xmpp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1153</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1153"/>
		<updated>2021-08-20T00:35:39Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Copying over live data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;!!! WORK IN PROGRESS !!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup&lt;br /&gt;
 apt-get install certbot&lt;br /&gt;
 apt-get install dnsutils&lt;br /&gt;
 apt-get install emacs&lt;br /&gt;
 apt-get install git&lt;br /&gt;
 apt-get install mg&lt;br /&gt;
 apt-get install moreutils&lt;br /&gt;
 apt-get install net-tools&lt;br /&gt;
 apt-get install nmap&lt;br /&gt;
 apt-get install rsync&lt;br /&gt;
 apt-get install software-properties-common&lt;br /&gt;
 apt-get install tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the &amp;lt;code&amp;gt;.ssh/id_rsa&amp;lt;/code&amp;gt; from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in &amp;lt;code&amp;gt;/root/pwd/meta&amp;lt;/code&amp;gt; on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install apache2&lt;br /&gt;
 apt-get install dovecot-core&lt;br /&gt;
 apt-get install dovecot-imapd&lt;br /&gt;
 apt-get install dovecot-pop3d&lt;br /&gt;
 apt-get install ejabberd # good candidate for backports&lt;br /&gt;
 apt-get install fail2ban&lt;br /&gt;
 apt-get install inspircd&lt;br /&gt;
 apt-get install mailman&lt;br /&gt;
 apt-get install mariadb-server&lt;br /&gt;
 apt-get install opendkim&lt;br /&gt;
 apt-get install php${php_version}&lt;br /&gt;
 apt-get install php${php_version}-mbstring&lt;br /&gt;
 apt-get install php${php_version}-mysql&lt;br /&gt;
 apt-get install php${php_version}-xml&lt;br /&gt;
 apt-get install postfix&lt;br /&gt;
 apt-get install slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in &amp;lt;code&amp;gt;/root/pwd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script makes sure that the cert files are found in &amp;lt;code&amp;gt;/etc/fw-certs&amp;lt;/code&amp;gt; and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes, before shutting down the services on the old server and repeating it to ensure integrity of live data.&lt;br /&gt;
&lt;br /&gt;
=== Copy over /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in &amp;lt;code&amp;gt;/var/www/&amp;lt;/code&amp;gt; is important; if not provided, it will copy the directory to &amp;lt;code&amp;gt;/var/www/www&amp;lt;/code&amp;gt; on the new server.&lt;br /&gt;
&lt;br /&gt;
While this command is running, you can do the next two steps in parallel.&lt;br /&gt;
&lt;br /&gt;
=== Copy over SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministblog \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministsocial \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | ssh root@feministwiki.dev &#039;mysql -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot;&#039;&lt;br /&gt;
&lt;br /&gt;
You can use the &amp;lt;code&amp;gt;show databases;&amp;lt;/code&amp;gt; command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the &amp;lt;code&amp;gt;--all-databases&amp;lt;/code&amp;gt; option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
While the above command is still running, you can do the next step in parallel.&lt;br /&gt;
&lt;br /&gt;
=== Copy over LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;There might be incompatible changes between OpenLDAP (aka &amp;lt;code&amp;gt;slapd&amp;lt;/code&amp;gt;) versions which require manual editing of the &amp;lt;code&amp;gt;slapcat&amp;lt;/code&amp;gt; output before it&#039;s read in on the new server with &amp;lt;code&amp;gt;slapadd&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open &amp;lt;code&amp;gt;/etc/ldap/schema/ppolicy.ldif&amp;lt;/code&amp;gt; and search for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt;.  You will note that there is a &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry that defines it, and also it&#039;s listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; attributes block of the &amp;lt;code&amp;gt;olcObjectClasses: ...&amp;lt;/code&amp;gt; entry that defines the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class.&lt;br /&gt;
# On the old server, save the output of &amp;lt;code&amp;gt;slapcat -n 0&amp;lt;/code&amp;gt; to a file, open the file, and search for the block where the &amp;lt;code&amp;gt;ppolicy&amp;lt;/code&amp;gt; schema is defined.  It should start with the line &amp;lt;code&amp;gt;dn: cn={4}ppolicy,cn=schema,cn=config&amp;lt;/code&amp;gt; (the &amp;lt;code&amp;gt;{4}&amp;lt;/code&amp;gt; part might contain a different integer, that&#039;s OK).  There, note that the &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt; is missing, and also it&#039;s not listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list of the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class definition.  Copy over the attribute type definition from the &amp;lt;code&amp;gt;ppolicy.ldif&amp;lt;/code&amp;gt; file on the new server, and amend the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 tar -czf - archives data lists | ssh root@feministwiki.dev &#039;cd /var/lib/mailman &amp;amp;&amp;amp; tar -xzf - &amp;amp;&amp;amp; check_perms -f&#039;&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing the group ownership of the extracted files.&lt;br /&gt;
&lt;br /&gt;
== Recreate SQL users ==&lt;br /&gt;
&lt;br /&gt;
If the versions of MariaDB on the old and new server are compatible enough, you might be able to dump the {{C|mysql.user}} table and import it on the new server, but it&#039;s safer to recreate the users from scratch:&lt;br /&gt;
&lt;br /&gt;
 sql &amp;lt;&amp;lt; EOF&lt;br /&gt;
 create user blogs@localhost identified by &#039;$(cat ~/pwd/mysql-blogs)&#039;;&lt;br /&gt;
 grant all on blogs.* to blogs@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministfiles@localhost identified by &#039;$(cat ~/pwd/mysql-files)&#039;;&lt;br /&gt;
 grant all on feministfiles.* to feministfiles@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministforum@localhost identified by &#039;$(cat ~/pwd/mysql-forum)&#039;;&lt;br /&gt;
 grant all on feministforum.* to feministforum@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministmail@localhost identified by &#039;$(cat ~/pwd/mysql-mail)&#039;;&lt;br /&gt;
 grant all on feministmail.* to feministmail@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user feministwiki@localhost identified by &#039;$(cat ~/pwd/mysql-wiki)&#039;;&lt;br /&gt;
 grant all on feministwiki.* to feministwiki@localhost;&lt;br /&gt;
 &lt;br /&gt;
 create user fff@localhost identified by &#039;$(cat ~/pwd/mysql-fff)&#039;;&lt;br /&gt;
 grant all on fff.* to fff@localhost;&lt;br /&gt;
 EOF&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop mariadb&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;&#039;Copying over live data&#039;&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  (For instance, the &amp;lt;code&amp;gt;--delete&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;rsync&amp;lt;/code&amp;gt; command and the &amp;lt;code&amp;gt;--add-drop-database&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;mysqldump&amp;lt;/code&amp;gt; command help to make sure of this.)&lt;br /&gt;
&lt;br /&gt;
So in short, just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;smtp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;xmpp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
	<entry>
		<id>https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1152</id>
		<title>FeministWiki:Server setup</title>
		<link rel="alternate" type="text/html" href="https://feministwiki.org/fr/w/index.php?title=FeministWiki:Server_setup&amp;diff=1152"/>
		<updated>2021-08-20T00:12:30Z</updated>

		<summary type="html">&lt;p&gt;Technician : /* Install server components */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;!!! WORK IN PROGRESS !!!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These are the steps required to set up a new FeministWiki Debian server.&lt;br /&gt;
&lt;br /&gt;
== Initial setup of the new server ==&lt;br /&gt;
&lt;br /&gt;
This section describes various initialization tasks for the new server that are independent of the old server.&lt;br /&gt;
&lt;br /&gt;
=== Make feministwiki.dev point to the new server ===&lt;br /&gt;
&lt;br /&gt;
During setup and testing of the new server, we want to make it accessible under the &#039;&#039;&#039;feministwiki.dev&#039;&#039;&#039; domain.  So change the &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry of the feministwiki.dev DNS settings to point to the IP address of the new server.&lt;br /&gt;
&lt;br /&gt;
=== Update &amp;amp; upgrade ===&lt;br /&gt;
&lt;br /&gt;
First of all, let&#039;s make sure the system is up to date.&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
=== Install miscellaneous tools ===&lt;br /&gt;
&lt;br /&gt;
Some of these are needed further down, some are just good to have.&lt;br /&gt;
&lt;br /&gt;
 apt-get install automysqlbackup&lt;br /&gt;
 apt-get install certbot&lt;br /&gt;
 apt-get install dnsutils&lt;br /&gt;
 apt-get install emacs&lt;br /&gt;
 apt-get install git&lt;br /&gt;
 apt-get install mg&lt;br /&gt;
 apt-get install moreutils&lt;br /&gt;
 apt-get install net-tools&lt;br /&gt;
 apt-get install nmap&lt;br /&gt;
 apt-get install rsync&lt;br /&gt;
 apt-get install software-properties-common&lt;br /&gt;
 apt-get install tree&lt;br /&gt;
&lt;br /&gt;
=== Fetch scripts &amp;amp; config repo ===&lt;br /&gt;
  &lt;br /&gt;
Set up GitHub ssh access by copying the &amp;lt;code&amp;gt;.ssh/id_rsa&amp;lt;/code&amp;gt; from the old server.  After that:&lt;br /&gt;
  &lt;br /&gt;
 cd ~&lt;br /&gt;
 git clone git@github.com:FeministWiki/FeministWiki.git repo&lt;br /&gt;
 cp -a repo/root/* repo/root/.??* .&lt;br /&gt;
 sh repo/decrypt-pwd.sh&lt;br /&gt;
&lt;br /&gt;
The decryption script will prompt you for a password the first time it&#039;s used.  Enter the password stored in &amp;lt;code&amp;gt;/root/pwd/meta&amp;lt;/code&amp;gt; on the old server.&lt;br /&gt;
&lt;br /&gt;
=== Set up firewall ===&lt;br /&gt;
&lt;br /&gt;
For now, block everything but SSH.&lt;br /&gt;
&lt;br /&gt;
 apt-get install ufw&lt;br /&gt;
 ufw allow proto tcp to 0.0.0.0/0 port 22&lt;br /&gt;
 ufw enable&lt;br /&gt;
&lt;br /&gt;
=== Enable extra repositories ===&lt;br /&gt;
&lt;br /&gt;
We might want to add some additional package repositories so we can use the latest version of some of the used software.&lt;br /&gt;
&lt;br /&gt;
Backports is always OK to add since the packages don&#039;t get priority over the stable ones:&lt;br /&gt;
&lt;br /&gt;
 echo deb http://deb.debian.org/debian $(lsb_release -sc)-backports main &amp;gt; /etc/apt/sources.list.d/backports.list&lt;br /&gt;
&lt;br /&gt;
PHP repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget -O /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg&lt;br /&gt;
 echo &amp;quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/sury-php.list&lt;br /&gt;
&lt;br /&gt;
MariaDB repo &#039;&#039;&#039;only&#039;&#039;&#039; if a very new version is needed:&lt;br /&gt;
&lt;br /&gt;
 wget https://mariadb.org/mariadb_release_signing_key.asc&lt;br /&gt;
 apt-key add mariadb_release_signing_key.asc&lt;br /&gt;
 rm mariadb_release_signing_key.asc&lt;br /&gt;
 echo &amp;quot;deb http://mirror.23media.de/mariadb/repo/10.4/debian $(lsb_release -sc) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/mariadb.list&lt;br /&gt;
&lt;br /&gt;
=== Install server components ===&lt;br /&gt;
&lt;br /&gt;
Now we can install all the software used for the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 php_version=7.4 # or whatever version we&#039;re on&lt;br /&gt;
 &lt;br /&gt;
 apt-get install apache2&lt;br /&gt;
 apt-get install dovecot-core&lt;br /&gt;
 apt-get install dovecot-imapd&lt;br /&gt;
 apt-get install dovecot-pop3d&lt;br /&gt;
 apt-get install ejabberd # good candidate for backports&lt;br /&gt;
 apt-get install fail2ban&lt;br /&gt;
 apt-get install inspircd&lt;br /&gt;
 apt-get install mailman&lt;br /&gt;
 apt-get install mariadb-server&lt;br /&gt;
 apt-get install opendkim&lt;br /&gt;
 apt-get install php${php_version}&lt;br /&gt;
 apt-get install php${php_version}-mbstring&lt;br /&gt;
 apt-get install php${php_version}-mysql&lt;br /&gt;
 apt-get install php${php_version}-xml&lt;br /&gt;
 apt-get install postfix&lt;br /&gt;
 apt-get install slapd&lt;br /&gt;
&lt;br /&gt;
If any installation asks you for a password, remember that most passwords are found in &amp;lt;code&amp;gt;/root/pwd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Example for installing ejabberd from backports instead:&lt;br /&gt;
&lt;br /&gt;
 apt-get install ejabberd/$(lsb_release -sc)-backports # e.g. ejabberd/buster-backports&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache modules ===&lt;br /&gt;
&lt;br /&gt;
We need a number of Apache modules to be enabled which might not be enabled by default:&lt;br /&gt;
&lt;br /&gt;
 a2enmod expires&lt;br /&gt;
 a2enmod headers&lt;br /&gt;
 a2enmod macro&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 a2enmod ssl&lt;br /&gt;
&lt;br /&gt;
=== Create vmail user ===&lt;br /&gt;
&lt;br /&gt;
 groupadd -g 5000 vmail&lt;br /&gt;
 useradd -u 5000 -g vmail -s /usr/sbin/nologin -d /home/vmail -m vmail&lt;br /&gt;
&lt;br /&gt;
=== Put config files in place ===&lt;br /&gt;
&lt;br /&gt;
The principle is simple: take all the config files from {{C|/root/repo/etc}} and put them where they belong in {{C|/etc}}.  However, since a new server might mean much newer software, it&#039;s possible that some config files aren&#039;t compatible anymore, or that some new sensible defaults might be overwritten by the old config.  Sadly figuring out these incompatibilities is a manual process: compare the new default config with the old default config and to our current config, to figure out what our new config should look like.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a number of things important to remember however:&lt;br /&gt;
* After copying in the new {{C|/etc/aliases}} file, run {{C|newaliases}} for the changes to take effect&lt;br /&gt;
* After populating {{C|/etc/letsencrypt/renewal-hooks}}, remember to {{C|chmod +x}} all the scripts&lt;br /&gt;
&lt;br /&gt;
=== Initialize LetsEncrypt ===&lt;br /&gt;
&lt;br /&gt;
First, initialize the certbot configuration:&lt;br /&gt;
&lt;br /&gt;
 certbot register -n --agree-tos -m technician@feministwiki.org&lt;br /&gt;
&lt;br /&gt;
Since various DNS entries still point to the old server, we can&#039;t get a cert for the real domains yet.  For now, just get one for feministwiki.dev:&lt;br /&gt;
&lt;br /&gt;
 ufw allow 80&lt;br /&gt;
 letsencrypt-refresh --dev-only&lt;br /&gt;
 ufw delete allow 80&lt;br /&gt;
&lt;br /&gt;
Our &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script makes sure that the cert files are found in &amp;lt;code&amp;gt;/etc/fw-certs&amp;lt;/code&amp;gt; and that the private key and cert-and-key bundle are owned by the &amp;quot;ssl-cert&amp;quot; group and are readable by group members.  A number of users have to be added to this group so they can read said files:&lt;br /&gt;
&lt;br /&gt;
 adduser ejabberd ssl-cert&lt;br /&gt;
 adduser irc ssl-cert&lt;br /&gt;
&lt;br /&gt;
== Copying over live data ==&lt;br /&gt;
&lt;br /&gt;
We want to make a first run of this copy process purely for testing purposes, before shutting down the services on the old server and repeating it to ensure integrity of live data.&lt;br /&gt;
&lt;br /&gt;
=== Copy over /var/www ===&lt;br /&gt;
&lt;br /&gt;
This is very simple but takes a lot of time to finish.  &#039;&#039;&#039;Run it from the old server:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rsync -a --delete /var/www/ root@feministwiki.dev:/var/www&lt;br /&gt;
&lt;br /&gt;
Note that the trailing slash in &amp;lt;code&amp;gt;/var/www/&amp;lt;/code&amp;gt; is important; if not provided, it will copy the directory to &amp;lt;code&amp;gt;/var/www/www&amp;lt;/code&amp;gt; on the new server.&lt;br /&gt;
&lt;br /&gt;
While this command is running, you can do the next two steps in parallel.&lt;br /&gt;
&lt;br /&gt;
=== Copy over SQL databases ===&lt;br /&gt;
&lt;br /&gt;
Run the following command from the old server:&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot; \&lt;br /&gt;
   --add-drop-database \&lt;br /&gt;
   --databases blogs \&lt;br /&gt;
               feministblog \&lt;br /&gt;
               feministfiles \&lt;br /&gt;
               feministforum \&lt;br /&gt;
               feministmail \&lt;br /&gt;
               feministsocial \&lt;br /&gt;
               feministwiki \&lt;br /&gt;
               feministwiki_de \&lt;br /&gt;
               feministwiki_es \&lt;br /&gt;
               feministwiki_it \&lt;br /&gt;
               feministwiki_pt \&lt;br /&gt;
               fff \&lt;br /&gt;
   | ssh root@feministwiki.dev &#039;mysql -u root -p&amp;quot;$(cat /root/pwd/mysql)&amp;quot;&#039;&lt;br /&gt;
&lt;br /&gt;
You can use the &amp;lt;code&amp;gt;show databases;&amp;lt;/code&amp;gt; command in the SQL console to make sure that the list of databases is complete.  Unfortunately they have to be listed manually, because using the &amp;lt;code&amp;gt;--all-databases&amp;lt;/code&amp;gt; option includes system databases that we don&#039;t want to copy.&lt;br /&gt;
&lt;br /&gt;
While the above command is still running, you can do the next step in parallel.&lt;br /&gt;
&lt;br /&gt;
=== Copy over LDAP databases ===&lt;br /&gt;
&lt;br /&gt;
Stop the LDAP server and delete the existing configuration and data &#039;&#039;&#039;on the new server (careful!)&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # Commands to run on the NEW (fresh) server:&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
 rm -r /etc/ldap/slapd.d/*&lt;br /&gt;
 rm /var/lib/ldap/data.mdb&lt;br /&gt;
&lt;br /&gt;
Then copy over the config and data by running these commands from the old server:&lt;br /&gt;
&lt;br /&gt;
 slapcat -n 0 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 0 -F /etc/ldap/slapd.d&#039;&lt;br /&gt;
 slapcat -n 1 | ssh feministwiki.dev &#039;sudo -u openldap slapadd -n 1&#039;&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;There might be incompatible changes between OpenLDAP (aka &amp;lt;code&amp;gt;slapd&amp;lt;/code&amp;gt;) versions which require manual editing of the &amp;lt;code&amp;gt;slapcat&amp;lt;/code&amp;gt; output before it&#039;s read in on the new server with &amp;lt;code&amp;gt;slapadd&amp;lt;/code&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s one example that occurs when updating from OpenLDAP 2.4.42 or earlier to 2.4.43 or later: the ppolicy overlay has a new attribute in the newer version, so if you simply run the commands above, the first one (the one that copies the config database) will produce the following error message:&lt;br /&gt;
&lt;br /&gt;
 User Schema load failed for attribute &amp;quot;pwdMaxRecordedFailure&amp;quot;. Error code 17: attribute type undefined&lt;br /&gt;
&lt;br /&gt;
The solution is as follows:&lt;br /&gt;
&lt;br /&gt;
# On the new server, open &amp;lt;code&amp;gt;/etc/ldap/schema/ppolicy.ldif&amp;lt;/code&amp;gt; and search for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt;.  You will note that there is a &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry that defines it, and also it&#039;s listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; attributes block of the &amp;lt;code&amp;gt;olcObjectClasses: ...&amp;lt;/code&amp;gt; entry that defines the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class.&lt;br /&gt;
# On the old server, save the output of &amp;lt;code&amp;gt;slapcat -n 0&amp;lt;/code&amp;gt; to a file, open the file, and search for the block where the &amp;lt;code&amp;gt;ppolicy&amp;lt;/code&amp;gt; schema is defined.  It should start with the line &amp;lt;code&amp;gt;dn: cn={4}ppolicy,cn=schema,cn=config&amp;lt;/code&amp;gt; (the &amp;lt;code&amp;gt;{4}&amp;lt;/code&amp;gt; part might contain a different integer, that&#039;s OK).  There, note that the &amp;lt;code&amp;gt;olcAttributeTypes: ...&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;pwdMaxRecordedFailure&amp;lt;/code&amp;gt; is missing, and also it&#039;s not listed in the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list of the &amp;lt;code&amp;gt;pwdPolicy&amp;lt;/code&amp;gt; object class definition.  Copy over the attribute type definition from the &amp;lt;code&amp;gt;ppolicy.ldif&amp;lt;/code&amp;gt; file on the new server, and amend the &amp;lt;code&amp;gt;MAY&amp;lt;/code&amp;gt; list to include it.&lt;br /&gt;
&lt;br /&gt;
The above is explained only for instructive purposes, since this particular fix will already have been applied by the time someone reads this guide.  It&#039;s meant to give you an idea as to how backwards incompatible changes in OpenLDAP schema files can be amended when migrating to a newer version.  (Also, no such clear explanation of the fix seems to be found anywhere on the web, so maybe someone who searches the error message above will come upon this guide and be happy!)&lt;br /&gt;
&lt;br /&gt;
=== Mailman data ===&lt;br /&gt;
&lt;br /&gt;
GNU Mailman uses a filesystem-based &amp;quot;database&amp;quot; so we can transfer over its data as follows; run this from the old server:&lt;br /&gt;
&lt;br /&gt;
 cd /var/lib/mailman&lt;br /&gt;
 tar -czf - archives data lists | ssh root@feministwiki.dev &#039;cd /var/lib/mailman &amp;amp;&amp;amp; tar -xzf - &amp;amp;&amp;amp; check_perms -f&#039;&lt;br /&gt;
&lt;br /&gt;
The {{C|check_perms}} command, which is part of GNU Mailman, will take care of fixing the group ownership of the extracted files.&lt;br /&gt;
&lt;br /&gt;
== Test ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to test the new server to make sure everything works well!&lt;br /&gt;
&lt;br /&gt;
=== Reboot ===&lt;br /&gt;
&lt;br /&gt;
We could restart a lot of services manually to ensure they&#039;ve read their new config, but it&#039;s easiest to just reboot.  (The new server, obviously.)&lt;br /&gt;
&lt;br /&gt;
=== Open ports ===&lt;br /&gt;
&lt;br /&gt;
We need to open all the ports used by the various FeministWiki services:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Test! ===&lt;br /&gt;
&lt;br /&gt;
At this point you should test everything using the feministwiki.dev domain name.&lt;br /&gt;
&lt;br /&gt;
Some things may not work because they&#039;re hard-coded to work as &amp;quot;feministwiki.org&amp;quot; and not under the &amp;quot;feministwiki.dev&amp;quot; name.  This is a point of future improvement: all the services should be configured, if at all possible, in a way that they will work when invoked as feministwiki.dev just as well.&lt;br /&gt;
&lt;br /&gt;
== Finishing up ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now, all services on the old server should be stopped, because we will begin the final transfer of live data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Stop services on the old server ===&lt;br /&gt;
&lt;br /&gt;
Stop all the services that interface with users and/or are responsible for modifying live data:&lt;br /&gt;
&lt;br /&gt;
 systemctl stop apache2&lt;br /&gt;
 systemctl stop dovecot&lt;br /&gt;
 systemctl stop ejabberd&lt;br /&gt;
 systemctl stop inspircd&lt;br /&gt;
 systemctl stop mailman&lt;br /&gt;
 systemctl stop mariadb&lt;br /&gt;
 systemctl stop postfix&lt;br /&gt;
 systemctl stop slapd&lt;br /&gt;
&lt;br /&gt;
Close all the relevant ports just to be double-sure:&lt;br /&gt;
&lt;br /&gt;
 for port in 25 80 443 465 587 993 995 5222 5223 5269 5270 5443 6697 7777&lt;br /&gt;
 do ufw delete allow proto tcp to 0.0.0.0/0 port $port&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
=== Copy over the live data one more time ===&lt;br /&gt;
&lt;br /&gt;
The techniques and commands described above in the section &#039;&#039;&#039;Copying over live data&#039;&#039;&#039; are &#039;&#039;idempotent&#039;&#039;, meaning you can simply repeat them and they will make sure that the new copy of the live data is fresh and doesn&#039;t leave any outdated data on the new server.  (For instance, the &amp;lt;code&amp;gt;--delete&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;rsync&amp;lt;/code&amp;gt; command and the &amp;lt;code&amp;gt;--add-drop-database&amp;lt;/code&amp;gt; argument to the &amp;lt;code&amp;gt;mysqldump&amp;lt;/code&amp;gt; command help to make sure of this.)&lt;br /&gt;
&lt;br /&gt;
So in short, just repeat the steps from that section exactly one more time.&lt;br /&gt;
&lt;br /&gt;
=== Update DNS entries ===&lt;br /&gt;
&lt;br /&gt;
You have to change the configuration of the following domains:&lt;br /&gt;
&lt;br /&gt;
* feministwiki.org&lt;br /&gt;
* feministwiki.net&lt;br /&gt;
* feministwiki.de&lt;br /&gt;
* fem.wiki&lt;br /&gt;
* fffrauen.de&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.org ====&lt;br /&gt;
&lt;br /&gt;
You only have to change three DNS entries, since most of the subdomains work via CNAME entries:&lt;br /&gt;
&lt;br /&gt;
* The main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;@&amp;lt;/code&amp;gt; (self-reference i.e. feministwiki.org)&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;smtp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
* The &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry for &amp;lt;code&amp;gt;xmpp&amp;lt;/code&amp;gt; since this is not allowed to be a CNAME&lt;br /&gt;
&lt;br /&gt;
==== feministwiki.net, feministwiki.de, fem.wiki, fffrauen.de ====&lt;br /&gt;
&lt;br /&gt;
For these, you only have to change the main &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; entry, since they don&#039;t use SMTP or XMPP.&lt;br /&gt;
&lt;br /&gt;
=== Update the certificate ===&lt;br /&gt;
&lt;br /&gt;
Run the &amp;lt;code&amp;gt;letsencrypt-refresh&amp;lt;/code&amp;gt; script to get a new certificate which includes all our domain names, since we had started out with just feministwiki.dev.&lt;br /&gt;
&lt;br /&gt;
After this, everything should be functional.  If not, it&#039;s time for some debugging!&lt;/div&gt;</summary>
		<author><name>Technician</name></author>
	</entry>
</feed>