This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerName trunk.vandorjw.me | |
Redirect permanent / https://trunk.vandorjw.me/ | |
</VirtualHost> | |
<Virtualhost *:443> | |
ServerAdmin admin@xxxxxxxxxxx | |
ServerName trunk.vandorjw.me | |
DirectoryIndex index.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# -- DJANGO ENVIRONMENT VARIABLES -- | |
# | |
. /home/user-name/denvvars | |
# | |
# .bashrc | |
# | |
export WORKON_HOME=/var/virtualenvs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerName notes.vandorjw.me | |
Redirect permanent / https://notes.vandorjw.me | |
</VirtualHost> | |
<Virtualhost *:443> | |
ServerAdmin [email protected] | |
ServerName notes.vandorjw.me | |
# indexes + Directory Root, Mandatory but never used. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Check if which vhosts are running: | |
# httpd -S | |
Check your version of apache httpd | |
# httpd -v | |
If you are running centos, RHEL5,6 or 7, Fedora, remember to put |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
openssl genrsa -aes256 -passout pass:x -out server.pass.key 2048 | |
openssl rsa -passin pass:x -in server.pass.key -out server.key | |
rm server.pass.key | |
openssl req -new -key server.key -out server.csr | |
openssl x509 -req -days 30 -in server.csr -signkey server.key -out server.crt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
###DO NOT USE AS IS, please read the comments### | |
# Debian based systems | |
chown -R www-data:dev-ops /var/www/ | |
chmod -R u+rX-w,g+rwX,o-rwx /var/www/ | |
# RHEL based |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
As root, set everything under /var/www to httpd_sys_content_t | |
(sh) # semanage fcontext -a -t httpd_sys_content_t "/var/www(/.*)?" | |
(sh) # restorecon -R /var/www/ | |
As root, set everything under /var/virtualenvs to lib_t | |
(sh) # semanage fcontext -a -t lib_t "/var/virtualenvs(/.*)?" | |
(sh) # restorecon -R /var/virtualenvs/ | |
If you want to apply this to a single file, just specify the file, and on restorecon, remove the "-R" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For a server not running X we need to have setools-console and optionally fpaste installed. | |
fpaste will put the results on the fedora pastebin | |
(| fpaste optional in each command) | |
(shell) # yum install setools-console | |
The following seems to check if booleans are set. | |
(shell) sesearch -ASCT -s httpd_t -t postgresqld_port_t -c tcp_socket -p name_connect | fpaste |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo groupadd $GRP-NAME | |
sudo usermod -G $GRP-NAME -a $USR-NAME | |
setfacl -Rm g:$GRP-NAME,d:g:$GRP-NAME:rwX /top/level/directory/location | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo yum install uwsgi uwsgi-plugins-python3 | |
uwsgi.ini | |
[uwsgi] | |
#variables | |
projectname = vandorjw | |
base = /var/sites/me/vandorjw |
OlderNewer