Installing a Firewall
sudo cp /usr/share/doc/shorewall-common/myfwconfig/one-interface/* /etc/shorewall/
Note: sudo - super user do
Now, open the “rules” file:
sudo nano /etc/shorewall/rules
etc - directory for maintain lots of files.
text editor in linux
1. nano
2. vi or vim
3. emacs
4. pico
5. gedit
6. bluefish
Add these lines above where it says “#LAST LINE”
HTTP/ACCEPT net $FW
SSH/ACCEPT net $FW
Adding Web Site to Web Server
sudo usermod -g www-data [YOUR USERNAME]
sudo chown -R www-data:www-data /var/www
sudo chmod -R 775 /var/www
Note
775 - is equal to rwx rwx -rx
r - read
w - write
x - execute
other permissions
400 r-------- files
444 r--r--r-- files (read only)
600 rw------- files (file invisile to all)
666 rw-rw-rw- files
700 rwx------ allow permission to programs and directories
750 rwxr-x--- allow permission to programs and directories
755 rwxr-xr-x allow permission to programs and directories
777 rwxrwxrwx allow permission to programs and directories
Note: 777 dangerouse to use as permission
No comments:
Post a Comment