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
Linux

Jenkins Centos Systemctl Automatic Restart

sudo nano /etc/systemd/system/jenkins.service

Paste the below code in /etc/systemd/system/jenkins.service
Ctrl + O to save
Ctrl + X to exit

[Unit]
Description=Jenkins Server Daemon
Wants=network-online.target
After=network-online.target

[Service]
ExecStart=/etc/init.d/jenkins start
Restart=always
RestartSec=3
Type=forking

[Install]
WantedBy=multi-user.target
sudo systemctl enable jenkins.service

To check the list

chkconfig --list
Categories
Apache

Apache2 Handler Configuration

apache2handler

Apache VersionApache/2.0.23 (Debian)
Apache API Version20110210
Server Administratoremail@example.com
Hostname:Portexample.com:0
User/Groupwww-data(33)/33
Max RequestsPer Child: 0 – Keep Alive: on – Max Per Connection: 100
TimeoutsConnection: 300 – Keep-Alive: 5
Virtual ServerYes
Server Root/etc/apache2
Loaded Modulescore mod_so mod_watchdog http_core
mod_log_config mod_logio mod_version mod_unixd
mod_access_compat mod_alias mod_auth_basic
mod_authn_core mod_authn_file mod_authz_core
mod_authz_host mod_authz_user mod_autoindex
mod_deflate mod_dir mod_env mod_fcgid mod_filter
mod_headers mod_mime prefork mod_negotiation
mod_php7 mod_proxy mod_proxy_fcgi
mod_reqtimeout mod_rewrite mod_setenvif
mod_socache_shmcb mod_ssl mod_status
DirectiveLocal ValueMaster Value
engine11
last_modified00
xbithack00
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