Hi, I'm Canan
Oups ...
Never forget impossible is possible
:(
Your PC ran into a problem and needs to restart.
We're just collecting some error info, and then we'll restart for you.
0% complete
For more information about this issue and possible fixes, visit
https://www.windows.com/stopcode
If you call a support person, give them this info:
Stop code: SYSTEM_SERVICE_EXCEPTION
First installation
Ubuntu
Steps
- Ensure your system is up to date
apt-get update && apt-get upgrade -y
- Installation useful packets
sudo apt-get -y install dos2unix
sudo apt-get -y install zip unzip
sudo apt install nano
sudo apt install bash-completion
sudo apt-get -y install mlocate & sudo updatedb
- > In Nano: Use CTRL+K to delete the full line / CTRL-X to exit
- Secure your server
apt-get -y install fail2ban
Update "/etc/fail2ban/jail.conf" file (if you have [ssh] inside)
- > Add or Edit (not remove !) to have following lines:
[DEFAULT]
ignoreip = 127.0.0.1/8 __YOUR_IP__
bantime = 600
maxretry = 5
- > Force reload it with:
sudo systemctl restart fail2ban
- > Check which IP try and fail with:
awk '($(NF-1) = /Ban/){print $NF}' /var/log/fail2ban.log | sort | uniq -c | sort -n
- > Secure shared memory
sudo nano /etc/fstab
- > Add or Edit (not remove !) to have following lines:
tmpfs /dev/shm tmpfs defaults,noexec,nosuid 0 0
- > Harden network with sysctl settings
sudo nano /etc/sysctl.conf
- > Add or Edit (not remove !) to have following lines:
# IP Spoofing protection
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.default.rp_filter = 1
# Ignore ICMP broadcast requests
net.ipv4.icmp_echo_ignore_broadcasts = 1
# Disable source packet routing
net.ipv4.conf.all.accept_source_route = 0
net.ipv6.conf.all.accept_source_route = 0
net.ipv4.conf.default.accept_source_route = 0
net.ipv6.conf.default.accept_source_route = 0
# Ignore send redirects
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.default.send_redirects = 0
# Block SYN attacks
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_max_syn_backlog = 2048
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 5
# Log Martians
net.ipv4.conf.all.log_martians = 1
net.ipv4.icmp_ignore_bogus_error_responses = 1
# Ignore ICMP redirects
net.ipv4.conf.all.accept_redirects = 0
net.ipv6.conf.all.accept_redirects = 0
net.ipv4.conf.default.accept_redirects = 0
net.ipv6.conf.default.accept_redirects = 0
# Ignore Directed pings
net.ipv4.icmp_echo_ignore_all = 1
- > Force reload it with:
sudo sysctl -p
- > Prevent IP Spoofing
sudo nano /etc/host.conf
- > Add or Edit (not remove !) to have following lines:
order bind,hosts
multi on
nospoof on
- > Harden PHP for security (if you have PHP installed)
sudo nano /etc/php5/apache2/php.ini
- > Add or Edit (not remove !) to have following lines:
disable_functions = exec,system,shell_exec,passthru
register_globals = Off
expose_php = Off
magic_quotes_gpc = On
- Custom startup message
sudo apt -y install screenfetch
sudo apt -y install toilet
sudo apt -y install figlet
Upload "clean.sh" and "now.sh" (in /home/Files/) and do "chmod +x clean.sh now.sh" to give it execution right to be able to use it
Upload ".profile" (in /home/Files/) to be able to use it
Update "/home/now.sh" file
- > Add or Edit (not remove !) to have following lines:
curl wttr.in/__YOUR_CITY__?0 --silent --max-time 3
Update "~/.bashrc" file
- > Add or Edit (not remove !) to have following lines:
source /home/Files/.profile
- > Force reload it with:
source ~/.bashrc
- Apache2
apt-get install -y apache2 apache2-utils
Update "/etc/apache2/conf-available/security.conf" file
- > Add or Edit (not remove !) to have following lines:
ServerTokens Prod
ServerSignature Off
- > Activate module
sudo rewrite
- > Force reload it with:
service apache2 restart
- > You can edit /etc/apache2/apache2.conf to add your custom directory rules, like:
<Directory /home/canan>
- Options -Indexes
- AllowOverride All
- Require all granted
</Directory>
Do not forget to empty (or put your site) in /var/www/html/ folder
- PHP (if needed)
sudo apt-get install -y php libapache2-mod-php php-gd
If you want to test it, simply create a test file, then go on it, finally delete it
Update "/var/www/html/test.php" file (change by yours)
- > Add to have following lines:
<?php
- phpinfo();
?>
- > Force reload it with:
service apache2 restart
- Go to http://__YOUR_IP__/test.php
- Crontab
crontab -e
- > Add or Edit (not remove !) to have following lines :
10 5 * * MON apt-get -y autoclean; apt-get -y autoremove; apt-get -y clean;
20 5 * * MON dpkg --purge $(COLUMNS=200 dpkg -l | grep "^rc" | tr -s ' ' | cut -d ' ' -f 2);
30 5 * * MON rm -fr /var/log/syslog.*; rm -fr /var/log/auth.log.*;
40 5 * * MON apt-get -y update; apt-get -y upgrade