Musings

A random collection

Archive for November 2011

TECH: Configure nginx httpd

Install and configure nginx on Fedora

  1. Deny access to all “/.ht*” files
                location ~ .*/\.ht {
                    deny all;;
                }
            
  2. Enable public_html access. Add these in /etc/nginx/conf.d/default.conf
                location ~ ^/~(.+?)(/.*)?$ {
                    alias /home/$1/public_html$2;
                }
            
  3. Add authentication
                location ~ ^/~someuser/v/(.*)$ {
                    alias /home/someuser/public_html/v/$1;
                    auth_basic "Restricted";
                    auth_basic_user_file /home/someuser/public_html/v/.htpasswd;
                }
            
  4. Create password: htpasswd -c /home/someuser/public_html/v/.htpasswd
  5. Enable nginx
            systemctl enable nginx.service
            systemctl start nginx.service
            

Written by curious

November 17, 2011 at 12:44 pm

Posted in tech-tips

TECH: Enable SSHd on Fedora Linux (systemd)

Fedora now uses systemd package to manage service start ups. In order to enable sshd in it:

systemctl start sshd.service
systemctl enable sshd.service

Do not forget to fix iptables to allow ssh traffic. Add the following line in /etc/system/iptables file

-A INPUT -m state --state NEW -m tcp -p tcp -s 192.168.15.0/24 --dport 22 -j ACCEPT

Written by curious

November 12, 2011 at 10:54 pm

Posted in linux