PHP.INI reading sequence

I have following idea – add some changed values configuration lines on top (or bootom) of php.ini file, so I keep original values untouched. Where should I put them. Is this order same with other Linux config files.

PHP.INI file

[PHP]
; My changed configuration lines before original php.ini settings
expose_php = Off

;;;;;;;;;;;;;;;;;;;
; About php.ini   ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
...
...
...


Source: stackoverflow-php

Ubuntu VPS Apache2 crashed when tried to add new website

I want to host multiple websites on my Ubuntu 16.04 VPS. The first thing I did was setting the DNS A records to my VPS. Then I went into /var/www/ and created a new folder named ictopdrachten.net, where I uploaded my files for my website. Gave apache the correct rights with the command

sudo chown www-data:www-data * -R

Then I went here

cd /etc/apache2/sites-available
sudo cp default-ssl.conf ict-opdrachten.net.conf

And edited the new file

 ServerAdmin webmaster@localhost
            ServerName ictopdrachten.net
            ServerAlias www.ictopdrachten.net

            DocumentRoot /var/www/ictopdrachten.net

Then did

sudo a2ensite ict-opdrachten.net

and then I tried restarting the apache service. Then when I opened up my domain it went to /var/www/html/ and not /var/www/ictopdrachten.net , so I thought maybe I should fix those names I gave the files, because some are named ict-opdrachten.net and some ictopdrachten.net.

Well then I tried restarting the apache service, and it gave me this error:

Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.

Output of systemctl status apache2.service

beheer@136-144-131-27:/var/www/html$ sudo systemctl status apache2.service
apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
       └─apache2-systemd.conf
Active: failed (Result: exit-code) since Wed 2017-02-15 11:16:49 CET; 39s ago
 Docs: man:systemd-sysv-generator(8)
Process: 25794 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
Process: 25337 ExecReload=/etc/init.d/apache2 reload (code=exited, status=0/SUCCESS)
Process: 26118 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)

Feb 15 11:16:49 136-144-131-27 apache2[26118]:  * The apache2 configtest failed.
Feb 15 11:16:49 136-144-131-27 apache2[26118]: Output of config test was:
Feb 15 11:16:49 136-144-131-27 apache2[26118]: [Wed Feb 15 11:16:49.548025 2017] [:crit] [pid 26128:tid 139741895636864] Apache is running a threaded MPM, bu
Feb 15 11:16:49 136-144-131-27 apache2[26118]: AH00013: Pre-configuration failed
Feb 15 11:16:49 136-144-131-27 apache2[26118]: Action 'configtest' failed.
Feb 15 11:16:49 136-144-131-27 apache2[26118]: The Apache error log may have more information.
Feb 15 11:16:49 136-144-131-27 systemd[1]: apache2.service: Control process exited, code=exited status=1
Feb 15 11:16:49 136-144-131-27 systemd[1]: Failed to start LSB: Apache2 web server.
Feb 15 11:16:49 136-144-131-27 systemd[1]: apache2.service: Unit entered failed state.
Feb 15 11:16:49 136-144-131-27 systemd[1]: apache2.service: Failed with result 'exit-code'.

and the output for journalctl -xe

Feb 15 11:18:02 136-144-131-27 sshd[26146]: Disconnected from 112.85.42.110 port 19762 [preauth]
Feb 15 11:18:02 136-144-131-27 sshd[26146]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=112.85.42.110  user=root
Feb 15 11:18:02 136-144-131-27 sshd[26142]: Failed password for root from 223.99.60.45 port 12921 ssh2
Feb 15 11:18:06 136-144-131-27 sshd[26142]: Failed password for root from 223.99.60.45 port 12921 ssh2
Feb 15 11:18:06 136-144-131-27 sshd[26142]: error: maximum authentication attempts exceeded for root from 223.99.60.45 port 12921 ssh2 [preauth]
Feb 15 11:18:06 136-144-131-27 sshd[26142]: Disconnecting: Too many authentication failures [preauth]
Feb 15 11:18:06 136-144-131-27 sshd[26142]: PAM 5 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=223.99.60.45  user=root
Feb 15 11:18:06 136-144-131-27 sshd[26142]: PAM service(sshd) ignoring max retries; 6 > 3
Feb 15 11:18:16 136-144-131-27 sshd[26148]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=223.99.60.45  user=root
Feb 15 11:18:18 136-144-131-27 sshd[26148]: Failed password for root from 223.99.60.45 port 41460 ssh2
Feb 15 11:18:21 136-144-131-27 sshd[26148]: Failed password for root from 223.99.60.45 port 41460 ssh2
Feb 15 11:18:24 136-144-131-27 sshd[26148]: Failed password for root from 223.99.60.45 port 41460 ssh2
Feb 15 11:18:27 136-144-131-27 sshd[26148]: Failed password for root from 223.99.60.45 port 41460 ssh2
Feb 15 11:18:30 136-144-131-27 sshd[26148]: Failed password for root from 223.99.60.45 port 41460 ssh2
Feb 15 11:18:33 136-144-131-27 sshd[26148]: Failed password for root from 223.99.60.45 port 41460 ssh2
Feb 15 11:18:33 136-144-131-27 sshd[26148]: error: maximum authentication attempts exceeded for root from 223.99.60.45 port 41460 ssh2 [preauth]
Feb 15 11:18:33 136-144-131-27 sshd[26148]: Disconnecting: Too many authentication failures [preauth]
Feb 15 11:18:33 136-144-131-27 sshd[26148]: PAM 5 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=223.99.60.45  user=root
Feb 15 11:18:33 136-144-131-27 sshd[26148]: PAM service(sshd) ignoring max retries; 6 > 3
Feb 15 11:18:39 136-144-131-27 sshd[26152]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=112.85.42.110  user=root
Feb 15 11:18:42 136-144-131-27 sshd[26152]: Failed password for root from 112.85.42.110 port 44665 ssh2
Feb 15 11:18:44 136-144-131-27 sshd[26152]: Failed password for root from 112.85.42.110 port 44665 ssh2
Feb 15 11:18:44 136-144-131-27 sshd[26150]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=223.99.60.45  user=root
Feb 15 11:18:46 136-144-131-27 sshd[26150]: Failed password for root from 223.99.60.45 port 62617 ssh2
Feb 15 11:18:47 136-144-131-27 sshd[26152]: Failed password for root from 112.85.42.110 port 44665 ssh2
Feb 15 11:18:47 136-144-131-27 sshd[26152]: Received disconnect from 112.85.42.110 port 44665:11:  [preauth]
Feb 15 11:18:47 136-144-131-27 sshd[26152]: Disconnected from 112.85.42.110 port 44665 [preauth]
Feb 15 11:18:47 136-144-131-27 sshd[26152]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=112.85.42.110  user=root
Feb 15 11:18:49 136-144-131-27 sshd[26150]: Failed password for root from 223.99.60.45 port 62617 ssh2
Feb 15 11:18:50 136-144-131-27 sshd[26154]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=116.31.116.38  user=root
Feb 15 11:18:53 136-144-131-27 sshd[26150]: Failed password for root from 223.99.60.45 port 62617 ssh2
Feb 15 11:18:53 136-144-131-27 sshd[26154]: Failed password for root from 116.31.116.38 port 61818 ssh2
Feb 15 11:18:55 136-144-131-27 sshd[26154]: Failed password for root from 116.31.116.38 port 61818 ssh2
Feb 15 11:18:55 136-144-131-27 sshd[26150]: Failed password for root from 223.99.60.45 port 62617 ssh2
Feb 15 11:18:57 136-144-131-27 sshd[26154]: Failed password for root from 116.31.116.38 port 61818 ssh2
Feb 15 11:18:57 136-144-131-27 sshd[26154]: Received disconnect from 116.31.116.38 port 61818:11:  [preauth]
Feb 15 11:18:57 136-144-131-27 sshd[26154]: Disconnected from 116.31.116.38 port 61818 [preauth]
Feb 15 11:18:57 136-144-131-27 sshd[26154]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=116.31.116.38  user=root
Feb 15 11:18:58 136-144-131-27 sshd[26150]: Failed password for root from 223.99.60.45 port 62617 ssh2
Feb 15 11:19:01 136-144-131-27 sshd[26150]: Failed password for root from 223.99.60.45 port 62617 ssh2
Feb 15 11:19:01 136-144-131-27 sshd[26150]: error: maximum authentication attempts exceeded for root from 223.99.60.45 port 62617 ssh2 [preauth]
Feb 15 11:19:01 136-144-131-27 sshd[26150]: Disconnecting: Too many authentication failures [preauth]
Feb 15 11:19:01 136-144-131-27 sshd[26150]: PAM 5 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=223.99.60.45  user=root
Feb 15 11:19:01 136-144-131-27 sshd[26150]: PAM service(sshd) ignoring max retries; 6 > 3
Feb 15 11:19:12 136-144-131-27 sshd[26156]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=223.99.60.45  user=root
Feb 15 11:19:14 136-144-131-27 sshd[26156]: Failed password for root from 223.99.60.45 port 28917 ssh2
Feb 15 11:19:18 136-144-131-27 sshd[26156]: Failed password for root from 223.99.60.45 port 28917 ssh2
Feb 15 11:19:20 136-144-131-27 sshd[26156]: Failed password for root from     223.99.60.45 port 28917 ssh2
Feb 15 11:19:23 136-144-131-27 sshd[26156]: Failed password for root from 223.99.60.45 port 28917 ssh2
Feb 15 11:19:26 136-144-131-27 sshd[26156]: Failed password for root from 223.99.60.45 port 28917 ssh2
Feb 15 11:19:28 136-144-131-27 sshd[26158]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=112.85.42.110  user=root
Feb 15 11:19:30 136-144-131-27 sshd[26156]: Failed password for root from 223.99.60.45 port 28917 ssh2
Feb 15 11:19:30 136-144-131-27 sshd[26156]: error: maximum authentication attempts exceeded for root from 223.99.60.45 port 28917 ssh2 [preauth]
Feb 15 11:19:30 136-144-131-27 sshd[26156]: Disconnecting: Too many authentication failures [preauth]
Feb 15 11:19:30 136-144-131-27 sshd[26156]: PAM 5 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=223.99.60.45  user=root
Feb 15 11:19:30 136-144-131-27 sshd[26156]: PAM service(sshd) ignoring max retries; 6 > 3
Feb 15 11:19:30 136-144-131-27 sshd[26158]: Failed password for root from 112.85.42.110 port 23554 ssh2
Feb 15 11:19:31 136-144-131-27 sudo[26139]: pam_unix(sudo:session): session closed for user root
Feb 15 11:19:32 136-144-131-27 sshd[26158]: Failed password for root from 112.85.42.110 port 23554 ssh2

Looks like my server is under attack of some sort.. Like someone is bruteforcing. Anyway, tried reinstalling apache2 which resulted in PHP not being executed on the server, and now I can’t even start the apache server again due the errors..


Source: stackoverflow-php