Categories
Uncategorized

nginx 403 error on Centos 7

I had modified the default root config of /etc/nginx/nginx.conf from

server {
...
       #root         /usr/share/nginx/html; 
...
}

To

server {
...
       root         /var/www/default;
...
}

I created a folder and index.html

mkdir -p /var/www/default
chown -R nginx:nginx /var/www/default
chmod -R 755 /var/www/default
touch /var/www/default/index.html (I then added some content to this file)
chmod 644 /var/wwww/default/index.html

After restarting nginx I got a 403 error, this was due to SELinux. The fix

sudo setsebool -P httpd_can_network_connect on
getenforce
chcon -Rt httpd_sys_content_t /var/www/default/
Categories
Uncategorized

Reset Windows admin password

Boot from a flash drive, select repair, troubleshoot, command prompt

cd windows\system32
copy utilman.exe utilman.old
copy cmd.exe utilman.exe
reboot

Click on the the Easy of Access icon (botton right corner), this will open a command prompt

net user # this will show the list of local users
net user /add newusername newuserpassword # add a new user with given password
net localgroup administrators newusername /add #add new user to admin group

Categories
Uncategorized

ZFS set/get user quota

zfs set userquota@username=10g tankname/dirname
zfs get userquota@username tankname/dirname

Check disk space usage

zfs userspace tankname/dirname
Categories
Uncategorized

Create a self signed certificate using mkcert

brew install mkcert
#Now create your cert, run it as a regular user
mkdir certs
cd certs
mkcert -CAROOT
mkcert -install
# Make the cert files
mkcert drupal89.local

The above commands will create two files

/home/username/certs/drupal89.local.pem
/home/username/certs/drupal89.local-key.pem

Install the SSL module


yum install mod_ssl

Configure your virtual host with the cert

emacs /etc/httpd/conf.d/drupal89.conf

Add the new certs

<VirtualHost drupal89.local:80>
Redirect "/" "https://drupal83.local/"
</VirtualHost>

<VirtualHost drupal89.local:443>
ServerName drupal89.local:443
ServerAlias www.drupal89.local:443
DocumentRoot /var/www/html/drupal89
ErrorLog /var/log/httpd/drupal89_error_log
CustomLog /var/log/httpd/drupal89_access_log combined
SSLCertificateFile /home/username/certs/drupal89.local.pem
SSLCertificateKeyFile /home/username/certs/drupal89.local-key.pem
<Directory /var/www/html/drupal89>
            Options Indexes FollowSymLinks
            AllowOverride All
            Require all granted
            RewriteEngine on
            RewriteBase /
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
     </Directory>
</VirtualHost>

Restart apache

systemctl restart httpd