Running Drupal in Docker

I will assume that you have already installed docker. If you haven't installed docker please visit https://www.docker.com/ to download and install docker for your platform.

Running Drupal in Docker

Drupal requires MySql to function. So before deploying docker you need to deploy a docker instance of MySql/MariaDB. To deploy a MySql Instance on Docker issue the following command

docker run --name mysql -e MYSQL_ROOT_PASSWORD=yourpassword -p 3306:3306 -d mysql:latest

This will deploy the MySql Docker instance

Deploy Drupal Container

docker run --name drupal --link MYSQL-NAME:mysql -p 8000:80 -e MYSQL_USER=root -e MYSQL_PASSWORD=yourpassword -d drupal

This will deploy the Drupal container. Match the MySql credentials to the above command. You can visit the container by visiting http://localhost:8000 or http://YOUR_IP_ADDRESS:8000

In Drupal during installation go to advanced options in Database setup and set the host to the container name of mysql, which in the above case is mysql

Explanation of switches

--name=the name of the instance. You can give it any name you want
-d Run in detached mode
-p Map ports of docker container to local ports
-e Set environment Variables

If you already have images of mysql and drupal

Create a Network by issuing the following command

docker network create drupalnet
docker run --name mysql -e MYSQL_ROOT_PASSWORD=password -p 3306:3306 --net=netw -d mysql:latest
docker run --name drupal -p 8000:80 --net=netw -d drupal:latest

This will create a Network and connect the two containers together.

For learning more about Drupal Visit Getting Started with Drupal. For more information on Drupal on Docker visit Drupal in docker hub.

Hope you find it useful

test table

Pos Team Matches Points Rating
1 India 29 3434 118
2 Australia 30 3534 118
3 England 43 4941 115
4 South Africa 21 2182 104
5 New Zealand 23 2291 100
6 Pakistan 25 2304 92
7 Sri Lanka 27 2123 79
8 West Indies 28 2154 77
9 Bangladesh 19 873 46
10 Zimbabwe 7 223 32

Apache Rewrite What It Is and How to Use It

Apache Rewrite: What It Is and How to Use It

If you have been working with Apache web server for a while, you may have heard of the term "rewrite". Apache rewrite is a powerful module that allows you to manipulate URLs as they are requested by clients, and it can be used for a variety of purposes such as redirecting old URLs to new ones, enforcing SSL on certain pages, or even customizing URLs for SEO purposes.

In this post, we will go over what Apache rewrite is, how it works, and provide examples of common use cases.

What is Apache Rewrite?

Apache rewrite is a module that is included with the Apache web server. It is used to manipulate URLs as they are requested by clients. It can be used to redirect URLs, add or remove query string parameters, and even modify the contents of a URL.

How Does Apache Rewrite Work?

Apache rewrite works by using regular expressions to match the requested URL against a set of rules. These rules are defined in a configuration file, usually called ".htaccess", which is placed in the root directory of your website.

When a client requests a URL, Apache checks the rules in the .htaccess file to see if any of them apply to the requested URL. If a rule matches, Apache applies the rewrite and sends the new URL back to the client.

Common Use Cases for Apache Rewrite

Redirecting Old URLs to New Ones

One of the most common use cases for Apache rewrite is to redirect old URLs to new ones. This can be useful if you have changed the structure of your website and want to ensure that users can still find the content they are looking for.

For example, let's say you had a page on your website with the URL "http://www.example.com/products.php?id=123". You have now changed the structure of your website, and the same page is now located at "http://www.example.com/products/123". To redirect users who have bookmarked the old URL, you can use the following rule in your .htaccess file:



 ZEENUX

This rule will match any URL that contains the query string parameter "id=123" and redirect it to the new URL "/products/123".

Enforcing SSL on Certain Pages

If you have pages on your website that require a secure connection, you can use Apache rewrite to enforce SSL on those pages. This can be useful if you are collecting sensitive information from users, such as credit card numbers or personal information.

To enforce SSL on a specific page, you can use the following rule in your .htaccess file:
This rule will match any URL that contains the string "/checkout" and redirect it to the same URL with "https://" instead of "http://".

Customizing URLs for SEO Purposes

Apache rewrite can also be used to customize URLs for SEO purposes. For example, you may want to remove query string parameters from your URLs, or add keywords to your URLs to improve search engine rankings.

To remove query string parameters from your URLs, you can use the following rule:

This rule will match any URL that does not contain a query string and remove it.

 

Permanent Revolution Theory

The theory of Permanent Revolution is a key aspect of Marxist thought that was developed by Leon Trotsky. It challenges the traditional Marxist belief that socialist revolution could only occur in advanced capitalist countries, such as England, France, or Germany. Instead, Trotsky argued that socialist revolution could also occur in underdeveloped countries, such as Russia, where the capitalist class was weak and the working class was large.


First developed during the Russian Revolution of 1905. Trotsky, who played a leading role in the revolution, began to question the traditional Marxist view that socialist revolution could only occur in advanced capitalist countries. He believed that the weakness of the capitalist class in Russia meant that the working class would have to carry out a socialist revolution, rather than a bourgeois revolution, which was necessary to create the conditions for socialism in advanced capitalist countries.


In his 1906 pamphlet "Results and Prospects," Trotsky argued that the working class in underdeveloped countries could not rely on the bourgeoisie to carry out a bourgeois revolution. Instead, the working class would have to carry out a socialist revolution, which would involve the expropriation of the capitalist class and the establishment of a workers' state.


The theory of Permanent Revolution challenged the view of Vladimir Lenin, who believed that socialist revolution could only occur after a bourgeois revolution had taken place in underdeveloped countries. Lenin argued that the working class in underdeveloped countries had to first carry out a bourgeois revolution, which would create the conditions for socialism. Only after the bourgeois revolution was completed could the working class carry out a socialist revolution.


Despite his disagreements with Trotsky, Lenin recognized the significance of the theory of Permanent Revolution. He wrote that "the idea of permanent revolution… contains a great deal of indisputable truth" and that "it is in essence an anticipation of the further development of the revolution."


Trotsky continued to develop the theory of Permanent Revolution over time. In 1915, he argued that the First World War had created the conditions for socialist revolution. He claimed that the war had exposed the contradictions of capitalism and had created a revolutionary situation in which the working class could carry out a socialist revolution.


In 1920, Trotsky published "Terrorism and Communism," in which he laid out his ideas on the stages theory of Permanent Revolution. According to the stages theory, the working class would first carry out a bourgeois revolution, which would expropriate the feudal and capitalist classes and establish a democratic republic. The working class would then use this democratic republic to carry out socialist measures, such as the nationalization of the means of production and the establishment of workers' control over the economy.


The theory of Permanent Revolution had a significant impact on the history of socialist thought. It challenged the traditional Marxist view that socialist revolution could only occur in advanced capitalist countries. It argued that the working class in underdeveloped countries could play a leading role in the struggle for socialism. The theory of Permanent Revolution remains an important aspect of Marxist theory and continues to be debated and developed by Marxist thinkers today.


Importance of Theory of Permanent Revolution

The theory of Permanent Revolution is a significant aspect of Marxist thought that has had a lasting impact on socialist theory and practice. It challenged the traditional Marxist view that socialist revolution could only occur in advanced capitalist countries, and instead argued that the working class in underdeveloped countries could play a leading role in the struggle for socialism.


One of the key contributions of the theory of Permanent Revolution was its recognition that the working class in underdeveloped countries could not rely on the bourgeoisie to carry out a bourgeois revolution. Instead, the working class would have to carry out a socialist revolution, which would involve the expropriation of the capitalist class and the establishment of a workers' state. This was a significant departure from the traditional Marxist view, which saw the bourgeois revolution as a necessary precondition for socialist revolution.


The theory of Permanent Revolution also challenged the idea that socialist revolution could only occur after a period of capitalist development had taken place. Trotsky argued that the contradictions of capitalism were present in all societies, regardless of their level of development. He believed that the working class could use these contradictions to create a revolutionary situation, regardless of the level of capitalist development in their society.


The theory of Permanent Revolution had a significant impact on the history of socialist thought and practice. It played a key role in the Russian Revolution of 1917, which saw the working class take power and establish a socialist state. Trotsky's ideas also influenced the development of socialist movements in other parts of the world, such as China, Cuba, and Vietnam.


The theory of Permanent Revolution also had implications for the way that socialist revolution was understood. It challenged the traditional view that socialist revolution was a one-time event that occurred after a period of capitalist development. Instead, it argued that socialist revolution was a process that involved the transformation of social relations and the establishment of a new mode of production.


Finally, the theory of Permanent Revolution remains an important aspect of Marxist theory and continues to be debated and developed by Marxist thinkers today. It offers a powerful critique of traditional Marxist thought and provides an alternative vision of socialist revolution that emphasizes the importance of the working class and the struggle for socialism in underdeveloped countries.





Running Drupal in Docker

I will assume that you have already installed docker. If you haven't installed docker please visit https://www.docker.com/ to download a...