Login CakePHP 4 script

CakePHP 4 , login biasanya menggunakan Authentication plugin . Berikut alurnya: 1. Install Authentication Plugin Jalankan di terminal: composer require cakephp/authentication 2. Load Plugin di Application.php Di file src/Application.php , tambahkan: $this->addPlugin('Authentication'); 3. Middleware Authentication Masih di Application.php , tambahkan ke middleware() : use Authentication\Middleware\AuthenticationMiddleware; $middlewareQueue->add(new AuthenticationMiddleware($this)); 4. Konfigurasi Authentication Di src/Application.php , dalam method getAuthenticationService() : use Authentication\AuthenticationService; use Authentication\AuthenticationServiceInterface; use Authentication\Identifier\IdentifierInterface; use Authentication\Middleware\AuthenticationMiddleware; use Psr\Http\Message\ServerRequestInterface; public function getAuthenticationService(ServerRequestInterface $request): AuthenticationServiceInterface { $service = new Authenticatio...

how to install and configure Apache HTTPD on CentOS /Red-Hat:

here's a step-by-step guide on 

1. Log in to your CentOS /Red-Hat server as a root user.

2. Update the package repository cache by running the following command: 
```
yum -y update
```

3. Install the Apache HTTPD package by running the following command: 
```
yum -y install httpd
```

4. Once the installation is complete, start the Apache service and enable it to start automatically on boot by running the following commands:
```
systemctl start httpd
systemctl enable httpd
```

5. To verify that Apache HTTPD is installed and running properly, open a web browser and navigate to your server's IP address. You should see the default Apache HTTPD page.

6. Next, configure the Apache HTTPD server by editing the main configuration file `/etc/httpd/conf/httpd.conf` using a text editor such as nano or vim.

7. Within the configuration file, you can modify settings such as the server name, document root, and access control. Some common configuration changes include:
- Changing the server name by modifying the `ServerName` directive.
- Changing the document root by modifying the `DocumentRoot` directive.
- Adding or modifying access control directives to restrict or allow access to certain directories or files.

8. Once you have made your changes, save and close the configuration file.

9. Test your Apache configuration by running the following command:
```
httpd -t
```
If there are no errors, you should see a message stating that the configuration is OK.

10. Restart the Apache service to apply the changes you have made by running the following command:
```
systemctl restart httpd
```

That's it! You have now installed and configured Apache HTTPD on your CentOS / Red-Hat server.





 

Comments