Categories
Web Server

Plesk AH02291: Cannot access directory for error log

plesk repair fs example.com -y
mkdir /var/www/vhosts/system/example.com/logs/
chmod 700 /var/www/vhosts/system/example.com/logs/
chown psaadm:root /var/www/vhosts/system/example.com/logs/
rm -rf /var/www/vhosts/example.com/logs
plesk db "select name, login from domains join hosting on domains.id=hosting.dom_id join sys_users on hosting.sys_user_id=sys_users.id where name='example.com'";
+-------------+-------+
| name        | login |
+-------------+-------+
| example.com | jdoe  |
+-------------+-------+
plesk sbin relink-vhost-logs --domain-name example.com --sys-user-login jdoe --create

CentOS/RHEL

service httpd start
service nginx start

Debian/Ubuntu

service apache2 start
service nginx start
Categories
Web Server

Change Hosts File

Linux and Mac

sudo nano /etc/hosts
127.0.0.1   localhost
YOUR_SERVER_IP yourdomain.com

Windows

Open c:\Windows\System32\Drivers\etc\hosts ( right click, run as administrator )

127.0.0.1   localhost
YOUR_SERVER_IP yourdomain.com
Categories
Web Server

Apache Prefork vs Worker

Prefork

Every request gets its own (memory-separated) process

Worker

Multi-threaded Apache, uses threads instead of processes, is generally faster than prefork and might use less memory

In regards to PHP

As PHP is not thread-safe, the common suggestion is to install Apache with the “prefork” MPM.

Reference: http://www.php.net/manual/en/faq.installation.php#faq.installation.apache2

Note: Debian will automatically choose the right Apache version if you’re installing PHP.

Differences between Apache MPMs

http://httpd.apache.org/docs/2.0/en/mod/#core

Categories
WordPress

Debian WordPress Permalink

404 Not found Error fix

Add the below code in /etc/apache2/apache2.conf

<Directory /var/www/html/>
AllowOverride All
</Directory>
sudo a2enmod rewrite
sudo systemctl restart apache2
Categories
Web Server

Integrating PHP in Apache

To enable PHP in Apache add the following to httpd.conf and restart Apache:

LoadModule php7_module /usr/local/opt/php/lib/httpd/modules/libphp7.so
    <FilesMatch \.php$>
        SetHandler application/x-httpd-php
    </FilesMatch>

Finally, check DirectoryIndex includes index.php

DirectoryIndex index.php index.html

The php.ini and php-fpm.ini file can be found in:

/usr/local/etc/php/7.4/