Instalación Centos 7 Linode: Documentroot /Var/Www/Html/ Servername Qollanahotel - Pe Sslengine On
Instalación Centos 7 Linode: Documentroot /Var/Www/Html/ Servername Qollanahotel - Pe Sslengine On
Instalación Centos 7 Linode: Documentroot /Var/Www/Html/ Servername Qollanahotel - Pe Sslengine On
200:443>
ServerAdmin contactos@creativapixel.com
DocumentRoot /var/www/html/
ServerName qollanahotel.pe
SSLEngine on
#SSLCertificateFile /etc/letsencrypt/live/qollanahotel.pe/cert.pem
#SSLCertificateKeyFile
/etc/letsencrypt/live/qollanahotel.pe/privkey.pem
#SSLCertificateChainFile
/etc/letsencrypt/live/qollanahotel.pe/fullchain.pem
</VirtualHost>
actualizar centos
deshabilitamos selinux
nano /etc/sysconfig/selinux
reboot
ingresar
#!/bin/bash
exec /bin/php56-cgi
EOF
ingresar
#!/bin/bash
exec /bin/php72-cgi
EOF
<Directory /var/www/html/php56>
DirectoryIndex index.php
AllowOverride all
</Directory>
<Directory /var/www/html/php72>
DirectoryIndex index.php
AllowOverride all
</Directory>
EOF
mkdir -p /var/www/html/php56
mkdir -p /var/www/html/php72
firewall-cmd --reload
probar
http://127.0.0.1/php56
http://127.0.0.1/php72
INSTALAR NGINX
sudo nginx -v
buscar
server_name _;
reemplazar por
certbot --nginx
INSTALAR LETSENCRYP
certbot --nginx
certbot --apache
cp /etc/httpd/conf/httpd.conf ~/httpd.conf.backup
INSTALAR MARIADB 10
nano /etc/yum.repos.d/MariaDB10.repo
Y agregamos
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.5/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
instalamos
sudo mysql_secure_installation
HABILITAR EL CACHE DE CONSULTAS EN MYSQL
nano /etc/yum.repos.d/MariaDB10.repo
Y agregamos
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.5/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
eliminamos cache
instalamos
mysql_upgrade
mysql -V
INSTALAR MULTIPLE PHP CON NGINX EN UN DOMINIO
- Obtenemos
/opt/remi/php56/root/etc/php-fpm.d/www.conf
/opt/remi/php56/root/etc/php.ini
/etc/php.ini
/etc/opt/remi/php74/php-fpm.d/www.conf
/etc/opt/remi/php74/php.ini
user = nginx
group = nginx
listen.owner = nginx
listen.group = nginx
pm = static
pm.max_children = 12
nano /opt/remi/php56/root/etc/php-fpm.conf
y cambiamos
emergency_restart_threshold 10
emergency_restart_interval 1m
process_control_timeout 10s
cgi.fix_pathinfo=1
mkdir -p /var/www/html/misitio.com/
mkdir -p /var/www/html/misitio.com/php56
mkdir -p /var/www/html/misitio.com/php74
mkdir -p /var/log/nginx/rado/misitio.com_access_log
mkdir -p /var/log/nginx/rado/misitio.com_error_log
server {
listen 80;
autoindex on;
index index.php index.html index.htm;
#access_log /var/log/nginx/rado/rado_access_log;
location / {
#cache de archivos
location ~* \.(jpg|jpeg|png|gif|ico)$ {
access_log off;
log_not_found off;
expires 30d;
location ~* \.(css|js)$ {
access_log off;
log_not_found off;
expires 30d;
location ~ \.php$ {
fastcgi_pass unix:/var/run/php5-fpm.sock;
#versión php56 por defecto para todo el sitio
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
include fastcgi_params;
include /etc/nginx/fastcgi_params;
fastcgi_buffer_size 128k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
location ~ ^/prueba2/(.+\.php)$ {
fastcgi_pass unix:/var/run/php7-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
nginx -t
yum -y update
nano /etc/httpd/conf.d/phpMyAdmin.conf
<Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF-8
<IfModule mod_authz_core.c>
# Apache 2.4
# <RequireAny>
# Require ip 127.0.0.1
# Require ip ::1
# </RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
Order Deny,Allow
# Apache 2.2
# Order Deny,Allow
</IfModule>
</Directory>
ln -s /usr/share/phpMyAdmin /usr/share/nginx/html
//para php56
//para php7
location /phpMyAdmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpMyAdmin/(.+\.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
location ~* ^/phpMyAdmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|
html|xml|txt))$ {
root /usr/share/;
}
}
location /phpmyadmin {
rewrite ^/* /phpMyAdmin last;
}
wget https://files.phpmyadmin.net/phpMyAdmin/5.0.1/phpMyAdmin-
5.0.1-all-languages.tar.gz
EDITAR
sudo nano /usr/share/phpMyAdmin/config.inc.php
y agregamos el location
location /phpMyAdmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpMyAdmin/(.+\.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_pass unix:/var/run/php7-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
location ~* ^/phpMyAdmin/(.+\.(jpg|jpeg|gif|css|
png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
location /phpmyadmin {
rewrite ^/* /phpMyAdmin last;
}
INSTALAR POSTGRESQL
yum install
https://download.postgresql.org/pub/repos/yum/9.4/redhat/rhel-6.9-
x86_64/pgdg-centos94-9.4-3.noarch.rpm
/usr/pgsql-9.4/bin/postgresql94-setup initdb
modificar
nano /var/lib/pgsql/9.4/data/postgresql.conf
modificar la linea
listen_addresses = '*'
luego modificar
nano /var/lib/pgsql/9.4/data/pg_hba.conf
agregar la linea
grabamos y reiniciamos
ahora ingresamos
su postgres
bash-4.1> psql
salimos
postgres=# \q
probamos conexión
– también
<VirtualHost *:80>
<Directory /var/www/html>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
. . .
</VirtualHost>
php -v
INSTALAR WEBMIN
nano /etc/yum.repos.d/webmin.repo
copiar
[Webmin]
luego
wget http://www.webmin.com/jcameron-key.asc
yum check-update
chkconfig webmin on
adduser andres
passwd andres
editamos
nano /etc/webmin/miniserv.users
agregamos
andres:x:0:::::::0:0
nano etc/webmin/webmin.acl
agregamos
andres: acl adsl-client apache at backup-config bacula-backup bandwidth bind8 burner cfengine
change-user cluster-copy cluster-cron cluster-passwd cluster-shell cluster-software cluster-
useradmin cluster-usermin cluster-webmin cpan cron custom dfsadmin dhcpd dnsadmin dovecot
exim exports fdisk fetchmail file filter firewall frox fsdump grub heartbeat htaccess-htpasswd
idmapd inetd init inittab ipfilter ipfw ipsec jabber krb5 ldap-client ldap-server ldap-useradmin lilo
logrotate lpadmin lvm mailboxes mailcap majordomo man mon mount net nis openslp pam pap
passwd phpini postfix postgresql ppp-client pptp-client pptp-server procmail proc pserver
qmailadmin quota raid samba sarg sendmail sentry servers shell shorewall smart-status smf
software spam squid sshd status stunnel syslog syslog-ng tcpwrappers telnet time tunnel updown
useradmin usermin vgetty webalizer webminlog webmin xinetd vsftpd mysql package-updates
system-status webmincron ajaxterm
reiniciamos
service webmin restart
sed -i "s%http://dominio.com%https://www.dominio.com%g"
bdprueba.sql
INSTALAR FTP
- editar en
nano /etc/opt/remi/php74/php-fpm.d/www.conf
- la linea
security.limit_extensions = .php
nano /etc/nginx/conf.d/default.conf
- agregar
location ~ ^(.+\.php)(.*)$ {
root /usr/share/nginx/html/moodle/;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:9000;
include /etc/nginx/mime.types;
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
2. Agregamos 1 sitio
ines.ns.cloudflare.com
ines.ns.cloudflare.com
Ahora regrese a su servidor para continuar con el proceso de obtención del certificado.
sudo certbot
agregamos
dns_cloudflare_email = your_cloudflare_login
dns_cloudflare_api_key = your_cloudflare_api_key
Output
...
Plugins selected: Authenticator dns-cloudflare, Installer None
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel): your email
Output
-------------------------------------------------------------------------------
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v02.api.letsencrypt.org/directory
-------------------------------------------------------------------------------
(A)gree/(C)ancel: A
Output
-------------------------------------------------------------------------------
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about EFF and
our work to encrypt the web, protect its users and defend digital rights.
-------------------------------------------------------------------------------
(Y)es/(N)o: N
Output
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/your_domain/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/your_domain/privkey.pem
Your cert will expire on 2018-07-31. To obtain a new or tweaked
version of this certificate in the future, simply run certbot
again. To non-interactively renew *all* of your certificates, run
"certbot renew"
- Your account credentials have been saved in your Certbot
configuration directory at /etc/letsencrypt. You should make a
secure backup of this folder now. This configuration directory will
also contain certificates and private keys obtained by Certbot so
making regular backups of this folder is ideal.
- If you like Certbot, please consider supporting our work by:
sudo ls /etc/letsencrypt/live/your_domain
Output
cat /etc/letsencrypt/live/your_domain/README
Desde aquí, puede configurar sus servidores con el certificado comodín. Por lo general, solo
necesitará dos de estos archivos: fullchain.pem y privkey.pem.
antes instalamos
abrimos puertos
EN APACHE
Listen 443
<VirtualHost *:443>
ServerAdmin contactos@creativapixel.com
DocumentRoot /var/www/html/
ServerName dominio.com
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/dominio.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/dominio.com/privkey.pem
#SSLCertificateChainFile /etc/letsencrypt/live/dominio.com/fullchain.pem
</VirtualHost>
grabamos y luego
Output
. . .
Syntax OK
EN NGINX
en etcnginx/conf.d/dominio.conf
server {
server_name dominio.com;
ssl_certificate /etc/letsencrypt/live/dominio.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/dominio.com/privkey.pem;
root /var/www/html;
si hay error renombrar el archivo coomo ssl.conf.bak, ese archivo debe estar
vacio o no existir
/etc/httpd/conf.d/ssl.conf