Skip to content

Instantly share code, notes, and snippets.

View igorparrabastias's full-sized avatar

Igor Parra Bastias igorparrabastias

View GitHub Profile
@igorparrabastias
igorparrabastias / gist:38f2ad11019612ad1573
Last active April 10, 2018 19:51
Example of vhost configuration in Plesk based server
Example of vhost configuration in Plesk based server, in this case to disable SSLv2.
1) edit/create /var/www/vhosts/domain.com/conf/vhost.conf
2) only add the needed commands that you want overwrite:
### start ###
# General setup for the virtual host, inherited from global configuration
DocumentRoot "/var/www/vhosts/domain.com/httpdocs.production"
ServerName domain.com:443
@igorparrabastias
igorparrabastias / gist:9884079
Last active August 29, 2015 13:57
Install git in Centos 5.4
step 1:
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
step 2:
yum install git
@igorparrabastias
igorparrabastias / gist:9491294
Last active August 29, 2015 13:57
Comando chmod -R (recursivo) en directorios y archivos por separado.
# Encontrar directorios (-type d) en el directorio actual (.) y darles
# acceso 755
find . -type d -exec chmod 755 {} \;
# Encontrar archivos (-type f) en el directorio actual (.) y darles
# acceso 644
find . -type f -exec chmod 644 {} \;
# Encontrar archivos (-type f) html (-name '*.htm*') en el subdirectorio
# web (./web) y darles acceso 644
@igorparrabastias
igorparrabastias / gist:9272088
Created February 28, 2014 14:33
Install npm after February 27, 2014
# Install npm (new URL is www.npmjs.org instead npmjs.org)
curl https://www.npmjs.org/install.sh | sh
# To uninstall npm:
npm rm npm -g
@igorparrabastias
igorparrabastias / gist:9255965
Created February 27, 2014 18:30
Forzar https automáticamente via .htacces
# Crea/edita .htaccess en el directorio raíz de la app
vi .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</IfModule>
@igorparrabastias
igorparrabastias / gist:9255400
Last active August 29, 2015 13:56
Creación de servidor seguro en Centos (5.x, 6.x)
# GENERAR CERTIFICADO AUTOFIRMADO
# Importante. Asume root temporalmente para estos procedimientos
su -
# Crear todo los archivos en este directorio y no borrarlos nunca! para evitar problemas con SELinux
mkdir ~/securing-server
cd ~/securing-server
# Obtener software requerido
@igorparrabastias
igorparrabastias / gist:9250511
Last active August 29, 2015 13:56
Centos: Root priviliged user creation / Creación de usuario con privilegios de root
sudo adduser username
sudo passwd username
sudo visudo
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
username ALL=(ALL) ALL